function Dashboard::complexity
Returns the data for the Class/Method Complexity charts.
1 call to Dashboard::complexity()
- Dashboard::render in vendor/
phpunit/ php-code-coverage/ src/ Report/ Html/ Renderer/ Dashboard.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ Report/ Html/ Renderer/ Dashboard.php, line 86
Class
- Dashboard
- @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
Namespace
SebastianBergmann\CodeCoverage\Report\HtmlCode
private function complexity(array $classes, string $baseLink) : array {
$result = [
'class' => [],
'method' => [],
];
foreach ($classes as $className => $class) {
foreach ($class['methods'] as $methodName => $method) {
if ($className !== '*') {
$methodName = $className . '::' . $methodName;
}
$result['method'][] = [
$method['coverage'],
$method['ccn'],
sprintf('<a href="%s">%s</a>', str_replace($baseLink, '', $method['link']), $methodName),
];
}
$result['class'][] = [
$class['coverage'],
$class['ccn'],
sprintf('<a href="%s">%s</a>', str_replace($baseLink, '', $class['link']), $className),
];
}
return [
'class' => json_encode($result['class']),
'method' => json_encode($result['method']),
];
}