rspec/rules/S2589/why-is-this-an-issue.adoc
nicolas-gauthier-sonarsource ab6d0f08b7
Modify S2589: Migrate to LaYC (#3297)
## 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)
2023-10-18 14:26:59 +02:00

9 lines
377 B
Plaintext

== Why is this an issue?
Control flow constructs like `if`-statements allow the programmer to direct the
flow of a program depending on a boolean expression.
However, if the condition is always true or always false, only one of the
branches will ever be executed.
In that case, the control flow construct and the condition no longer serve a
purpose; they become _gratuitous_.