Useless if Conditional Info

Having if/else blocks that check the same condition in both branches is redundant. The second check evaluates the same as the first, adding no value. Redundant conditional checks create unnecessary logic complexity. Removing the duplicate conditions simplifies control flow without functional impact. Code should avoid redundant checks on the same variables or expressions for clarity.

Detector ID
go/useless-if-conditional@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-
Tags
-