Completed
Pull Request — master (#467)
by Roel
29s
created
templates/html_report/junit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
templates/html_report/loc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
templates/html_report/coupling.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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">
Please login to merge, or discard this patch.
templates/html_report/oop.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
90 90
     </div>
91 91
 
92 92
 
93
-<?php require __DIR__ . '/_footer.php'; ?>
93
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
templates/html_report/complexity.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
90 90
     </div>
91 91
 
92 92
 
93
-<?php require __DIR__ . '/_footer.php'; ?>
93
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hal/Metric/System/Packages/Composer/Composer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
templates/html_report/composer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
95 95
     </div>
96 96
 </div>
97 97
 
98
-<?php require __DIR__ . '/_footer.php'; ?>
98
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
templates/html_report/_header.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,10 +57,10 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.