A function or constructor has more parameters than the configured maximum

tx0/kotlin:parameter-count-limitstrictwarningmaintainability/complexitydepth fastmaintainability

What it finds

Many parameters are hard to pass in the right order and suggest that some belong together in a type. Overrides are left alone, as their signature is given, and so are the constructors of data classes, whose parameters are their properties. The maximum is the parameter max, 7 by default.

From the rule's source, parameter_count.rs.

Example from the rule's tests
fun wide(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int, g: Int, h: Int) = atx0 reports: wide has 8 parameters, more than 7fun narrow(a: Int, b: Int) = aclass Wide(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int, g: Int, h: Int)tx0 reports: the constructor of Wide has 8 parametersdata class Record(val a: Int, val b: Int, val c: Int, val d: Int, val e: Int, val f: Int, val g: Int, val h: Int)
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/kotlin:parameter-count-limit" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/kotlin:parameter-count-limit] reason="..."

tx0 explain tx0/kotlin:parameter-count-limit shows the same in the terminal. Found a false positive? Report it.