@@ -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; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | <td><span class="path"><?php echo $class['name']; ?></span></td> |
| 83 | 83 | <?php foreach (['ccn', 'bugs'] as $attribute) {?> |
| 84 | 84 | <td> |
| 85 | - <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>);"> |
|
| 85 | + <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>);"> |
|
| 86 | 86 | <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?> |
| 87 | 87 | </span> |
| 88 | 88 | </td> |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | </div> |
| 147 | 147 | </div> |
| 148 | 148 | |
| 149 | - <?php require __DIR__ . '/_footer.php'; ?> |
|
| 149 | + <?php require __DIR__.'/_footer.php'; ?> |
|
| 150 | 150 | |
| 151 | 151 | <script type="text/javascript"> |
| 152 | 152 | var clusterize = new Clusterize({ |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | foreach ($unit['tests'] as $test) { |
| 202 | 202 | array_push($unitTimeJson->children, [ |
| 203 | 203 | 'name' => $test->classname, |
| 204 | - 'time' => (float)$test->time, |
|
| 204 | + 'time' => (float) $test->time, |
|
| 205 | 205 | ]); |
| 206 | 206 | } |
| 207 | 207 | ?> |
| 208 | 208 | |
| 209 | - var json = <?php echo json_encode($unitTimeJson);?>; |
|
| 209 | + var json = <?php echo json_encode($unitTimeJson); ?>; |
|
| 210 | 210 | root = json; |
| 211 | 211 | var nodes = treemap.nodes(json) |
| 212 | 212 | .filter(function (d) { |
@@ -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(count($array) > 1) { |
|
| 22 | +if (count($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' => percentile($array, $percentile), |
| 27 | 27 | 'percentile' => round($percentile * 100), |
| 28 | 28 | ]; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | <td><span class="path"><?php echo $class['name']; ?></span></td> |
| 64 | 64 | <?php foreach (['lloc', 'cloc', 'volume', 'intelligentContent', 'commentWeight'] as $attribute) {?> |
| 65 | 65 | <td> |
| 66 | - <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>);"> |
|
| 66 | + <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>);"> |
|
| 67 | 67 | <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?> |
| 68 | 68 | </span> |
| 69 | 69 | </td> |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | </div> |
| 77 | 77 | |
| 78 | 78 | |
| 79 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
| 79 | +<?php require __DIR__.'/_footer.php'; ?> |
|
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | <script> |
@@ -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"> |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | <div class="label"> |
| 40 | 40 | <a href="junit.html">Assertions in tests</a> |
| 41 | 41 | </div> |
| 42 | - <?php if(isset($project['unitTesting'])) { ?> |
|
| 42 | + <?php if (isset($project['unitTesting'])) { ?> |
|
| 43 | 43 | <div class="number"> |
| 44 | 44 | <?php echo $project['unitTesting']['assertions']; ?> |
| 45 | 45 | </div> |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | <tbody id="contentClassRank" class="clusterize-content"> |
| 127 | 127 | <?php |
| 128 | 128 | $classesS = $classes; |
| 129 | - usort($classesS, static function ($a, $b) { |
|
| 129 | + usort($classesS, static function($a, $b) { |
|
| 130 | 130 | return strcmp($b['pageRank'], $a['pageRank']); |
| 131 | 131 | }); |
| 132 | 132 | //$classesS = array_slice($classesS, 0, 10); |
| 133 | 133 | foreach ($classesS as $class) { ?> |
| 134 | 134 | <tr> |
| 135 | 135 | <td> |
| 136 | - <span class="badge" <?php echo gradientStyleFor($classes, 'pageRank', $class['pageRank']);?>);"> |
|
| 136 | + <span class="badge" <?php echo gradientStyleFor($classes, 'pageRank', $class['pageRank']); ?>);"> |
|
| 137 | 137 | <?php echo $class['pageRank']; ?> |
| 138 | 138 | </td> |
| 139 | 139 | </td> |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | $badgeTitleMI = 'Maintainability Index'; |
| 146 | 146 | $mi = isset($class['mi']) ? $class['mi'] : ''; |
| 147 | 147 | ?> |
| 148 | - <span class="badge" title="<?php echo $badgeTitleMI;?>"><?php echo $mi;?></span> |
|
| 149 | - <span class="badge" title="<?php echo $badgeTitleMIWOC;?>"><?php echo $mIwoC;?></span> |
|
| 148 | + <span class="badge" title="<?php echo $badgeTitleMI; ?>"><?php echo $mi; ?></span> |
|
| 149 | + <span class="badge" title="<?php echo $badgeTitleMIWOC; ?>"><?php echo $mIwoC; ?></span> |
|
| 150 | 150 | </td> |
| 151 | 151 | </tr> |
| 152 | 152 | <?php } ?> |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | <tbody id="contentPackages" class="clusterize-content"> |
| 181 | 181 | <?php |
| 182 | 182 | $packages = isset($project['composer']['packages']) ? $project['composer']['packages'] : []; |
| 183 | - usort($packages, function ($a, $b) { |
|
| 183 | + usort($packages, function($a, $b) { |
|
| 184 | 184 | return strcmp($a->name, $b->name); |
| 185 | 185 | }); |
| 186 | - foreach ($packages as $package) if( !preg_match('!(^php$|^ext\-)!', $package->name)) { ?> |
|
| 186 | + foreach ($packages as $package) if (!preg_match('!(^php$|^ext\-)!', $package->name)) { ?> |
|
| 187 | 187 | <tr> |
| 188 | 188 | <td> |
| 189 | 189 | <a target="_blank" href="https://packagist.org/packages/<?php echo $package->name; ?>"> |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | <td><?php echo $package->required; ?></td> |
| 194 | 194 | <?php if (0 !== count($packagesInstalled)) {?><td><?php echo $package->installed; ?></td><?php } ?> |
| 195 | 195 | <td><?php echo $package->latest; ?></td> |
| 196 | - <td><?php foreach($package->license as $license) { ?> |
|
| 197 | - <a target="_blank" href="https://spdx.org/licenses/<?php echo $license;?>.html"><?php echo $license;?></a> |
|
| 196 | + <td><?php foreach ($package->license as $license) { ?> |
|
| 197 | + <a target="_blank" href="https://spdx.org/licenses/<?php echo $license; ?>.html"><?php echo $license; ?></a> |
|
| 198 | 198 | <?php } ?> |
| 199 | 199 | </td> |
| 200 | 200 | </tr> |
| 201 | 201 | <?php } ?> |
| 202 | 202 | </tbody> |
| 203 | 203 | </table> |
| 204 | - <?php if(0 === count($packages)) { ?> |
|
| 204 | + <?php if (0 === count($packages)) { ?> |
|
| 205 | 205 | <div>No composer.json file found</div> |
| 206 | 206 | <?php } ?> |
| 207 | - <?php if(0 === count($packagesInstalled)) { ?> |
|
| 207 | + <?php if (0 === count($packagesInstalled)) { ?> |
|
| 208 | 208 | <div>No composer.lock file found</div> |
| 209 | 209 | <?php } ?> |
| 210 | 210 | </div> |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | <div class="column"> |
| 216 | 216 | <div class="bloc bloc-number"> |
| 217 | 217 | <div class="label">Licences of Composer dependencies</div> |
| 218 | - <?php if(0 === count($packages)) { ?> |
|
| 218 | + <?php if (0 === count($packages)) { ?> |
|
| 219 | 219 | <div>No composer.json file found</div> |
| 220 | 220 | <?php } ?> |
| 221 | 221 | <div id="svg-licenses"></div> |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | ?> |
| 258 | - chartLicenses(<?php echo json_encode(array_values($json));?>); |
|
| 258 | + chartLicenses(<?php echo json_encode(array_values($json)); ?>); |
|
| 259 | 259 | } |
| 260 | 260 | }; |
| 261 | 261 | </script> |
| 262 | 262 | |
| 263 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
| 263 | +<?php require __DIR__.'/_footer.php'; ?> |
|
@@ -183,10 +183,13 @@ |
||
| 183 | 183 | usort($packages, function ($a, $b) { |
| 184 | 184 | return strcmp($a->name, $b->name); |
| 185 | 185 | }); |
| 186 | - foreach ($packages as $package) if( !preg_match('!(^php$|^ext\-)!', $package->name)) { ?> |
|
| 186 | + foreach ($packages as $package) { |
|
| 187 | + if( !preg_match('!(^php$|^ext\-)!', $package->name)) { ?> |
|
| 187 | 188 | <tr> |
| 188 | 189 | <td> |
| 189 | - <a target="_blank" href="https://packagist.org/packages/<?php echo $package->name; ?>"> |
|
| 190 | + <a target="_blank" href="https://packagist.org/packages/<?php echo $package->name; |
|
| 191 | + } |
|
| 192 | + ?>"> |
|
| 190 | 193 | <?php echo $package->name; ?> |
| 191 | 194 | </a> |
| 192 | 195 | </td> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php require __DIR__ . '/_header.php'; ?> |
|
| 1 | +<?php require __DIR__.'/_header.php'; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="row"> |
| 4 | 4 | <div class="column"> |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | <td><span class="path"><?php echo $class['name']; ?></span></td> |
| 27 | 27 | <?php foreach (['afferentCoupling', 'efferentCoupling', 'instability', 'pageRank'] as $attribute) {?> |
| 28 | 28 | <td> |
| 29 | - <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>);"> |
|
| 29 | + <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>);"> |
|
| 30 | 30 | <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?> |
| 31 | 31 | </span> |
| 32 | 32 | </td> |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | </div> |
| 43 | 43 | |
| 44 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
| 44 | +<?php require __DIR__.'/_footer.php'; ?> |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | <script type="text/javascript"> |
@@ -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 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | <td><span class="path"><?php echo $class['name']; ?></span></td> |
| 78 | 78 | <?php foreach (['lcom', 'volume', 'ccn', 'ccnMethodMax', 'bugs', 'difficulty'] as $attribute) {?> |
| 79 | 79 | <td> |
| 80 | - <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>);"> |
|
| 80 | + <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>);"> |
|
| 81 | 81 | <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?> |
| 82 | 82 | </span> |
| 83 | 83 | </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'; ?> |
|
@@ -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 | |