- detector id:
tautology
- severity: low
Find simple tautology (true
or false
involved in the condition) which makes a branch deterministic.
let ok: bool = check_state();
if true || ok {
// ...
} else {
// ...
}
In this demo, the code inside the else
branch will never be executed. This is because true || ok
is a tautology.