@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * @param $status |
|
133 | + * @param integer $status |
|
134 | 134 | */ |
135 | 135 | protected function terminate($status) |
136 | 136 | { |
@@ -139,6 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | /** |
141 | 141 | * @param $log |
142 | + * @param string $logfile |
|
142 | 143 | * @return $this |
143 | 144 | */ |
144 | 145 | protected function log($logfile, $log) |
@@ -152,7 +153,7 @@ discard block |
||
152 | 153 | } |
153 | 154 | |
154 | 155 | /** |
155 | - * @param $debugKey |
|
156 | + * @param string $debugKey |
|
156 | 157 | * @param $value |
157 | 158 | * @return $this |
158 | 159 | */ |
@@ -163,7 +164,7 @@ discard block |
||
163 | 164 | } |
164 | 165 | |
165 | 166 | /** |
166 | - * @param $debugKey |
|
167 | + * @param string $debugKey |
|
167 | 168 | * @return $this |
168 | 169 | */ |
169 | 170 | public function clear($debugKey) |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * @param $key |
|
52 | + * @param string $key |
|
53 | 53 | * @return null |
54 | 54 | */ |
55 | 55 | public function get($key) |
@@ -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; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $class->set('methods', $methods); |
85 | - $class->set('nbMethodsIncludingGettersSetters', sizeof($methods) ); |
|
85 | + $class->set('nbMethodsIncludingGettersSetters', sizeof($methods)); |
|
86 | 86 | $class->set('nbMethods', sizeof($methods) - ($nbGetters + $nbSetters)); |
87 | 87 | $class->set('nbMethodsPrivate', $methodsPrivate); |
88 | 88 | $class->set('nbMethodsPublic', $methodsPublic); |
@@ -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 childs, 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) { |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Hal\Metric\FunctionMetric; |
5 | 5 | use Hal\Metric\Metrics; |
6 | -use Hoa\Ruler\Model\Bag\Scalar; |
|
7 | 6 | use PhpParser\Node; |
8 | 7 | use PhpParser\Node\Stmt; |
9 | 8 | use PhpParser\NodeVisitorAbstract; |
@@ -109,8 +109,8 @@ |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | - * @param $source |
|
113 | - * @param $destination |
|
112 | + * @param string $source |
|
113 | + * @param string $destination |
|
114 | 114 | * @return $this |
115 | 115 | */ |
116 | 116 | public function renderPage($source, $destination, Consolidated $consolidated, $history) |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Hal\Application\Config\Config; |
5 | 5 | use Hal\Metric\Consolidated; |
6 | -use Hal\Metric\Consolided; |
|
7 | 6 | use Hal\Metric\Metrics; |
8 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
9 | 8 |
@@ -92,7 +92,7 @@ |
||
92 | 92 | sprintf('%s/js/history-%d.json', $logDir, $next), |
93 | 93 | json_encode($today, JSON_PRETTY_PRINT) |
94 | 94 | ); |
95 | - file_put_contents( |
|
95 | + file_put_contents( |
|
96 | 96 | sprintf('%s/js/latest.json', $logDir, $next), |
97 | 97 | json_encode($today, JSON_PRETTY_PRINT) |
98 | 98 | ); |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $consolidated = new Consolidated($metrics); |
45 | 45 | |
46 | 46 | // history of builds |
47 | - $today = (object)[ |
|
47 | + $today = (object) [ |
|
48 | 48 | 'avg' => $consolidated->getAvg(), |
49 | 49 | 'sum' => $consolidated->getSum() |
50 | 50 | ]; |
51 | - $files = glob($logDir . '/js/history-*.json'); |
|
51 | + $files = glob($logDir.'/js/history-*.json'); |
|
52 | 52 | $next = sizeof($files) + 1; |
53 | 53 | $history = []; |
54 | 54 | natsort($files); |
@@ -57,34 +57,34 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // copy sources |
60 | - if(!file_exists($logDir . '/js')) { |
|
60 | + if (!file_exists($logDir.'/js')) { |
|
61 | 61 | mkdir($logDir.'/js', 0755, true); |
62 | 62 | } |
63 | - if(!file_exists($logDir . '/css')) { |
|
63 | + if (!file_exists($logDir.'/css')) { |
|
64 | 64 | mkdir($logDir.'/css', 0755, true); |
65 | 65 | } |
66 | - if(!file_exists($logDir . '/images')) { |
|
66 | + if (!file_exists($logDir.'/images')) { |
|
67 | 67 | mkdir($logDir.'/images', 0755, true); |
68 | 68 | } |
69 | - recurse_copy(__DIR__ . '/template/js', $logDir . '/js'); |
|
70 | - recurse_copy(__DIR__ . '/template/css', $logDir . '/css'); |
|
71 | - recurse_copy(__DIR__ . '/template/images', $logDir . '/images'); |
|
69 | + recurse_copy(__DIR__.'/template/js', $logDir.'/js'); |
|
70 | + recurse_copy(__DIR__.'/template/css', $logDir.'/css'); |
|
71 | + recurse_copy(__DIR__.'/template/images', $logDir.'/images'); |
|
72 | 72 | |
73 | 73 | // render dynamic pages |
74 | - $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history); |
|
75 | - $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
76 | - $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
77 | - $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
78 | - $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history); |
|
79 | - $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
80 | - $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
81 | - $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
82 | - $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
74 | + $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history); |
|
75 | + $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
76 | + $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
77 | + $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
78 | + $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history); |
|
79 | + $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
80 | + $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
81 | + $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
82 | + $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
83 | 83 | if ($this->config->has('git')) { |
84 | - $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history); |
|
84 | + $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history); |
|
85 | 85 | } |
86 | 86 | if ($this->config->has('junit')) { |
87 | - $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
87 | + $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | // js data |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | |
100 | 100 | // json data |
101 | 101 | file_put_contents( |
102 | - $logDir . '/js/classes.js', |
|
103 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
102 | + $logDir.'/js/classes.js', |
|
103 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir), |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | $diff = $newValue - $oldValue; |
171 | 171 | if ($diff > 0) { |
172 | - $diff = '+' . $diff; |
|
172 | + $diff = '+'.$diff; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | $goodOrBad = 'neutral'; |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace Hal\Report\Violations\Xml; |
3 | 3 | |
4 | 4 | use Hal\Application\Config\Config; |
5 | -use Hal\Metric\Consolided; |
|
6 | 5 | use Hal\Metric\Metrics; |
7 | 6 | use Hal\Violation\Violation; |
8 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | if ($node instanceof \PhpParser\Node\Name\FullyQualified) { |
93 | - return (string)$node; |
|
93 | + return (string) $node; |
|
94 | 94 | } |
95 | 95 | if ($node instanceof \PhpParser\Node\Expr\New_) { |
96 | 96 | return getNameOfNode($node->class); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($node instanceof \PhpParser\Node\Name) { |
104 | - return (string)implode($node->parts); |
|
104 | + return (string) implode($node->parts); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if (isset($node->name) && $node->name instanceof \PhpParser\Node\Expr\Variable) { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | if (isset($node->name)) { |
132 | - return (string)$node->name; |
|
132 | + return (string) $node->name; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return null; |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | } |
148 | 148 | while (false !== ($file = readdir($dir))) { |
149 | 149 | if (($file != '.') && ($file != '..')) { |
150 | - if (is_dir($src . '/' . $file)) { |
|
151 | - recurse_copy($src . '/' . $file, $dst . '/' . $file); |
|
150 | + if (is_dir($src.'/'.$file)) { |
|
151 | + recurse_copy($src.'/'.$file, $dst.'/'.$file); |
|
152 | 152 | } else { |
153 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
153 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $string = ''; |
46 | 46 | foreach ($this->data as $violation) { |
47 | - $string .= $violation->getName() . ','; |
|
47 | + $string .= $violation->getName().','; |
|
48 | 48 | } |
49 | 49 | return $string; |
50 | 50 | } |