Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 5 |
Ratio | 41.67 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
35 | 6 | public function getListFromBoard(String $listName, Board $board) |
|
36 | { |
||
37 | 6 | $lists = $this->client->api('board')->lists()->all($board->getId()); |
|
38 | |||
39 | 6 | View Code Duplication | foreach ($lists as $list) { |
|
|||
40 | 6 | if ($list['name'] == $listName) { |
|
41 | 6 | return new Cardlist($this->client, $list['id']); |
|
42 | } |
||
43 | } |
||
44 | |||
45 | 1 | return; |
|
46 | } |
||
47 | |||
76 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.