@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $this->config = $config; |
| 55 | 55 | $this->output = $output; |
| 56 | - $this->templateDir = __DIR__ . '/../../../../templates'; |
|
| 56 | + $this->templateDir = __DIR__.'/../../../../templates'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | $consolidated = new Consolidated($metrics); |
| 79 | 79 | |
| 80 | 80 | // history of builds |
| 81 | - $today = (object)[ |
|
| 81 | + $today = (object) [ |
|
| 82 | 82 | 'avg' => $consolidated->getAvg(), |
| 83 | 83 | 'sum' => $consolidated->getSum() |
| 84 | 84 | ]; |
| 85 | - $files = glob($logDir . '/js/history-*.json'); |
|
| 85 | + $files = glob($logDir.'/js/history-*.json'); |
|
| 86 | 86 | $next = count($files) + 1; |
| 87 | 87 | $history = []; |
| 88 | 88 | natsort($files); |
@@ -91,40 +91,40 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // copy sources |
| 94 | - if (!file_exists($logDir . '/js')) { |
|
| 95 | - mkdir($logDir . '/js', 0755, true); |
|
| 94 | + if (!file_exists($logDir.'/js')) { |
|
| 95 | + mkdir($logDir.'/js', 0755, true); |
|
| 96 | 96 | } |
| 97 | - if (!file_exists($logDir . '/css')) { |
|
| 98 | - mkdir($logDir . '/css', 0755, true); |
|
| 97 | + if (!file_exists($logDir.'/css')) { |
|
| 98 | + mkdir($logDir.'/css', 0755, true); |
|
| 99 | 99 | } |
| 100 | - if (!file_exists($logDir . '/images')) { |
|
| 101 | - mkdir($logDir . '/images', 0755, true); |
|
| 100 | + if (!file_exists($logDir.'/images')) { |
|
| 101 | + mkdir($logDir.'/images', 0755, true); |
|
| 102 | 102 | } |
| 103 | - if (!file_exists($logDir . '/fonts')) { |
|
| 104 | - mkdir($logDir . '/fonts', 0755, true); |
|
| 103 | + if (!file_exists($logDir.'/fonts')) { |
|
| 104 | + mkdir($logDir.'/fonts', 0755, true); |
|
| 105 | 105 | } |
| 106 | - recurse_copy($this->templateDir . '/html_report/js', $logDir . '/js'); |
|
| 107 | - recurse_copy($this->templateDir . '/html_report/css', $logDir . '/css'); |
|
| 108 | - recurse_copy($this->templateDir . '/html_report/images', $logDir . '/images'); |
|
| 109 | - recurse_copy($this->templateDir . '/html_report/fonts', $logDir . '/fonts'); |
|
| 106 | + recurse_copy($this->templateDir.'/html_report/js', $logDir.'/js'); |
|
| 107 | + recurse_copy($this->templateDir.'/html_report/css', $logDir.'/css'); |
|
| 108 | + recurse_copy($this->templateDir.'/html_report/images', $logDir.'/images'); |
|
| 109 | + recurse_copy($this->templateDir.'/html_report/fonts', $logDir.'/fonts'); |
|
| 110 | 110 | |
| 111 | 111 | // render dynamic pages |
| 112 | - $this->renderPage($this->templateDir . '/html_report/index.php', $logDir . '/index.html', $consolidated, $history); |
|
| 113 | - $this->renderPage($this->templateDir . '/html_report/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
| 114 | - $this->renderPage($this->templateDir . '/html_report/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
| 115 | - $this->renderPage($this->templateDir . '/html_report/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
| 116 | - $this->renderPage($this->templateDir . '/html_report/all.php', $logDir . '/all.html', $consolidated, $history); |
|
| 117 | - $this->renderPage($this->templateDir . '/html_report/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
| 118 | - $this->renderPage($this->templateDir . '/html_report/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
| 119 | - $this->renderPage($this->templateDir . '/html_report/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
| 120 | - $this->renderPage($this->templateDir . '/html_report/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
| 121 | - $this->renderPage($this->templateDir . '/html_report/packages.php', $logDir . '/packages.html', $consolidated, $history); |
|
| 122 | - $this->renderPage($this->templateDir . '/html_report/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history); |
|
| 123 | - $this->renderPage($this->templateDir . '/html_report/composer.php', $logDir . '/composer.html', $consolidated, $history); |
|
| 112 | + $this->renderPage($this->templateDir.'/html_report/index.php', $logDir.'/index.html', $consolidated, $history); |
|
| 113 | + $this->renderPage($this->templateDir.'/html_report/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
| 114 | + $this->renderPage($this->templateDir.'/html_report/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
| 115 | + $this->renderPage($this->templateDir.'/html_report/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
| 116 | + $this->renderPage($this->templateDir.'/html_report/all.php', $logDir.'/all.html', $consolidated, $history); |
|
| 117 | + $this->renderPage($this->templateDir.'/html_report/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
| 118 | + $this->renderPage($this->templateDir.'/html_report/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
| 119 | + $this->renderPage($this->templateDir.'/html_report/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
| 120 | + $this->renderPage($this->templateDir.'/html_report/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
| 121 | + $this->renderPage($this->templateDir.'/html_report/packages.php', $logDir.'/packages.html', $consolidated, $history); |
|
| 122 | + $this->renderPage($this->templateDir.'/html_report/package_relations.php', $logDir.'/package_relations.html', $consolidated, $history); |
|
| 123 | + $this->renderPage($this->templateDir.'/html_report/composer.php', $logDir.'/composer.html', $consolidated, $history); |
|
| 124 | 124 | if ($this->config->has('git')) { |
| 125 | - $this->renderPage($this->templateDir . '/html_report/git.php', $logDir . '/git.html', $consolidated, $consolidatedGroups, $history); |
|
| 125 | + $this->renderPage($this->templateDir.'/html_report/git.php', $logDir.'/git.html', $consolidated, $consolidatedGroups, $history); |
|
| 126 | 126 | } |
| 127 | - $this->renderPage($this->templateDir . '/html_report/junit.php', $logDir . '/junit.html', $consolidated, $consolidatedGroups, $history); |
|
| 127 | + $this->renderPage($this->templateDir.'/html_report/junit.php', $logDir.'/junit.html', $consolidated, $consolidatedGroups, $history); |
|
| 128 | 128 | |
| 129 | 129 | // js data |
| 130 | 130 | file_put_contents( |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | // json data |
| 140 | 140 | file_put_contents( |
| 141 | - $logDir . '/classes.js', |
|
| 142 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
| 141 | + $logDir.'/classes.js', |
|
| 142 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
| 143 | 143 | ); |
| 144 | 144 | |
| 145 | 145 | // HTML files to generate |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | // consolidated by groups |
| 162 | 162 | foreach ($consolidatedGroups as $name => $consolidated) { |
| 163 | - $outDir = $logDir . DIRECTORY_SEPARATOR . $name; |
|
| 163 | + $outDir = $logDir.DIRECTORY_SEPARATOR.$name; |
|
| 164 | 164 | $this->currentGroup = $name; |
| 165 | 165 | $this->assetPath = '../'; |
| 166 | 166 | |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | ); |
| 178 | 178 | |
| 179 | 179 | file_put_contents( |
| 180 | - $outDir . '/classes.js', |
|
| 181 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
| 180 | + $outDir.'/classes.js', |
|
| 181 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
| 182 | 182 | ); |
| 183 | 183 | } |
| 184 | 184 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | $diff = $newValue - $oldValue; |
| 253 | 253 | if ($diff > 0) { |
| 254 | - $diff = '+' . $diff; |
|
| 254 | + $diff = '+'.$diff; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | $goodOrBad = 'neutral'; |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // sums |
| 69 | - $sum = (object)[ |
|
| 69 | + $sum = (object) [ |
|
| 70 | 70 | 'loc' => 0, |
| 71 | 71 | 'cloc' => 0, |
| 72 | 72 | 'lloc' => 0, |
| 73 | 73 | 'nbMethods' => 0, |
| 74 | 74 | ]; |
| 75 | - $avg = (object)[ |
|
| 75 | + $avg = (object) [ |
|
| 76 | 76 | 'wmc' => [], |
| 77 | 77 | 'ccn' => [], |
| 78 | 78 | 'bugs' => [], |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | foreach ($avg as &$a) { |
| 109 | 109 | if (count($a) > 0) { |
| 110 | - $a = round(array_sum((array)$a) / count($a), 2); |
|
| 110 | + $a = round(array_sum((array) $a) / count($a), 2); |
|
| 111 | 111 | } else { |
| 112 | 112 | $a = 0; |
| 113 | 113 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $violations[$name]++; |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | - $sum->violations = (object)$violations; |
|
| 169 | + $sum->violations = (object) $violations; |
|
| 170 | 170 | |
| 171 | 171 | $this->avg = $avg; |
| 172 | 172 | $this->sum = $sum; |