Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Improve the rule decription
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource committed Mar 13, 2023
1 parent 5af5c98 commit c347dae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/rules/no-identical-conditions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# no-identical-conditions

A chain of `if-else-if` and `switch-case` statements is evaluated from top to bottom. At most, only
one branch will be executed: the first one with a condition that evaluates to `true` or that matches the discriminant.
one branch will be executed: the first one with a condition that evaluates to `true` or that matches the discriminant of the `switch`.

Therefore, duplicating a condition automatically leads to dead code. Usually, this is due to a
copy/paste error. At best, it's simply dead code and at worst, it's a bug that is likely to induce
Expand Down

0 comments on commit c347dae

Please sign in to comment.