Inspectopedia Help

Loop statement that doesn't loop

Reports for or while statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.

Example:

for (int i in 0..<10) { return }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Groovy, 233.SNAPSHOT

Last modified: 13 July 2023