Duplicate condition branches (ARCH2190)
Key python.quality.duplicate-branches · Severity warning · Category quality
Branches with identical bodies are either a copy-paste mistake or a redundant condition. Merge the branches.
Incorrect
Section titled “Incorrect”if status == "new": notify(user)elif status == "pending": notify(user)else: archive(user)Correct
Section titled “Correct”if status in ("new", "pending"): notify(user)else: archive(user)Merge branches with identical bodies into one condition, or make them differ.