A function has more decision points than the configured maximum

tx0/rust:high-complexityrecommendedwarningmaintainability/complexitydepth fastmaintainability

What it finds

A function with many decisions has many paths, each of which needs to be understood and tested. The complexity counted here is one, plus one for each if, while, for, loop, &&, || and ?, and for each match arm beyond the first. Closures count toward the function they are in; nested functions count for themselves. The maximum is the parameter max_complexity, 20 by default.

From the rule's source, high_complexity.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:high-complexity" = "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:high-complexity] reason="..."

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