Completed
Pull Request — master (#448)
by
unknown
08:31
created

halstead3.php ➔ f_switch()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 1
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
1
<?php
2
function f_switch($a){
3
    switch ($a){
4
        case 0 :
5
            printf("zero");
6
        case 10 :
7
            printf("an even number");
8
            break;
9
        default:
10
            printf("I don't know that one");
11
            return -1;
12
            break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
13
    }
14
    return 0;
15
}