forked from bfw-systems/bfw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.atoum.treemap.php
47 lines (38 loc) · 1.39 KB
/
.atoum.treemap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
use
mageekguy\atoum\scripts\treemap,
mageekguy\atoum\scripts\treemap\analyzers,
mageekguy\atoum\scripts\treemap\categorizer
;
$script
->addAnalyzer(new analyzers\token())
->addAnalyzer(new analyzers\size())
->addAnalyzer(new analyzers\sloc())
->addAnalyzer(new treemap\analyzer\generic('commits', null, function(\splFileInfo $file) {
$commit = exec('git log --pretty=oneline ' . escapeshellarg($file->getRealpath()) . ' | wc -l');
return (int) trim($commit);
}
)
)
;
$testsDirectory = __DIR__ . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR;
$testsCategorizer = new categorizer('Tests');
$testsCategorizer
->setMinDepthColor('#aae6ff')
->setMaxDepthColor('#000f50')
->setCallback(function($file) use ($testsDirectory) { return (substr($file->getFilename(), -4) == '.php' && strpos($file->getRealpath(), $testsDirectory) === 0); })
;
$codeCategorizer = new categorizer('Code');
$codeCategorizer
->setMinDepthColor('#ffaac6')
->setMaxDepthColor('#50001b')
->setCallback(function($file) { return (substr($file->getFilename(), -4) == '.php'); })
;
$script
->addCategorizer($testsCategorizer)
->addCategorizer($codeCategorizer)
->addDirectory(__DIR__)
->setProjectName('BFW')
->setProjectUrl('http://bfw.test.bulton.fr')
->setOutputDirectory('/home/bfw/www/treemap/bfw-v2')
;