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 |
||
| 14 | class PersonService extends FinderAbstractService |
||
| 15 | { |
||
| 16 | protected $config; |
||
| 17 | |||
| 18 | protected $personEntity = false; |
||
| 19 | |||
| 20 | public function __construct($config = false) |
||
| 26 | |||
| 27 | View Code Duplication | public function aboutBody($config = false) |
|
| 35 | |||
| 36 | View Code Duplication | public function aboutLikes($config = false) |
|
| 44 | |||
| 45 | |||
| 46 | public function aboutPersonagens($config = false) |
||
| 53 | |||
| 54 | |||
| 55 | /** |
||
| 56 | * Localizar |
||
| 57 | */ |
||
| 58 | public function aboutLocals($config = false) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * ORganizacao |
||
| 71 | */ |
||
| 72 | |||
| 73 | public function aboutSenhas($config = false) |
||
| 79 | |||
| 80 | public function aboutInfo($config = false) |
||
| 94 | } |
||
| 95 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.