Do not use iterator variables outside the for loop.
Priority
Mandatory
Severity level
2
Description
Do not use iterator variables outside the for loop, since this might lead to unexpected behavior.
Rationale
Using a loop iterator variable outside the for loop might indicate a programming error. For example if the for loop is not entered, the iterator variable becomes an empty double.