A struct has more bool fields than the configured maximum

tx0/rust:many-bool-fieldsstrictnotemaintainability/complexitydepth fastsmell

What it finds

A struct with many bool fields is often a state machine or a set of options in disguise: the fields allow combinations that make no sense, and every function has to check them. An enum, or a set of flags, describes the states that exist. The maximum is the parameter max_bools, 3 by default.

From the rule's source, many_bool_fields.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/rust:many-bool-fields" = "note"

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:many-bool-fields] reason="..."

tx0 explain tx0/rust:many-bool-fields shows the same in the terminal. Found a false positive? Report it.