@@ -1,7 +1,6 @@ |
||
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; |
@@ -42,7 +42,7 @@ discard block |
||
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 |
||
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 | } |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Hal\Metric\FunctionMetric; |
5 | 5 | use Hal\Metric\Metrics; |
6 | -use Hoa\Ruler\Model\Bag\Scalar; |
|
7 | 6 | use PhpParser\Node; |
8 | 7 | use PhpParser\Node\Stmt; |
9 | 8 | use PhpParser\NodeVisitorAbstract; |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace Hal\Report\Violations\Xml; |
3 | 3 | |
4 | 4 | use Hal\Application\Config\Config; |
5 | -use Hal\Metric\Consolided; |
|
6 | 5 | use Hal\Metric\Metrics; |
7 | 6 | use Hal\Violation\Violation; |
8 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | if ($node instanceof \PhpParser\Node\Name\FullyQualified) { |
93 | - return (string)$node; |
|
93 | + return (string) $node; |
|
94 | 94 | } |
95 | 95 | if ($node instanceof \PhpParser\Node\Expr\New_) { |
96 | 96 | return getNameOfNode($node->class); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($node instanceof \PhpParser\Node\Name) { |
104 | - return (string)implode($node->parts); |
|
104 | + return (string) implode($node->parts); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if (isset($node->name) && $node->name instanceof \PhpParser\Node\Expr\Variable) { |
@@ -129,7 +129,7 @@ discard block |
||
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 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $string = ''; |
46 | 46 | foreach ($this->data as $violation) { |
47 | - $string .= $violation->getName() . ','; |
|
47 | + $string .= $violation->getName().','; |
|
48 | 48 | } |
49 | 49 | return $string; |
50 | 50 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, null, new OutputFormatter()); |
25 | 25 | |
26 | 26 | // issues and debug |
27 | - $issuer = (new Issuer($output));//->enable(); |
|
27 | + $issuer = (new Issuer($output)); //->enable(); |
|
28 | 28 | |
29 | 29 | // config |
30 | 30 | $config = (new Parser())->parse($argv); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | // analyze |
59 | 59 | try { |
60 | 60 | $metrics = (new Analyze($config, $output, $issuer))->run($files); |
61 | - }catch(ConfigException $e) { |
|
61 | + } catch (ConfigException $e) { |
|
62 | 62 | $output->writeln(sprintf('<error>%s</error>', $e->getMessage())); |
63 | 63 | exit(1); |
64 | 64 | } |
@@ -25,9 +25,9 @@ |
||
25 | 25 | { |
26 | 26 | parent::__construct($cloneNodes); |
27 | 27 | |
28 | - if(null === $stopCondition) { |
|
28 | + if (null === $stopCondition) { |
|
29 | 29 | $stopCondition = function($node) { |
30 | - if($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Interface_) { |
|
30 | + if ($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Interface_) { |
|
31 | 31 | return false; |
32 | 32 | } |
33 | 33 |
@@ -71,14 +71,14 @@ |
||
71 | 71 | $files = array(); |
72 | 72 | foreach ($paths as $path) { |
73 | 73 | if (is_dir($path)) { |
74 | - $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
74 | + $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
75 | 75 | $directory = new RecursiveDirectoryIterator($path, $this->flags); |
76 | 76 | $iterator = new RecursiveIteratorIterator($directory); |
77 | 77 | |
78 | 78 | $filterRegex = sprintf( |
79 | 79 | '`^%s%s$`', |
80 | - !empty($this->excludedDirs) ? '((?!' . implode('|', $this->excludedDirs) . ').)+' : '.+', |
|
81 | - '\.(' . implode('|', $this->extensions) . ')' |
|
80 | + !empty($this->excludedDirs) ? '((?!'.implode('|', $this->excludedDirs).').)+' : '.+', |
|
81 | + '\.('.implode('|', $this->extensions).')' |
|
82 | 82 | ); |
83 | 83 | |
84 | 84 | $filteredIterator = new RegexIterator( |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; ?> |
|
2 | +require __DIR__.'/_header.php'; ?> |
|
3 | 3 | |
4 | 4 | <?php |
5 | 5 | $unit = $project['unitTesting']; |
6 | -$getMetricForClass = function ($classname, $metric) use ($classes) { |
|
6 | +$getMetricForClass = function($classname, $metric) use ($classes) { |
|
7 | 7 | foreach ($classes as $class) { |
8 | 8 | if ($classname !== $class['name']) { |
9 | 9 | continue; |
@@ -81,4 +81,4 @@ discard block |
||
81 | 81 | </div> |
82 | 82 | |
83 | 83 | |
84 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
85 | 84 | \ No newline at end of file |
85 | +<?php require __DIR__.'/_footer.php'; ?> |
|
86 | 86 | \ No newline at end of file |