== Why is this an issue?

Having all branches of a `case` or `if` chain with the same implementation indicates a problem.

In the following code:

[source,ruby]
----
if b == 0  # Noncompliant
  doOneMoreThing()
else
  doOneMoreThing()
end

b = a > 12 ? 4 : 4;  # Noncompliant

case i  # Noncompliant
  when 1
    doSomething()
  when 2
    doSomething()
  when 3
    doSomething()
  else 
    doSomething()
end
----

Either there is a copy-paste error that needs fixing or an unnecessary `case` or `if` chain that needs removing.

=== Exceptions

This rule does not apply to `if` chains nor `case` without `else`.


[source,ruby]
----
if b == 0 # no issue, this could have been done on purpose to make the code more readable
  doSomething()
elsif b == 1
  doSomething()
end
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../highlighting.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
