Hardcoded true or false Info

Using hardcoded true or false boolean conditions in if statements is redundant and adds unnecessary complexity. Comparing a variable to true or false will always evaluate to the same result. To simplify the code and enhance maintainability, the redundant true or false condition should be removed from the if statement based on the existing logic. This removes redundant code that impacts readability without changing functionality.

Detector ID
go/hardcoded-eq-true-or-false@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-
Tags
-