do
while ()
S;
-- NP(do) = NP() + NP() + 1 --
public visitDoWhileStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
Résultat | string |
public function visitDoWhileStatement($node, $data)
{
$stmt = $node->getChild(0)->accept($this, 1);
$expr = $this->sumComplexity($node->getChild(1));
$npath = MathUtil::add($expr, $stmt);
$npath = MathUtil::add($npath, '1');
return MathUtil::mul($npath, $data);
}