lithium\test\filter\Complexity::analyze()

public static method

Analyzes the results of a test run and returns the result of the analysis.

Parameters

  • object $report

    The report instance running this filter and aggregating results

  • array $options

    Not used.

Returns

array

The results of the analysis.

Source

	public static function analyze($report, array $options = []) {
		$filterResults = static::collect($report->results['filters'][__CLASS__]);
		$metrics = ['max' => [], 'class' => []];

		foreach ($filterResults as $class => $methods) {
			if (!$methods) {
				continue;
			}
			$metrics['class'][$class] = array_sum($methods) / count($methods);

			foreach ($methods as $method => $count) {
				$metrics['max']["{$class}::{$method}()"] = $count;
			}
		}

		arsort($metrics['max']);
		arsort($metrics['class']);
		return $metrics;
	}