Inspectopedia Help

Assignment issues

Assignment could be replaced with operator assignment  

Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer.

Assignment to 'for' loop parameter  

Reports an assignment to a variable declared as a for loop parameter.

Assignment to function parameter  

Reports an assignment to a function parameter, including increment and decrement operations.

Assignment used as condition  

Reports an assignment that is used as the condition of an if, while, for, or do statement.

Nested assignment  

Reports an assignment expression nested inside another expression, for example, a = b = 1.

Result of assignment used  

Reports an assignment expression where the result of the assignment is used in the containing expression.

Variable is assigned to itself  

Reports an assignment in the form x = x.

Last modified: 29 April 2024