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 |
||
| 20 | View Code Duplication | class WordPress extends Basic |
|
| 21 | { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * |
||
| 25 | * @param string $email_address |
||
| 26 | * @return boolean |
||
| 27 | * @throws EmailValidationException |
||
| 28 | */ |
||
| 29 | public function validate($email_address) |
||
| 39 | |||
| 40 | |||
| 41 | } |
||
| 42 | // End of file WordPressEmailValidation.php |
||
| 44 |