![github-actions[bot]](/assets/img/avatar_default.png)
* Create rule S7439 * Update rule.adoc * Update metadata.json * Update rule.adoc * Update metadata.json --------- Co-authored-by: sallaigy <sallaigy@users.noreply.github.com> Co-authored-by: Gyula Sallai <gyula.sallai@sonarsource.com>
21 lines
474 B
Plaintext
21 lines
474 B
Plaintext
|
|
== Why is this an issue?
|
|
|
|
Comparisons involving overlapping ranges that can never be true are likely a programming mistake and can result in unreachable code.
|
|
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
[source,rust]
|
|
----
|
|
if status_code <= 400 && status_code > 500 { // Noncompliant: The condition can never be true.
|
|
// ...
|
|
}
|
|
----
|
|
|
|
== Resources
|
|
=== Documentation
|
|
|
|
* Clippy Lints - https://rust-lang.github.io/rust-clippy/master/index.html#impossible_comparisons
|