
## Review A dedicated reviewer checked the rule description successfully for: - [ ] logical errors and incorrect information - [ ] information gaps and missing content - [ ] text style and tone - [ ] PR summary and labels follow [the guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
10 lines
534 B
Plaintext
10 lines
534 B
Plaintext
== How to fix it
|
|
|
|
Gratuitous boolean expressions are suspicious and should be carefully removed from the code.
|
|
|
|
First, the boolean expression in question should be closely inspected for logical errors.
|
|
If a mistake was made, it can be corrected so the condition is no longer gratuitous.
|
|
|
|
If it becomes apparent that the condition is actually unnecessary, it can be removed. The associated control flow construct
|
|
(e.g., the `if`-statement containing the condition) will be adapted or even removed, leaving only the necessary branches.
|