Why is this an issue?
Any statement (other than a null statement, which means a statement containing only a semicolon ;
) which has no side effect and does
not result in a change of control flow will normally indicate a programming error, and therefore should be refactored.
Noncompliant code example
a == 1; // Noncompliant; was assignment intended?
var msg = "Hello, "
"World!"; // Noncompliant; have we forgotten '+' operator on previous line?
Resources