Parses a clover xml and maps the coverage based on the relative path on your local and will calculate and creates a static website that shows the coverage.
composer create-project daison/clover-to-html:dev-master clover-to-html --no-interaction
cd clover-to-html
./clover-coverage-to-html process --xml-path=tests/coverage.xml --store-path=reports/coverage --config-path=config.example.php
clover_to_html.php
return [
'title' => 'My Project Code Coverage',
'ignores' => [
'exact' => [
'});',
']);',
');',
'}',
'{',
']',
'[',
') {',
'return [',
'];',
'try {',
],
'regex' => [
'catch( |)\((.*)\)',
'\}( |)else( |)\{',
],
],
'badges' => [
'Repositories' => 'Repositories/', // single
'Controllers' => ['Controllers/Api', 'Controllers/Http'], // grouping
// or regex sample
'User' => '(.*)User(.*)',
'Payment => ['/Payment', 'Payment(Controller|Repository)'],
],
];
You could ignore a code based on the regex
or an exact
value of that line.
The computation will be different compared to the original clover computations, where we only combined the (green + red is equal to 100%). This is to simplify the wrong output given by phpdbg
or xdebug
drivers as example when using php.