We use a variety of tools for testing DMDirc. The output of these tools is
summarised below.
Tool | Information | Results |
', $name, ' | ';
echo '', $desc, ' | ';
echo '', $result, ' | ';
}
/** Junit **/
$data = @file_get_contents('/home/dmdirc/www/junit/overview-summary.html');
preg_match('#href="all-tests.html">([0-9]+)#i', $data, $tests);
preg_match('#href="alltests-fails.html">([0-9]+)#i', $data, $fails);
preg_match('#href="alltests-errors.html">([0-9]+)#i', $data, $errors);
$result = $tests[1] . ' tests, ' . $fails[1] . ' failure(s), ' . $errors[1] . ' error(s)';
$status = ($fails[1] + $errors[1] == 0) ? 'good' : 'bad';
showTool('frame-junit.html', 'JUnit', 'Unit test framework', $result, $status);
/** Clover **/
$data = @file_get_contents('clover/dashboard.html');
preg_match('#\s*([0-9.]+)%\s*$#im', $data, $cover);
showTool('frame-clover.html', 'Clover', 'Unit test coverage analyser', $cover[1] . '% coverage', (double) $cover[1] < 25 ? 'bad' : 'good');
/** CPD **/
$data = @file_get_contents('report-cpd.html');
preg_match('#^ | ([0-9]+) | #im', $data, $cpd);
showTool('frame-cpd.html', 'Copy & Paste Detection', 'Detects repeated code that may be better off refactored', $cpd[1] . ' duplications', $cpd[1] > 100 ? 'bad' : 'good');
/** PMD **/
$data = @file_get_contents('report-pmd.html');
preg_match('#^([0-9]+) | $#im', $data, $pmd);
showTool('frame-pmd.html', 'PMD', 'Detects potential problems with code', $pmd[1] . ' violations', $pmd[1] > 2600 ? 'bad' : 'good');
/** Checkstyle **/
function showCheckstyle($title, $page, $target = 100) {
$data = @file_get_contents('report-'.$page);
preg_match('#^ | ([0-9]+) | ([0-9]+) | $#im', $data, $cs);
showTool('frame-checkstyle-'.$page, 'Checkstyle', 'Detects style errors (scope: ' . $title . ')', $cs[2] . ' errors', $cs[2] > $target ? 'bad' : 'good');
}
showCheckstyle('whole project', 'all.html', 750);
showCheckstyle('actions', 'actions.html');
showCheckstyle('command parser', 'commandparser.html');
showCheckstyle('core', 'core.html');
showCheckstyle('config', 'config.html');
showCheckstyle('logger', 'logger.html');
showCheckstyle('IRC parser', 'parser.html');
showCheckstyle('Plugins', 'plugins.html');
showCheckstyle('UI', 'ui.html');
?>
Findbugs report
Doc Check report