Completed
Pull Request — master (#269)
by Alister
04:22
created
src/Hal/Report/Html/template/_footer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 
4 4
 <!-- Sidebar -->
5
-<?php if(!isset($fullwidth) || $fullwidth === false) {?>
5
+<?php if (!isset($fullwidth) || $fullwidth === false) {?>
6 6
 <div id="sidebar">
7 7
     <div class="content">
8 8
         <div class="logo">
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
                             <path d="M0 0h24v24H0z" fill="none"/>
95 95
                             <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"/>
96 96
                         </svg>
97
-                        Violations (<?php echo $sum->violations->total;?>)
97
+                        Violations (<?php echo $sum->violations->total; ?>)
98 98
                     </a>
99 99
                 </li>
100
-                <?php if($config->has('junit')) { ?>
100
+                <?php if ($config->has('junit')) { ?>
101 101
                     <li>
102 102
                         <a href="junit.html">
103 103
                             <svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                         </a>
109 109
                     </li>
110 110
                 <?php } ?>
111
-                <?php if($config->has('git')) { ?>
111
+                <?php if ($config->has('git')) { ?>
112 112
                 <li>
113 113
                     <a href="git.html">
114 114
                         <img src="images/logo-git.png" alt="">
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/coupling.php 1 patch
Spacing   +2 added lines, -2 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">
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 </div>
40 40
 
41
-<?php require __DIR__ . '/_footer.php'; ?>
41
+<?php require __DIR__.'/_footer.php'; ?>
42 42
 
43 43
 
44 44
 <script type="text/javascript">
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/oop.php 1 patch
Spacing   +2 added lines, -2 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
 
@@ -88,4 +88,4 @@  discard block
 block discarded – undo
88 88
     </div>
89 89
 
90 90
 
91
-<?php require __DIR__ . '/_footer.php'; ?>
92 91
\ No newline at end of file
92
+<?php require __DIR__.'/_footer.php'; ?>
93 93
\ No newline at end of file
Please login to merge, or discard this patch.
src/Hal/Metric/Consolidated.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,30 +44,30 @@  discard block
 block discarded – undo
44 44
         $nbInterfaces = 0;
45 45
         foreach ($metrics->all() as $key => $item) {
46 46
             if ($item instanceof ClassMetric) {
47
-                $classes[] = $item->all();;
47
+                $classes[] = $item->all(); ;
48 48
             }
49 49
             if ($item instanceof InterfaceMetric) {
50 50
                 $nbInterfaces++;
51 51
             }
52 52
             if ($item instanceof FunctionMetric) {
53
-                $functions[$key] = $item->all();;
53
+                $functions[$key] = $item->all(); ;
54 54
             }
55 55
             if ($item instanceof FileMetric) {
56
-                $files[$key] = $item->all();;
56
+                $files[$key] = $item->all(); ;
57 57
             }
58 58
             if ($item instanceof ProjectMetric) {
59
-                $project[$key] = $item->all();;
59
+                $project[$key] = $item->all(); ;
60 60
             }
61 61
         }
62 62
 
63 63
         // sums
64
-        $sum = (object)[
64
+        $sum = (object) [
65 65
             'loc' => 0,
66 66
             'cloc' => 0,
67 67
             'lloc' => 0,
68 68
             'nbMethods' => 0,
69 69
         ];
70
-        $avg = (object)[
70
+        $avg = (object) [
71 71
             'ccn' => [],
72 72
             'bugs' => [],
73 73
             'kanDefect' => [],
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 $violations[$name]++;
129 129
             }
130 130
         }
131
-        $sum->violations = (object)$violations;
131
+        $sum->violations = (object) $violations;
132 132
 
133 133
 
134 134
         $this->avg = $avg;
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Text/HalsteadVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             $operands = [];
57 57
             $operators = [];
58 58
 
59
-            iterate_over_node($node, function ($node) use (&$operators, &$operands) {
59
+            iterate_over_node($node, function($node) use (&$operators, &$operands) {
60 60
 
61 61
                 if (
62 62
                     $node instanceof Node\Expr\BinaryOp
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Structural/SystemComplexityVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
                     $output = 0;
53 53
                     $fanout = [];
54 54
 
55
-                    iterate_over_node($node, function ($node) use (&$output, &$fanout) {
55
+                    iterate_over_node($node, function($node) use (&$output, &$fanout) {
56 56
                         switch (true) {
57 57
                             case $node instanceof Stmt\Return_:
58 58
                                 $output++;
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Structural/LcomVisitor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
             foreach ($node->stmts as $stmt) {
46 46
                 if ($stmt instanceof Stmt\ClassMethod) {
47 47
 
48
-                    if (!$graph->has($stmt->name . '()')) {
49
-                        $graph->insert(new TreeNode($stmt->name . '()'));
48
+                    if (!$graph->has($stmt->name.'()')) {
49
+                        $graph->insert(new TreeNode($stmt->name.'()'));
50 50
                     }
51
-                    $from = $graph->get($stmt->name . '()');
51
+                    $from = $graph->get($stmt->name.'()');
52 52
 
53
-                    \iterate_over_node($stmt, function ($node) use ($from, &$graph) {
53
+                    \iterate_over_node($stmt, function($node) use ($from, &$graph) {
54 54
 
55 55
                         if ($node instanceof Node\Expr\PropertyFetch && isset($node->var->name) && $node->var->name == 'this') {
56 56
                             $name = getNameOfNode($node);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                             if (!$node->var instanceof Node\Expr\New_ && isset($node->var->name) && getNameOfNode($node->var) === 'this') {
69 69
                                 // use of method call $this->xxx();
70 70
                                 // use of attribute $this->xxx;
71
-                                $name = getNameOfNode($node->name) . '()';
71
+                                $name = getNameOfNode($node->name).'()';
72 72
                                 if (!$graph->has($name)) {
73 73
                                     $graph->insert(new TreeNode($name));
74 74
                                 }
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Complexity/KanDefectVisitor.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
             $select = $while = $if = 0;
44 44
 
45
-            iterate_over_node($node, function ($node) use (&$while, &$select, &$if) {
45
+            iterate_over_node($node, function($node) use (&$while, &$select, &$if) {
46 46
                 switch (true) {
47 47
                     case $node instanceof Stmt\Do_:
48 48
                     case $node instanceof Stmt\Foreach_:
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 }
59 59
             });
60 60
 
61
-            $defect = 0.15 + 0.23 *  $while + 0.22 *  $select + 0.07 * $if;
61
+            $defect = 0.15 + 0.23 * $while + 0.22 * $select + 0.07 * $if;
62 62
             $class->set('kanDefect', round($defect, 2));
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Hal\Metric\Class_\Complexity;
3 3
 
4
-use Hal\Component\Reflected\Method;
5 4
 use Hal\Metric\Metrics;
6 5
 use PhpParser\Node;
7 6
 use PhpParser\Node\Stmt;
Please login to merge, or discard this patch.
src/Hal/Metric/System/Changes/GitChanges.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         }
52 52
 
53 53
         $r = shell_exec(sprintf('%s --version', $bin));
54
-        if(!preg_match('!git version!', $r)) {
54
+        if (!preg_match('!git version!', $r)) {
55 55
             throw new ConfigException(sprintf('Git binary (%s) incorrect', $bin));
56 56
         }
57 57
 
Please login to merge, or discard this patch.