PDepend\Report\Overview\Pyramid::computeThreshold PHP Method

computeThreshold() private method

If no threshold is defined for the given name, this method will return null.
private computeThreshold ( string $name, mixed $value ) : string
$name string The metric/field identfier.
$value mixed The metric/field value.
return string
    private function computeThreshold($name, $value)
    {
        if (!isset($this->thresholds[$name])) {
            return null;
        }
        $threshold = $this->thresholds[$name];
        if ($value <= $threshold[0]) {
            return 'low';
        } elseif ($value >= $threshold[2]) {
            return 'high';
        } else {
            $low = $value - $threshold[0];
            $avg = $threshold[1] - $value;
            if ($low < $avg) {
                return 'low';
            }
        }
        return 'average';
    }