KT.LOOP_WITH_TOO_MANY_JUMP_STATEMENTS
Loops with multiple breaks or continue statements
Loops which contain multiple break or continue statements are hard to read and understand. To increase readability they should be refactored into simpler loops.
Noncompliant Code
Copy
val strs = listOf("foo, bar")
for (str in strs) {
if (str == "bar") {
break
} else {
continue
}
}
Options
-
maxJumpCount
(default:1
)maximum allowed jumps in a loop