rspec/rules/S1871/rule.adoc
2023-10-24 12:02:02 +00:00

19 lines
490 B
Plaintext

== Why is this an issue?
When the same code is duplicated in two or more separate branches of a conditional,
it can make the code harder to understand, maintain, and can potentially introduce
bugs if one instance of the code is changed but others are not.
include::{description}[]
include::{noncompliant}[]
include::{compliant}[]
include::{exceptions}[]
== Resources
=== Related rules
* S3923 - All branches in a conditional structure should not have exactly the same implementation