@@ -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 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | // exclude extensions |
55 | - $packages = array_filter($packages, function ($package) { |
|
55 | + $packages = array_filter($packages, function($package) { |
|
56 | 56 | return !preg_match('!(^php$|^ext\-)!', $package->name); |
57 | 57 | }); |
58 | 58 | |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | if (!\preg_match('/composer(-dist)?\.json/', $filename)) { |
77 | 77 | continue; |
78 | 78 | } |
79 | - $composerJson = (object)\json_decode(\file_get_contents($filename)); |
|
79 | + $composerJson = (object) \json_decode(\file_get_contents($filename)); |
|
80 | 80 | |
81 | 81 | if (!isset($composerJson->require)) { |
82 | 82 | continue; |
83 | 83 | } |
84 | 84 | |
85 | - $rawRequirements[] = (array)$composerJson->require; |
|
85 | + $rawRequirements[] = (array) $composerJson->require; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return \call_user_func_array('array_merge', $rawRequirements); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | if (false === \strpos($filename, 'composer.lock')) { |
107 | 107 | continue; |
108 | 108 | } |
109 | - $composerLockJson = (object)\json_decode(\file_get_contents($filename)); |
|
109 | + $composerLockJson = (object) \json_decode(\file_get_contents($filename)); |
|
110 | 110 | |
111 | 111 | if (!isset($composerLockJson->packages)) { |
112 | 112 | continue; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; |
|
2 | +require __DIR__.'/_header.php'; |
|
3 | 3 | |
4 | 4 | $packages = isset($project['composer']['packages']) ? $project['composer']['packages'] : []; |
5 | -usort($packages, function ($a, $b) { |
|
5 | +usort($packages, function($a, $b) { |
|
6 | 6 | return strcmp($a->name, $b->name); |
7 | 7 | }); |
8 | 8 | if ([] === $packages) { |
9 | 9 | echo '<div class="row"><div class="column"><div class="bloc">No composer.json file found in this project</div></div></div>'; |
10 | - require __DIR__ . '/_footer.php'; |
|
10 | + require __DIR__.'/_footer.php'; |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | ?> |
@@ -95,4 +95,4 @@ discard block |
||
95 | 95 | </div> |
96 | 96 | </div> |
97 | 97 | |
98 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
98 | +<?php require __DIR__.'/_footer.php'; ?> |
@@ -57,10 +57,10 @@ |
||
57 | 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> |
|
60 | + <li class="<?php if (!$this->currentGroup) { echo 'active'; }?>"><a href="<?php echo $this->assetPath; ?>index.html">All</a></li> |
|
61 | 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,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"> |
@@ -193,7 +193,7 @@ discard block |
||
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'; ?> |
@@ -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; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | } |
49 | 49 | $groupsRaw = $config->get('groups'); |
50 | 50 | |
51 | - $groups = array_map(static function (array $groupRaw) { |
|
51 | + $groups = array_map(static function(array $groupRaw) { |
|
52 | 52 | return new Group($groupRaw['name'], $groupRaw['match']); |
53 | 53 | }, $groupsRaw); |
54 | 54 | $config->set('groups', $groups); |