Code Duplication    Length = 8-10 lines in 2 locations

src/Hal/Metric/Class_/Coupling/ExternalsVisitor.php 1 location

@@ 100-109 (lines=10) @@
97
98
                    // instanciations, static calls
99
                    \iterate_over_node($stmt, function ($node) use (&$dependencies) {
100
                        switch (true) {
101
                            case $node instanceof Node\Expr\New_:
102
                                // new MyClass
103
                                array_push($dependencies, getNameOfNode($node));
104
                                break;
105
                            case $node instanceof Node\Expr\StaticCall:
106
                                // MyClass::Call
107
                                array_push($dependencies, getNameOfNode($node));
108
                                break;
109
                        }
110
                    });
111
112
                    // annotations

src/Hal/Metric/Class_/Structural/SystemComplexityVisitor.php 1 location

@@ 56-63 (lines=8) @@
53
                    $fanout = [];
54
55
                    iterate_over_node($node, function ($node) use (&$output, &$fanout) {
56
                        switch (true) {
57
                            case $node instanceof Stmt\Return_:
58
                                $output++;
59
                                break;
60
                            case $node instanceof Node\Expr\StaticCall:
61
                            case $node instanceof Node\Expr\MethodCall:
62
                                array_push($fanout, getNameOfNode($node));
63
                        }
64
                    });
65
66
                    $fanout = sizeof(array_unique($fanout));