CA024 - Use across loop

Description

When iterating on an instance of ITERABLE with a traditional from ... until ... loop ...end from beginning to end you should use an across loop to avoid forgetting to advance the cursor.

Scope Instruction
Status Enabled
Severity Suggestion
Applicability All
Score 30

Example of violation

from list.start until list.after loop ... list.forth end

Recommendation

Replace with an across loop. In the example it becomes: across list as l loop ... end

cached: 11/21/2024 2:05:43.000 AM