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 PaginatedKnpLabsRepoFacadeTest extends \PHPUnit_Framework_TestCase |
||
| 12 | { |
||
| 13 | private $facade; |
||
| 14 | |||
| 15 | public function setUp() |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @group GithubIntegration |
||
| 27 | * @group Live |
||
| 28 | */ |
||
| 29 | public function testFetchRepoDetails() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @group GithubIntegration |
||
| 38 | * @group Live |
||
| 39 | */ |
||
| 40 | public function testFetchBranch() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @group GithubIntegration |
||
| 49 | * @group Live |
||
| 50 | */ |
||
| 51 | public function testFetchAllBranches() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @group GithubIntegration |
||
| 58 | * @group Live |
||
| 59 | */ |
||
| 60 | public function testFetchAllBranchNames() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @group GithubIntegration |
||
| 67 | * @group Live |
||
| 68 | */ |
||
| 69 | public function testFetchAllTagNames() |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @group GithubIntegration |
||
| 76 | * @group Live |
||
| 77 | */ |
||
| 78 | public function testFetchCommit() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @group GithubIntegration |
||
| 87 | * @group Live |
||
| 88 | * @group wip |
||
| 89 | */ |
||
| 90 | public function testFetchCommitStatuses() |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @group GithubIntegration |
||
| 97 | * @group Live |
||
| 98 | * @group wip |
||
| 99 | */ |
||
| 100 | public function testFetchCommitStatus() |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @group GithubIntegration |
||
| 111 | * @group Live |
||
| 112 | * @group wip |
||
| 113 | */ |
||
| 114 | public function testFetchAllPullRequests() |
||
| 118 | |||
| 119 | /** |
||
| 120 | * @group GithubIntegration |
||
| 121 | * @group Live |
||
| 122 | */ |
||
| 123 | public function testFetchAllMilestones() |
||
| 127 | |||
| 128 | /** |
||
| 129 | * @group GithubIntegration |
||
| 130 | * @group Live |
||
| 131 | */ |
||
| 132 | public function testFetchAllIssues() |
||
| 136 | |||
| 137 | /** |
||
| 138 | * @group GithubIntegration |
||
| 139 | * @group Live |
||
| 140 | */ |
||
| 141 | public function testFetchAllIssuesAndPullRequests() |
||
| 145 | |||
| 146 | /** |
||
| 147 | * @return \Github\Client |
||
| 148 | */ |
||
| 149 | private function getTokenAuthenticatedApiClient() |
||
| 155 | |||
| 156 | /** |
||
| 157 | * @return \DevBoardLib\GithubCore\Repo\GithubRepo |
||
| 158 | */ |
||
| 159 | View Code Duplication | private function provideTestRepo() |
|
| 168 | |||
| 169 | /** |
||
| 170 | * @return \DevBoardLib\GithubApiFacade\Auth\GithubAccessToken |
||
| 171 | */ |
||
| 172 | private function provideTestUser() |
||
| 179 | } |
||
| 180 |
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.