Why is this an issue?

When using splitn with zero or one splits, the function does not actually split the value, which is likely not the intended behavior.

Code examples

Noncompliant code example

let s = "";
for x in s.splitn(1, ":") { // Noncompliant
    // ..
}

Compliant solution

let s = "";
for x in s.splitn(2, ":") { // Compliant
    // ..
}

Resources

Documentation