rspec/rules/S3502/rule.adoc

19 lines
424 B
Plaintext

== Why is this an issue?
Having two methods in the same class with the same body is suspicious and potentially confusing. If it is due to a bad copy/paste, it should be fixed. If it's on purpose, it is clearer for the second method to simply call the first.
=== Noncompliant code example
[source,text]
----
public void doTheThing() {
this.x = 4;
}
public void doTheOtherThing { // Noncompliant
this.x = 4;
}
----