|
@@ -44,11 +44,11 @@ discard block |
|
|
block discarded – undo |
|
44
|
44
|
$consolidated = new Consolidated($metrics); |
|
45
|
45
|
|
|
46
|
46
|
// history of builds |
|
47
|
|
- $today = (object)[ |
|
|
47
|
+ $today = (object) [ |
|
48
|
48
|
'avg' => $consolidated->getAvg(), |
|
49
|
49
|
'sum' => $consolidated->getSum() |
|
50
|
50
|
]; |
|
51
|
|
- $files = glob($logDir . '/js/history-*.json'); |
|
|
51
|
+ $files = glob($logDir.'/js/history-*.json'); |
|
52
|
52
|
$next = sizeof($files) + 1; |
|
53
|
53
|
$history = []; |
|
54
|
54
|
natsort($files); |
|
@@ -57,37 +57,37 @@ discard block |
|
|
block discarded – undo |
|
57
|
57
|
} |
|
58
|
58
|
|
|
59
|
59
|
// copy sources |
|
60
|
|
- if(!file_exists($logDir . '/js')) { |
|
|
60
|
+ if (!file_exists($logDir.'/js')) { |
|
61
|
61
|
mkdir($logDir.'/js', 0755, true); |
|
62
|
62
|
} |
|
63
|
|
- if(!file_exists($logDir . '/css')) { |
|
|
63
|
+ if (!file_exists($logDir.'/css')) { |
|
64
|
64
|
mkdir($logDir.'/css', 0755, true); |
|
65
|
65
|
} |
|
66
|
|
- if(!file_exists($logDir . '/images')) { |
|
|
66
|
+ if (!file_exists($logDir.'/images')) { |
|
67
|
67
|
mkdir($logDir.'/images', 0755, true); |
|
68
|
68
|
} |
|
69
|
|
- if(!file_exists($logDir . '/fonts')) { |
|
|
69
|
+ if (!file_exists($logDir.'/fonts')) { |
|
70
|
70
|
mkdir($logDir.'/fonts', 0755, true); |
|
71
|
71
|
} |
|
72
|
|
- recurse_copy(__DIR__ . '/template/js', $logDir . '/js'); |
|
73
|
|
- recurse_copy(__DIR__ . '/template/css', $logDir . '/css'); |
|
74
|
|
- recurse_copy(__DIR__ . '/template/images', $logDir . '/images'); |
|
75
|
|
- recurse_copy(__DIR__ . '/template/fonts', $logDir . '/fonts'); |
|
|
72
|
+ recurse_copy(__DIR__.'/template/js', $logDir.'/js'); |
|
|
73
|
+ recurse_copy(__DIR__.'/template/css', $logDir.'/css'); |
|
|
74
|
+ recurse_copy(__DIR__.'/template/images', $logDir.'/images'); |
|
|
75
|
+ recurse_copy(__DIR__.'/template/fonts', $logDir.'/fonts'); |
|
76
|
76
|
|
|
77
|
77
|
// render dynamic pages |
|
78
|
|
- $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history); |
|
79
|
|
- $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
80
|
|
- $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
81
|
|
- $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
82
|
|
- $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history); |
|
83
|
|
- $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
84
|
|
- $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
85
|
|
- $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
86
|
|
- $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
|
78
|
+ $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history); |
|
|
79
|
+ $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
|
80
|
+ $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
|
81
|
+ $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
|
82
|
+ $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history); |
|
|
83
|
+ $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
|
84
|
+ $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
|
85
|
+ $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
|
86
|
+ $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
87
|
87
|
if ($this->config->has('git')) { |
|
88
|
|
- $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history); |
|
|
88
|
+ $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history); |
|
89
|
89
|
} |
|
90
|
|
- $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
|
90
|
+ $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
91
|
91
|
|
|
92
|
92
|
// js data |
|
93
|
93
|
file_put_contents( |
|
@@ -101,8 +101,8 @@ discard block |
|
|
block discarded – undo |
|
101
|
101
|
|
|
102
|
102
|
// json data |
|
103
|
103
|
file_put_contents( |
|
104
|
|
- $logDir . '/js/classes.js', |
|
105
|
|
- 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
|
104
|
+ $logDir.'/js/classes.js', |
|
|
105
|
+ 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
106
|
106
|
); |
|
107
|
107
|
|
|
108
|
108
|
$this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir)); |
|
@@ -170,7 +170,7 @@ discard block |
|
|
block discarded – undo |
|
170
|
170
|
|
|
171
|
171
|
$diff = $newValue - $oldValue; |
|
172
|
172
|
if ($diff > 0) { |
|
173
|
|
- $diff = '+' . $diff; |
|
|
173
|
+ $diff = '+'.$diff; |
|
174
|
174
|
} |
|
175
|
175
|
|
|
176
|
176
|
$goodOrBad = 'neutral'; |