A function has more lines than the configured maximum

tx0/rust:long-functionrecommendedwarningmaintainability/complexitydepth fastmaintainability

What it finds

A long function does many things, and each has to be understood together with the rest. Splitting it into functions with names says what the parts do. The lines of the body count, from its { to its }, blank lines and comments included, since they are lines to read. The maximum is the parameter max_lines, 100 by default.

From the rule's source, long_function.rs.

Turn it on, off or suppress it

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

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

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