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: 03/19/2024 12:33:46.000 AM