@@ -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> |
@@ -97,7 +97,7 @@ |
||
97 | 97 | if (DIRECTORY_SEPARATOR === '\\') { |
98 | 98 | return |
99 | 99 | 0 >= version_compare('10.0.10586', |
100 | - PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD) |
|
100 | + PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD) |
|
101 | 101 | || false !== getenv('ANSICON') |
102 | 102 | || 'ON' === getenv('ConEmuANSI') |
103 | 103 | || 'xterm' === getenv('TERM'); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function writeln($message) |
25 | 25 | { |
26 | - $this->write(PHP_EOL . $message); |
|
26 | + $this->write(PHP_EOL.$message); |
|
27 | 27 | return $this; |
28 | 28 | } |
29 | 29 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function writeln($message) |
27 | 27 | { |
28 | - $this->write(PHP_EOL . $message); |
|
28 | + $this->write(PHP_EOL.$message); |
|
29 | 29 | return $this; |
30 | 30 | } |
31 | 31 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function write($message) |
36 | 36 | { |
37 | - $this->quietMode||file_put_contents('php://stdout', $message); |
|
37 | + $this->quietMode || file_put_contents('php://stdout', $message); |
|
38 | 38 | return $this; |
39 | 39 | } |
40 | 40 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $output = new CliOutput(); |
24 | 24 | |
25 | 25 | // issues and debug |
26 | - $issuer = (new Issuer($output));//->enable(); |
|
26 | + $issuer = (new Issuer($output)); //->enable(); |
|
27 | 27 | |
28 | 28 | // config |
29 | 29 | $config = (new Parser())->parse($argv); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // analyze |
58 | 58 | try { |
59 | 59 | $metrics = (new Analyze($config, $output, $issuer))->run($files); |
60 | - }catch(ConfigException $e) { |
|
60 | + } catch (ConfigException $e) { |
|
61 | 61 | $output->writeln(sprintf('<error>%s</error>', $e->getMessage())); |
62 | 62 | exit(1); |
63 | 63 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | // JUNIT format |
74 | 74 | foreach ($xpath->query('//testsuite[@file]') as $suite) { |
75 | - array_push($testsuites, (object)[ |
|
75 | + array_push($testsuites, (object) [ |
|
76 | 76 | 'file' => $suite->getAttribute('file'), |
77 | 77 | 'name' => $suite->getAttribute('name'), |
78 | 78 | 'assertions' => $suite->getAttribute('assertions'), |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $assertions = $case === $suite->firstChild->nextSibling ? $suite->getAttribute('assertions') : 0; |
102 | 102 | } |
103 | 103 | |
104 | - $testsuites[$case->getAttribute('class')] = (object)[ |
|
104 | + $testsuites[$case->getAttribute('class')] = (object) [ |
|
105 | 105 | 'file' => $case->getAttribute('file'), |
106 | 106 | 'name' => $case->getAttribute('class'), |
107 | 107 | 'assertions' => $assertions, |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $traverser->addVisitor(new ExternalsVisitor($metricsOfUnitTest)); |
121 | 121 | |
122 | 122 | if (!file_exists($suite->file) || !is_readable($suite->file)) { |
123 | - throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file); |
|
123 | + throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | $code = file_get_contents($suite->file); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | |
134 | 134 | // list of externals sources of unit test |
135 | 135 | $metric = $metricsOfUnitTest->get($suite->name); |
136 | - $externals = (array)$metric->get('externals'); |
|
136 | + $externals = (array) $metric->get('externals'); |
|
137 | 137 | |
138 | 138 | // global stats for each test |
139 | - $infoAboutTests[$suite->name] = (object)[ |
|
139 | + $infoAboutTests[$suite->name] = (object) [ |
|
140 | 140 | 'nbExternals' => sizeof(array_unique($externals)), |
141 | 141 | 'externals' => array_unique($externals), |
142 | 142 | 'filename' => $suite->file, |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; ?> |
|
2 | +require __DIR__.'/_header.php'; ?> |
|
3 | 3 | |
4 | 4 | <?php |
5 | 5 | if (!isset($project['unitTesting'])) { |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | $unit = $project['unitTesting']; |
11 | -$getMetricForClass = function ($classname, $metric) use ($classes) { |
|
11 | +$getMetricForClass = function($classname, $metric) use ($classes) { |
|
12 | 12 | foreach ($classes as $class) { |
13 | 13 | if ($classname !== $class['name']) { |
14 | 14 | continue; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | </div> |
137 | 137 | </div> |
138 | 138 | |
139 | - <?php require __DIR__ . '/_footer.php'; ?> |
|
139 | + <?php require __DIR__.'/_footer.php'; ?> |
|
140 | 140 | |
141 | 141 | <script type="text/javascript"> |
142 | 142 | var clusterize = new Clusterize({ |
@@ -191,12 +191,12 @@ discard block |
||
191 | 191 | foreach ($unit['tests'] as $test) { |
192 | 192 | array_push($unitTimeJson->children, [ |
193 | 193 | 'name' => $test->classname, |
194 | - 'time' => (float)$test->time, |
|
194 | + 'time' => (float) $test->time, |
|
195 | 195 | ]); |
196 | 196 | } |
197 | 197 | ?> |
198 | 198 | |
199 | - var json = <?php echo json_encode($unitTimeJson);?>; |
|
199 | + var json = <?php echo json_encode($unitTimeJson); ?>; |
|
200 | 200 | root = json; |
201 | 201 | var nodes = treemap.nodes(json) |
202 | 202 | .filter(function (d) { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | </div> |
2 | 2 | |
3 | 3 | <!-- Sidebar --> |
4 | -<?php if(!isset($fullwidth) || $fullwidth === false) {?> |
|
4 | +<?php if (!isset($fullwidth) || $fullwidth === false) {?> |
|
5 | 5 | <div id="sidebar"> |
6 | 6 | <div class="content"> |
7 | 7 | <div class="logo"> |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | <path d="M0 0h24v24H0z" fill="none"/> |
29 | 29 | <path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/> |
30 | 30 | </svg> |
31 | - Violations (<?php echo $sum->violations->total;?>) |
|
31 | + Violations (<?php echo $sum->violations->total; ?>) |
|
32 | 32 | </a> |
33 | 33 | </li> |
34 | - <?php if($config->has('junit')) { ?> |
|
34 | + <?php if ($config->has('junit')) { ?> |
|
35 | 35 | <li> |
36 | 36 | <a href="junit.html"> |
37 | 37 | <svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | Coupling |
108 | 108 | </a> |
109 | 109 | </li> |
110 | - <?php if($config->has('git')) { ?> |
|
110 | + <?php if ($config->has('git')) { ?> |
|
111 | 111 | <li> |
112 | 112 | <a href="git.html"> |
113 | 113 | <img src="images/logo-git.png" alt=""> |
@@ -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,33 +57,33 @@ 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 | - $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
86 | + $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
87 | 87 | |
88 | 88 | // js data |
89 | 89 | file_put_contents( |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | // json data |
99 | 99 | file_put_contents( |
100 | - $logDir . '/js/classes.js', |
|
101 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
100 | + $logDir.'/js/classes.js', |
|
101 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
102 | 102 | ); |
103 | 103 | |
104 | 104 | $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir)); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $diff = $newValue - $oldValue; |
168 | 168 | if ($diff > 0) { |
169 | - $diff = '+' . $diff; |
|
169 | + $diff = '+'.$diff; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | $goodOrBad = 'neutral'; |