@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; ?> |
|
2 | +require __DIR__.'/_header.php'; ?> |
|
3 | 3 | |
4 | 4 | <div class="row"> |
5 | 5 | <div class="column"> |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | <td><span class="path"><?php echo $class['name']; ?></span></td> |
75 | 75 | <?php foreach (['wmc', 'ccn', 'ccnMethodMax', 'relativeSystemComplexity', 'relativeDataComplexity', 'relativeStructuralComplexity', 'bugs', 'kanDefect'] as $attribute) {?> |
76 | 76 | <td> |
77 | - <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>);"> |
|
77 | + <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>);"> |
|
78 | 78 | <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?> |
79 | 79 | </span> |
80 | 80 | </td> |
@@ -90,4 +90,4 @@ discard block |
||
90 | 90 | </div> |
91 | 91 | |
92 | 92 | |
93 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
93 | +<?php require __DIR__.'/_footer.php'; ?> |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | if ($node instanceof \PhpParser\Node\Name\FullyQualified) { |
89 | - return (string)$node; |
|
89 | + return (string) $node; |
|
90 | 90 | } |
91 | 91 | if ($node instanceof \PhpParser\Node\Expr\New_) { |
92 | 92 | return getNameOfNode($node->class); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($node instanceof \PhpParser\Node\Name) { |
100 | - return (string)implode($node->parts); |
|
100 | + return (string) implode($node->parts); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($node->name) && $node->name instanceof \PhpParser\Node\Expr\Variable) { |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | if (isset($node->name) && null === $node->name) { |
128 | - return 'anonymous@' . spl_object_hash($node); |
|
128 | + return 'anonymous@'.spl_object_hash($node); |
|
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 | } |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | { |
176 | 176 | // memory cache |
177 | 177 | static $caches; |
178 | - if(null === $caches) { |
|
178 | + if (null === $caches) { |
|
179 | 179 | $caches = []; |
180 | 180 | } |
181 | 181 | |
182 | - if(!isset($caches[$attribute])) { |
|
182 | + if (!isset($caches[$attribute])) { |
|
183 | 183 | // avoid to iterate over array too many times |
184 | 184 | $max = 0; |
185 | 185 | $min = 1; |
186 | - foreach($array as $item) { |
|
187 | - if(!isset($item[$attribute])) { |
|
186 | + foreach ($array as $item) { |
|
187 | + if (!isset($item[$attribute])) { |
|
188 | 188 | continue; |
189 | 189 | } |
190 | 190 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $this->config = $config; |
33 | 33 | $this->output = $output; |
34 | - $this->templateDir = __DIR__ . '/../../../../templates'; |
|
34 | + $this->templateDir = __DIR__.'/../../../../templates'; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | $consolidated = new Consolidated($metrics); |
47 | 47 | |
48 | 48 | // history of builds |
49 | - $today = (object)[ |
|
49 | + $today = (object) [ |
|
50 | 50 | 'avg' => $consolidated->getAvg(), |
51 | 51 | 'sum' => $consolidated->getSum() |
52 | 52 | ]; |
53 | - $files = glob($logDir . '/js/history-*.json'); |
|
53 | + $files = glob($logDir.'/js/history-*.json'); |
|
54 | 54 | $next = count($files) + 1; |
55 | 55 | $history = []; |
56 | 56 | natsort($files); |
@@ -59,39 +59,39 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | // copy sources |
62 | - if (!file_exists($logDir . '/js')) { |
|
63 | - mkdir($logDir . '/js', 0755, true); |
|
62 | + if (!file_exists($logDir.'/js')) { |
|
63 | + mkdir($logDir.'/js', 0755, true); |
|
64 | 64 | } |
65 | - if (!file_exists($logDir . '/css')) { |
|
66 | - mkdir($logDir . '/css', 0755, true); |
|
65 | + if (!file_exists($logDir.'/css')) { |
|
66 | + mkdir($logDir.'/css', 0755, true); |
|
67 | 67 | } |
68 | - if (!file_exists($logDir . '/images')) { |
|
69 | - mkdir($logDir . '/images', 0755, true); |
|
68 | + if (!file_exists($logDir.'/images')) { |
|
69 | + mkdir($logDir.'/images', 0755, true); |
|
70 | 70 | } |
71 | - if (!file_exists($logDir . '/fonts')) { |
|
72 | - mkdir($logDir . '/fonts', 0755, true); |
|
71 | + if (!file_exists($logDir.'/fonts')) { |
|
72 | + mkdir($logDir.'/fonts', 0755, true); |
|
73 | 73 | } |
74 | - recurse_copy($this->templateDir . '/html_report/js', $logDir . '/js'); |
|
75 | - recurse_copy($this->templateDir . '/html_report/css', $logDir . '/css'); |
|
76 | - recurse_copy($this->templateDir . '/html_report/images', $logDir . '/images'); |
|
77 | - recurse_copy($this->templateDir . '/html_report/fonts', $logDir . '/fonts'); |
|
74 | + recurse_copy($this->templateDir.'/html_report/js', $logDir.'/js'); |
|
75 | + recurse_copy($this->templateDir.'/html_report/css', $logDir.'/css'); |
|
76 | + recurse_copy($this->templateDir.'/html_report/images', $logDir.'/images'); |
|
77 | + recurse_copy($this->templateDir.'/html_report/fonts', $logDir.'/fonts'); |
|
78 | 78 | |
79 | 79 | // render dynamic pages |
80 | - $this->renderPage($this->templateDir . '/html_report/index.php', $logDir . '/index.html', $consolidated, $history); |
|
81 | - $this->renderPage($this->templateDir . '/html_report/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
82 | - $this->renderPage($this->templateDir . '/html_report/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
83 | - $this->renderPage($this->templateDir . '/html_report/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
84 | - $this->renderPage($this->templateDir . '/html_report/all.php', $logDir . '/all.html', $consolidated, $history); |
|
85 | - $this->renderPage($this->templateDir . '/html_report/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
86 | - $this->renderPage($this->templateDir . '/html_report/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
87 | - $this->renderPage($this->templateDir . '/html_report/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
88 | - $this->renderPage($this->templateDir . '/html_report/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
89 | - $this->renderPage($this->templateDir . '/html_report/packages.php', $logDir . '/packages.html', $consolidated, $history); |
|
90 | - $this->renderPage($this->templateDir . '/html_report/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history); |
|
80 | + $this->renderPage($this->templateDir.'/html_report/index.php', $logDir.'/index.html', $consolidated, $history); |
|
81 | + $this->renderPage($this->templateDir.'/html_report/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
82 | + $this->renderPage($this->templateDir.'/html_report/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
83 | + $this->renderPage($this->templateDir.'/html_report/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
84 | + $this->renderPage($this->templateDir.'/html_report/all.php', $logDir.'/all.html', $consolidated, $history); |
|
85 | + $this->renderPage($this->templateDir.'/html_report/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
86 | + $this->renderPage($this->templateDir.'/html_report/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
87 | + $this->renderPage($this->templateDir.'/html_report/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
88 | + $this->renderPage($this->templateDir.'/html_report/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
89 | + $this->renderPage($this->templateDir.'/html_report/packages.php', $logDir.'/packages.html', $consolidated, $history); |
|
90 | + $this->renderPage($this->templateDir.'/html_report/package_relations.php', $logDir.'/package_relations.html', $consolidated, $history); |
|
91 | 91 | if ($this->config->has('git')) { |
92 | - $this->renderPage($this->templateDir . '/html_report/git.php', $logDir . '/git.html', $consolidated, $history); |
|
92 | + $this->renderPage($this->templateDir.'/html_report/git.php', $logDir.'/git.html', $consolidated, $history); |
|
93 | 93 | } |
94 | - $this->renderPage($this->templateDir . '/html_report/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
94 | + $this->renderPage($this->templateDir.'/html_report/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
95 | 95 | |
96 | 96 | // js data |
97 | 97 | file_put_contents( |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | |
106 | 106 | // json data |
107 | 107 | file_put_contents( |
108 | - $logDir . '/js/classes.js', |
|
109 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
108 | + $logDir.'/js/classes.js', |
|
109 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
110 | 110 | ); |
111 | 111 | |
112 | 112 | $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir)); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | $diff = $newValue - $oldValue; |
175 | 175 | if ($diff > 0) { |
176 | - $diff = '+' . $diff; |
|
176 | + $diff = '+'.$diff; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $goodOrBad = 'neutral'; |