Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
44 | public static function getService(OutputInterface $output) |
||
45 | { |
||
46 | $configuration = new DotEnvConfiguration(); |
||
47 | $pushService = $configuration->getPushService(); |
||
48 | switch ($pushService) { |
||
49 | case 'jira': |
||
50 | $passwordRetrievalStrategy = new MacOsPasswordRetrievalStrategy($output, $configuration); |
||
51 | $pushService = new Jira($passwordRetrievalStrategy); |
||
52 | break; |
||
53 | |||
54 | default: |
||
55 | throw new \Exception(sprintf('Cannot create push service instance for "%s" configuration value', $pushService)); |
||
56 | break; |
||
|
|||
57 | } |
||
58 | |||
59 | return $pushService; |
||
60 | } |
||
61 | } |
||
62 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.