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 |
||
15 | class Status { |
||
16 | /** |
||
17 | * Is Jetpack in development (offline) mode? |
||
18 | * |
||
19 | * @return bool Whether Jetpack's development mode is active. |
||
20 | */ |
||
21 | View Code Duplication | public function is_development_mode() { |
|
44 | } |
||
45 |