Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
5 | class BankBillet extends BaseResource { |
||
6 | public function cancel() { |
||
10 | |||
11 | public function duplicate($params = array()) { |
||
15 | |||
16 | View Code Duplication | public static function cnpj_cpf($cnpj_cpf) { |
|
27 | |||
28 | View Code Duplication | public static function status($status) { |
|
39 | |||
40 | View Code Duplication | public static function our_number($our_number) { |
|
51 | } |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.