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 |
||
| 13 | class m2_acp_module extends \phpbb\db\migration\migration |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * {@inheritDoc} |
||
| 17 | */ |
||
| 18 | View Code Duplication | public function effectively_installed() |
|
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritDoc} |
||
| 33 | */ |
||
| 34 | static public function depends_on() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Add the ACP module |
||
| 41 | * |
||
| 42 | * @return array Array of data update instructions |
||
| 43 | */ |
||
| 44 | public function update_data() |
||
| 62 | } |
||
| 63 |