Completed
Push — master ( e51b3d...b64695 )
by personal
45s queued 11s
created
src/Hal/Report/Html/Reporter.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.
src/Hal/Metric/Consolidated.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Hal/Application/Config/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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);
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
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 
14 14
 // 2. percentile map
15 15
 $json = [];
16
-if(count($array) > 1) {
16
+if (count($array) > 1) {
17 17
     $range = range(0.5, 1, .05);
18 18
     foreach ($range as $percentile) {
19
-        $json[] = (object)[
19
+        $json[] = (object) [
20 20
             'lloc' => percentile($array, $percentile),
21 21
             'percentile' => round($percentile * 100),
22 22
         ];
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                         <td><span class="path"><?php echo $class['name']; ?></span></td>
58 58
                         <?php foreach (['lloc', 'cloc', 'volume', 'intelligentContent', 'commentWeight'] as $attribute) {?>
59 59
                             <td>
60
-                                <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>>
60
+                                <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>>
61 61
                                 <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?>
62 62
                                 </span>
63 63
                             </td>
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 </div>
71 71
 
72 72
 
73
-<?php require __DIR__ . '/_footer.php'; ?>
73
+<?php require __DIR__.'/_footer.php'; ?>
74 74
 
75 75
 
76 76
 <script>
Please login to merge, or discard this patch.
templates/html_report/index.php 1 patch
Spacing   +10 added lines, -10 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
     <div class="row">
4 4
         <div class="column">
5 5
             <div class="bloc bloc-number">
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'; ?>
Please login to merge, or discard this patch.
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/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">
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                             <td><span class="path"><?php echo $class['name']; ?></span></td>
76 76
                             <?php foreach (['wmc', 'ccn', 'ccnMethodMax', 'relativeSystemComplexity', 'relativeDataComplexity', 'relativeStructuralComplexity', 'bugs', 'kanDefect'] as $attribute) {?>
77 77
                                 <td>
78
-                                    <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>>
78
+                                    <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>>
79 79
                                     <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?>
80 80
                                     </span>
81 81
                                 </td>
@@ -91,4 +91,4 @@  discard block
 block discarded – undo
91 91
     </div>
92 92
 
93 93
 
94
-<?php require __DIR__ . '/_footer.php'; ?>
94
+<?php require __DIR__.'/_footer.php'; ?>
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.