The condition of an if is a constant, so one branch never runs

tx0/cpp:constant-if-conditionstrictwarningmaintainability/designdepth fastsmell

What it finds

if (0) { ... } or if (1): one branch is dead code kept in a form the compiler still checks; a comment or removing the code says the same more plainly.

From the rule's source, constant_if_condition.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/cpp:constant-if-condition" = "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/cpp:constant-if-condition] reason="..."

tx0 explain tx0/cpp:constant-if-condition shows the same in the terminal. Found a false positive? Report it.