Inspectopedia
 
2024.3

Unconventional 'for' loop

Info
New
Last modified: 03 December 2024

Reports usages of for loops. It is preferable to use .each over for loops.

Example:

A quick-fix is available to convert a for loop into an .each loop. After the quick-fix is applied, the result looks like this:

Inspired by 'Roodi'