A lambda body has more lines of code than the limit

tx0/java:long-lambdastrictwarningmaintainability

What it finds

A lambda is read in the middle of the expression it is passed to. A long one pushes the rest of that expression out of sight, and has no name to say what it does; a method, passed as a method reference, has one.

Counted are the lines of code of a lambda's block body. A lambda above the parameter max-lines, 20 by default, is reported, and lambdas inside it are not.

From the rule's source, long_lambda.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:

tx0.toml
[rules]
"tx0/java:long-lambda" = "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-lambda] reason="..."

tx0 explain tx0/java:long-lambda shows the same in the terminal. Found a false positive? Report it.