rspec/rules/S2751/rule.adoc

18 lines
334 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
When the same condition is checked twice in quick succession, it is probably inefficient, and likely an error. Usually, the intent was to check a different condition.
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,text]
----
if (a.length() > 5) {
//...
}
if (a.length() > 5) { // Noncompliant
// ...
}
----