rewrite-static-analysis icon indicating copy to clipboard operation
rewrite-static-analysis copied to clipboard

Function returns should not be invariant

Open aegershman opened this issue 4 years ago • 2 comments

see: https://rules.sonarsource.com/java/RSPEC-3516

When a method is designed to return an invariant value, it may be poor design, but it shouldn’t adversely affect the outcome of your program. However, when it happens on all paths through the logic, it is surely a bug.

aegershman avatar Jul 21 '21 17:07 aegershman

Going to close this for now. While we could hack something together now, a more thorough treatment requires support for dataflow analysis that we haven't yet begun to design.

sambsnyd avatar Aug 22 '21 22:08 sambsnyd

@sambsnyd Dataflow analysis is in development.

jkschneider avatar Aug 22 '21 23:08 jkschneider