We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 8 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public static function getDefault(SmartCollectionInterface $attributes) |
||
11 | { |
||
12 | switch ($attributes->getAttributeValue('relation_type')) { |
||
13 | case 'BelongsToMany': |
||
14 | case 'HasMany': |
||
15 | case 'HasManyThrough': |
||
16 | case 'HasOneOrMany': |
||
17 | case 'MorphMany': |
||
18 | case 'MorphOneOrMany': |
||
19 | case 'MorphToMany': |
||
20 | return true; |
||
21 | default: |
||
22 | return false; |
||
23 | } |
||
24 | |||
25 | return false; |
||
|
|||
26 | } |
||
38 |
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.