rspec/rules/S5797/description.adoc
github-actions[bot] 5273746944
Create rule S5797 (#4170)
* Add php to rule S5797

* Create PHP rule S5797

* Update PHP rule S5797 examples

* Update rule S5797 includes

---------

Co-authored-by: rudy-regazzoni-sonarsource <rudy-regazzoni-sonarsource@users.noreply.github.com>
Co-authored-by: GabinL21 <gabin.laigle21@gmail.com>
2024-09-03 12:13:36 +02:00

6 lines
352 B
Plaintext

This rule raises an issue when a constant expression is used as a condition in an ``++if++``, ``++elif++``, a conditional expression or other boolean expressions.
== Why is this an issue?
When a constant is used as a condition, either it has no effect on the execution flow and it can be removed, or some code will never be executed and it is a bug.