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 |
||
| 7 | class DirectoryCreator extends Creator |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Create all the directories and files necessary for Yarak DB functions. |
||
| 11 | */ |
||
| 12 | public function create() |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Create factory file stub. |
||
| 30 | */ |
||
| 31 | View Code Duplication | protected function createFactoriesFile() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Create seeder file stub. |
||
| 53 | */ |
||
| 54 | View Code Duplication | protected function createSeederFile() |
|
| 73 | } |
||
| 74 |