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

Assignments should not be redundant

Open aegershman opened this issue 4 years ago • 3 comments

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

This rule raises an issue when an assignment is useless because the assigned-to variable already holds the value on all execution paths.

aegershman avatar Jul 21 '21 17:07 aegershman

This rule uses a resolves each flow of a symbol to check the end states for redundant assignments.

It's a really interesting problem, but I am putting this aside since it will take a significant time investment.

traceyyoshima avatar Jul 30 '21 00:07 traceyyoshima

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