sonar-openedge icon indicating copy to clipboard operation
sonar-openedge copied to clipboard

Variable is assigned but never read not triggered when variable only assigns itself

Open stefandrissen opened this issue 5 years ago • 1 comments

Environment: SonarLint for Eclipse 3.6.1008

def var foo as int.

foo = foo - 1.

Nothing is actually using foo, so the 'variable is assigned but never read' rule should be flagging it, ie an assignment of a variable to itself should not count as "reading" it.

stefandrissen avatar Jun 18 '19 11:06 stefandrissen

Right, the engine currently doesn't take into account this case.

gquerret avatar Jun 19 '19 11:06 gquerret