Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 15 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
24 | View Code Duplication | public static function parseMux(SubscriptionStatus $subscriptionStatus, array $availableMuxes) |
|
|
|||
25 | { |
||
26 | $service = $subscriptionStatus->service; |
||
27 | |||
28 | // Check if the service string contains /$mux/ |
||
29 | foreach ($availableMuxes as $mux) |
||
30 | { |
||
31 | if (strpos($service, '/' . $mux->name . '/') !== false) |
||
32 | { |
||
33 | return $mux->name; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return null; |
||
38 | } |
||
39 | |||
63 |
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.