A function has more decision points than the configured maximum
What it finds
Each decision in a function adds a path through it that a reader has to follow and a test has to cover. A function with many of them is hard to understand and to test fully.
The count starts at one for the function and adds one for each if, conditional expression, loop, case clause and catch clause, and for each &&, || and ??, including their assignment forms, since each of them may skip code. A default clause and an else do not add a path of their own. Nested functions are counted on their own and not toward the function around them. The limit is the parameter max (20 by default).
From the rule's source, branch_count.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:
[rules]
"tx0/ts:branch-count" = "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/ts:branch-count] reason="..."tx0 explain tx0/ts:branch-count shows the same in the terminal. Found a false positive? Report it.