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 |
||
| 6 | class CatalogProductInquiryTest extends SapphireTest |
||
| 7 | { |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected static $fixture_file = 'product-catalog/tests/fixtures.yml'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Ensure any current member is logged out |
||
| 16 | */ |
||
| 17 | public function logOut() |
||
| 23 | |||
| 24 | /** |
||
| 25 | * |
||
| 26 | */ |
||
| 27 | public function testGetCMSFields() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * |
||
| 34 | */ |
||
| 35 | public function testGetFrontEndFields() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * |
||
| 47 | */ |
||
| 48 | public function testGetFrontEndActions() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * |
||
| 57 | */ |
||
| 58 | public function testGetFrontEndRequiredFields() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * |
||
| 68 | */ |
||
| 69 | public function testProvidePermissions() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * |
||
| 87 | */ |
||
| 88 | public function testCanCreate() |
||
| 92 | |||
| 93 | /** |
||
| 94 | * |
||
| 95 | */ |
||
| 96 | public function testCanEdit() |
||
| 100 | |||
| 101 | View Code Duplication | public function testCanView() |
|
| 115 | |||
| 116 | View Code Duplication | public function testCanDelete() |
|
| 130 | |||
| 131 | } |
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.