CA020 - Variable not read after assignment


An assignment to a local variable has not effect at all if the variable is not read after the assignment, or reassigned.

Scope Instruction
Status Enabled
Severity Warning
Applicability All
Score 70

Example of violation

local x, y: INTEGER do x := 3 y := some_height_query x := some_width_query ... end


Remove the assignment without effect.

In the example, remove the first assignment to x:local x, y: INTEGER do y := some_height_query x := some_width_query ... end

SeeAlso : [[CA071 - Self-comparison]]

cached: 02/26/2017 7:56:57.000 AM