Ruby

Ruby

Made by DeepSource

Use Integer#times for a simple loop which iterates a fixed number of times RB-ST1035

Anti-pattern
Minor
Autofix

for loops which iterate a constant number of times, using a Range literal and #each, can be done more readably using Integer#times.

This check only applies if the block takes no parameters.

Bad practice

(1..5).each { }

Recommended

5.times { }