PDepend\Metrics\Analyzer\NPathComplexityAnalyzer::calculateComplexity PHP Method

calculateComplexity() protected method

This method will calculate the NPath complexity for the given callable instance.
Since: 0.9.12
protected calculateComplexity ( PDepend\Source\AST\AbstractASTCallable $callable ) : void
$callable PDepend\Source\AST\AbstractASTCallable
return void
    protected function calculateComplexity(AbstractASTCallable $callable)
    {
        $npath = '1';
        foreach ($callable->getChildren() as $child) {
            $stmt = $child->accept($this, $npath);
            $npath = MathUtil::mul($npath, $stmt);
        }
        $this->metrics[$callable->getId()] = $npath;
    }