@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; ?> |
|
2 | +require __DIR__.'/_header.php'; ?> |
|
3 | 3 | <div class="row"> |
4 | 4 | <div class="column"> |
5 | 5 | <div class="bloc bloc-number"> |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | <div class="label"> |
52 | 52 | <a href="junit.html">Assertions in tests</a> |
53 | 53 | </div> |
54 | - <?php if(isset($project['unitTesting'])) { ?> |
|
54 | + <?php if (isset($project['unitTesting'])) { ?> |
|
55 | 55 | <div class="number"> |
56 | 56 | <?php echo $project['unitTesting']['assertions']; ?> |
57 | 57 | </div> |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | <tbody id="contentClassRank" class="clusterize-content"> |
148 | 148 | <?php |
149 | 149 | $classesS = $classes; |
150 | - usort($classesS, static function ($a, $b) { |
|
150 | + usort($classesS, static function($a, $b) { |
|
151 | 151 | return strcmp($b['pageRank'], $a['pageRank']); |
152 | 152 | }); |
153 | 153 | //$classesS = array_slice($classesS, 0, 10); |
154 | 154 | foreach ($classesS as $class) { ?> |
155 | 155 | <tr> |
156 | 156 | <td> |
157 | - <span class="badge" <?php echo gradientStyleFor($classes, 'pageRank', $class['pageRank']);?>);"> |
|
157 | + <span class="badge" <?php echo gradientStyleFor($classes, 'pageRank', $class['pageRank']); ?>);"> |
|
158 | 158 | <?php echo $class['pageRank']; ?> |
159 | 159 | </td> |
160 | 160 | </td> |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | $badgeTitleMI = 'Maintainability Index'; |
167 | 167 | $mi = isset($class['mi']) ? $class['mi'] : ''; |
168 | 168 | ?> |
169 | - <span class="badge" title="<?php echo $badgeTitleMI;?>"><?php echo $mi;?></span> |
|
170 | - <span class="badge" title="<?php echo $badgeTitleMIWOC;?>"><?php echo $mIwoC;?></span> |
|
169 | + <span class="badge" title="<?php echo $badgeTitleMI; ?>"><?php echo $mi; ?></span> |
|
170 | + <span class="badge" title="<?php echo $badgeTitleMIWOC; ?>"><?php echo $mIwoC; ?></span> |
|
171 | 171 | </td> |
172 | 172 | </tr> |
173 | 173 | <?php } ?> |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | </div> |
181 | 181 | |
182 | 182 | <div class="row"> |
183 | - <?php if($this->isHomePage()) {?> |
|
183 | + <?php if ($this->isHomePage()) {?> |
|
184 | 184 | <div class="column"> |
185 | 185 | <div class="bloc bloc-number"> |
186 | 186 | <div class="label"> |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | <?php |
190 | 190 | $packages = isset($project['composer']['packages']) ? $project['composer']['packages'] : []; |
191 | 191 | $packagesInstalled = isset($project['composer']['packages-installed']) ? $project['composer']['packages-installed'] : []; |
192 | - if([] === $packages) { ?> |
|
192 | + if ([] === $packages) { ?> |
|
193 | 193 | <div class="help number-alternate"><div class="help-inner">No composer.json file found</div></div> |
194 | 194 | <?php } else {?> |
195 | 195 | <div class="number"> |
196 | - <?php echo count($packages);?> dependencies |
|
196 | + <?php echo count($packages); ?> dependencies |
|
197 | 197 | </div> |
198 | 198 | <?php } ?> |
199 | 199 | |
@@ -235,9 +235,9 @@ discard block |
||
235 | 235 | } |
236 | 236 | } |
237 | 237 | ?> |
238 | - chartLicenses(<?php echo json_encode(array_values($json));?>); |
|
238 | + chartLicenses(<?php echo json_encode(array_values($json)); ?>); |
|
239 | 239 | } |
240 | 240 | }; |
241 | 241 | </script> |
242 | 242 | |
243 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
243 | +<?php require __DIR__.'/_footer.php'; ?> |
@@ -54,13 +54,13 @@ |
||
54 | 54 | , with PHPMetrics <?php echo getVersion(); ?> (<a href="https://twitter.com/Halleck45">Jean-François Lépine</a>). |
55 | 55 | </div> |
56 | 56 | |
57 | - <?php if([] !== $this->groups) {?> |
|
57 | + <?php if ([] !== $this->groups) {?> |
|
58 | 58 | <div class="content-full group-tabs"> |
59 | 59 | <ul class="tabs"> |
60 | - <li class="<?php if(!$this->currentGroup) { echo 'active'; }?>"><a href="<?php echo $this->assetPath;?>index.html">All</a></li> |
|
61 | - <?php foreach($this->groups as $group) { ?> |
|
60 | + <li class="<?php if (!$this->currentGroup) { echo 'active'; }?>"><a href="<?php echo $this->assetPath; ?>index.html">All</a></li> |
|
61 | + <?php foreach ($this->groups as $group) { ?> |
|
62 | 62 | <li class="<?php if ($group->getName() === $this->currentGroup) { echo 'active'; }?> "> |
63 | - <a href="<?php echo $this->assetPath . $group->getName();?>/index.html"><?php echo $group->getName();?></a> |
|
63 | + <a href="<?php echo $this->assetPath.$group->getName(); ?>/index.html"><?php echo $group->getName(); ?></a> |
|
64 | 64 | </li> |
65 | 65 | <?php } ?> |
66 | 66 | </ul> |
@@ -1,11 +1,11 @@ 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"> |
8 | - <a href="http://www.phpmetrics.org"><img src="<?php echo $this->assetPath;?>images/phpmetrics-maintenability.png" |
|
8 | + <a href="http://www.phpmetrics.org"><img src="<?php echo $this->assetPath; ?>images/phpmetrics-maintenability.png" |
|
9 | 9 | alt="Logo PhpMetrics"/></a> |
10 | 10 | <h1>PhpMetrics</h1> |
11 | 11 | </div> |
@@ -28,7 +28,7 @@ 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 | 34 | <li> |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | Composer |
38 | 38 | </a> |
39 | 39 | </li> |
40 | - <?php if($config->has('junit')) { ?> |
|
40 | + <?php if ($config->has('junit')) { ?> |
|
41 | 41 | <li> |
42 | 42 | <a href="junit.html"> |
43 | 43 | <svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | Package relations |
132 | 132 | </a> |
133 | 133 | </li> |
134 | - <?php if($config->has('git')) { ?> |
|
134 | + <?php if ($config->has('git')) { ?> |
|
135 | 135 | <li> |
136 | 136 | <a href="git.html"> |
137 | 137 | <img src="images/logo-git.png" alt=""> |
@@ -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,13 +138,13 @@ 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 | // consolidated by groups |
146 | 146 | foreach ($consolidatedGroups as $name => $consolidated) { |
147 | - $outDir = $logDir . DIRECTORY_SEPARATOR . $name; |
|
147 | + $outDir = $logDir.DIRECTORY_SEPARATOR.$name; |
|
148 | 148 | $this->currentGroup = $name; |
149 | 149 | $this->assetPath = '../'; |
150 | 150 | |
@@ -152,23 +152,23 @@ discard block |
||
152 | 152 | mkdir($outDir, 0755, true); |
153 | 153 | } |
154 | 154 | |
155 | - $this->renderPage($this->templateDir . '/html_report/index.php', $outDir . '/index.html', $consolidated, $history); |
|
156 | - $this->renderPage($this->templateDir . '/html_report/loc.php', $outDir . '/loc.html', $consolidated, $history); |
|
157 | - $this->renderPage($this->templateDir . '/html_report/relations.php', $outDir . '/relations.html', $consolidated, $history); |
|
158 | - $this->renderPage($this->templateDir . '/html_report/coupling.php', $outDir . '/coupling.html', $consolidated, $history); |
|
159 | - $this->renderPage($this->templateDir . '/html_report/all.php', $outDir . '/all.html', $consolidated, $history); |
|
160 | - $this->renderPage($this->templateDir . '/html_report/oop.php', $outDir . '/oop.html', $consolidated, $history); |
|
161 | - $this->renderPage($this->templateDir . '/html_report/complexity.php', $outDir . '/complexity.html', $consolidated, $history); |
|
162 | - $this->renderPage($this->templateDir . '/html_report/panel.php', $outDir . '/panel.html', $consolidated, $history); |
|
163 | - $this->renderPage($this->templateDir . '/html_report/violations.php', $outDir . '/violations.html', $consolidated, $history); |
|
164 | - $this->renderPage($this->templateDir . '/html_report/packages.php', $outDir . '/packages.html', $consolidated, $history); |
|
165 | - $this->renderPage($this->templateDir . '/html_report/package_relations.php', $outDir . '/package_relations.html', $consolidated, $history); |
|
166 | - $this->renderPage($this->templateDir . '/html_report/composer.php', $outDir . '/composer.html', $consolidated, $history); |
|
155 | + $this->renderPage($this->templateDir.'/html_report/index.php', $outDir.'/index.html', $consolidated, $history); |
|
156 | + $this->renderPage($this->templateDir.'/html_report/loc.php', $outDir.'/loc.html', $consolidated, $history); |
|
157 | + $this->renderPage($this->templateDir.'/html_report/relations.php', $outDir.'/relations.html', $consolidated, $history); |
|
158 | + $this->renderPage($this->templateDir.'/html_report/coupling.php', $outDir.'/coupling.html', $consolidated, $history); |
|
159 | + $this->renderPage($this->templateDir.'/html_report/all.php', $outDir.'/all.html', $consolidated, $history); |
|
160 | + $this->renderPage($this->templateDir.'/html_report/oop.php', $outDir.'/oop.html', $consolidated, $history); |
|
161 | + $this->renderPage($this->templateDir.'/html_report/complexity.php', $outDir.'/complexity.html', $consolidated, $history); |
|
162 | + $this->renderPage($this->templateDir.'/html_report/panel.php', $outDir.'/panel.html', $consolidated, $history); |
|
163 | + $this->renderPage($this->templateDir.'/html_report/violations.php', $outDir.'/violations.html', $consolidated, $history); |
|
164 | + $this->renderPage($this->templateDir.'/html_report/packages.php', $outDir.'/packages.html', $consolidated, $history); |
|
165 | + $this->renderPage($this->templateDir.'/html_report/package_relations.php', $outDir.'/package_relations.html', $consolidated, $history); |
|
166 | + $this->renderPage($this->templateDir.'/html_report/composer.php', $outDir.'/composer.html', $consolidated, $history); |
|
167 | 167 | |
168 | 168 | // json data |
169 | 169 | file_put_contents( |
170 | - $outDir . '/classes.js', |
|
171 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
170 | + $outDir.'/classes.js', |
|
171 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
172 | 172 | ); |
173 | 173 | } |
174 | 174 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | $diff = $newValue - $oldValue; |
238 | 238 | if ($diff > 0) { |
239 | - $diff = '+' . $diff; |
|
239 | + $diff = '+'.$diff; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | $goodOrBad = 'neutral'; |