@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Hal\Metric\Class_; |
3 | 3 | |
4 | -use Hal\Component\Reflected\Method; |
|
5 | 4 | use Hal\Metric\ClassMetric; |
6 | 5 | use Hal\Metric\FunctionMetric; |
7 | 6 | use Hal\Metric\Helper\RoleOfMethodDetector; |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Hal\Metric\Class_\Complexity; |
3 | 3 | |
4 | -use Hal\Component\Reflected\Method; |
|
5 | 4 | use Hal\Metric\Metrics; |
6 | 5 | use PhpParser\Node; |
7 | 6 | use PhpParser\Node\Stmt; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | if ($stmt instanceof Stmt\ClassMethod) { |
56 | 56 | |
57 | 57 | // iterate over children, recursively |
58 | - $cb = function ($node) use (&$cb) { |
|
58 | + $cb = function($node) use (&$cb) { |
|
59 | 59 | $ccn = 0; |
60 | 60 | if (isset($node->stmts) && $node->stmts) { |
61 | 61 | foreach ($node->stmts as $child) { |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Hal\Metric\Class_\Complexity; |
3 | 3 | |
4 | -use Hal\Component\Reflected\Method; |
|
5 | 4 | use Hal\Metric\Metrics; |
6 | 5 | use PhpParser\Node; |
7 | 6 | use PhpParser\Node\Stmt; |
@@ -60,18 +60,18 @@ discard block |
||
60 | 60 | // extends |
61 | 61 | if (isset($node->extends)) { |
62 | 62 | if (is_array($node->extends)) { |
63 | - foreach ((array)$node->extends as $interface) { |
|
64 | - array_push($dependencies, (string)$interface); |
|
63 | + foreach ((array) $node->extends as $interface) { |
|
64 | + array_push($dependencies, (string) $interface); |
|
65 | 65 | } |
66 | 66 | } else { |
67 | - array_push($dependencies, (string)$node->extends); |
|
67 | + array_push($dependencies, (string) $node->extends); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | 71 | // implements |
72 | 72 | if (isset($node->implements)) { |
73 | 73 | foreach ($node->implements as $interface) { |
74 | - array_push($dependencies, (string)$interface); |
|
74 | + array_push($dependencies, (string) $interface); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // return |
81 | 81 | if (isset($stmt->returnType)) { |
82 | 82 | if ($stmt->returnType instanceof Node\Name\FullyQualified) { |
83 | - array_push($dependencies, (string)$stmt->returnType); |
|
83 | + array_push($dependencies, (string) $stmt->returnType); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | foreach ($stmt->params as $param) { |
89 | 89 | if ($param->type) { |
90 | 90 | if ($param->type instanceof Node\Name\FullyQualified) { |
91 | - array_push($dependencies, (string)$param->type); |
|
91 | + array_push($dependencies, (string) $param->type); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | 96 | // instantiations, static calls |
97 | - \iterate_over_node($stmt, function ($node) use (&$dependencies) { |
|
97 | + \iterate_over_node($stmt, function($node) use (&$dependencies) { |
|
98 | 98 | switch (true) { |
99 | 99 | case $node instanceof Node\Expr\New_: |
100 | 100 | // new MyClass |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | foreach ($matches[1] as $check) { |
114 | 114 | foreach ($this->uses as $use) { |
115 | 115 | if ($use->alias === $check) { |
116 | - array_push($dependencies, (string)($use->name)); |
|
116 | + array_push($dependencies, (string) ($use->name)); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php require __DIR__ . '/_header.php'; ?> |
|
1 | +<?php require __DIR__.'/_header.php'; ?> |
|
2 | 2 | <div class="row"> |
3 | 3 | <div class="column"> |
4 | 4 | <div class="bloc bloc-number"> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | <tbody> |
62 | 62 | <?php |
63 | 63 | $classesS = $classes; |
64 | - usort($classesS, function ($a, $b) { |
|
64 | + usort($classesS, function($a, $b) { |
|
65 | 65 | return strcmp($b['pageRank'], $a['pageRank']); |
66 | 66 | }); |
67 | 67 | $classesS = array_slice($classesS, 0, 10); |
@@ -90,4 +90,4 @@ discard block |
||
90 | 90 | }; |
91 | 91 | </script> |
92 | 92 | |
93 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
93 | +<?php require __DIR__.'/_footer.php'; ?> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php require __DIR__ . '/_header.php'; ?> |
|
1 | +<?php require __DIR__.'/_header.php'; ?> |
|
2 | 2 | |
3 | 3 | |
4 | 4 | <?php |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | |
20 | 20 | // 2. percentile map |
21 | 21 | $json = []; |
22 | -if(sizeof($array) > 1) { |
|
22 | +if (sizeof($array) > 1) { |
|
23 | 23 | $range = range(0.5, 1, .05); |
24 | 24 | foreach ($range as $percentile) { |
25 | - $json[] = (object)[ |
|
25 | + $json[] = (object) [ |
|
26 | 26 | 'lloc' => procentile($array, $percentile), |
27 | 27 | 'percentile' => $percentile * 100, |
28 | 28 | ]; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | </div> |
75 | 75 | |
76 | 76 | |
77 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
77 | +<?php require __DIR__.'/_footer.php'; ?> |
|
78 | 78 | |
79 | 79 | |
80 | 80 | <script> |