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 |
||
| 14 | class CliTest extends BaseTestRunner |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Tests Cli::execute |
||
| 18 | */ |
||
| 19 | public function testExecuteSuccess() |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Tests Cli::execute |
||
| 37 | * |
||
| 38 | * @expectedException \Exception |
||
| 39 | */ |
||
| 40 | View Code Duplication | public function testExecuteFailure() |
|
| 54 | } |
||
| 55 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.