rspec/rules/S1871/description.adoc
2021-01-27 13:42:22 +01:00

2 lines
351 B
Plaintext

Having two ``++cases++`` in a ``++switch++`` statement or two branches in an ``++if++`` chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an ``++if++`` chain they should be combined, or for a ``++switch++``, one should fall through to the other.