The parameter list of a method or constructor is longer than the limit
What it finds
A method with many parameters is hard to call correctly: arguments of the same type are easily swapped, and every caller has to supply all of them. Related values grouped into an object of their own make calls shorter and keep them in order.
Counted are the declared parameters of methods and constructors; the limit is the parameter max, 7 by default. Methods marked @Override are left alone, since their parameters are given by the method they override, and so are the constructors of records, whose parameters are the components.
From the rule's source, too_many_parameters.rs.
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:
[rules]
"tx0/java:long-parameter-list" = "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/java:long-parameter-list] reason="..."tx0 explain tx0/java:long-parameter-list shows the same in the terminal. Found a false positive? Report it.