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 |
||
| 11 | class PurgeFileQuery extends AbstractResourcesAwareQuery implements QueryInterface |
||
| 12 | { |
||
| 13 | const URL = 'https://api.cdn77.com/v2.0/data/purge'; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param null $resource |
||
| 17 | * @param array $files |
||
| 18 | * |
||
| 19 | * @return mixed|null |
||
| 20 | */ |
||
| 21 | 1 | public function execute($resource = null, array $files = array()) |
|
| 47 | } |
||
| 48 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.