메소드 | 설명 | |
---|---|---|
analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void | Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes. | |
getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array | This method will return an array with all generated metric values for the node with the given $id identifier. If there are no metrics for the requested node, this method will return an empty array. | |
sumComplexity ( PDepend\Source\AST\ASTNode $node ) : string | Calculates the expression sum of the given node. | |
visitConditionalExpression ( $node, string $data ) : string | This method calculates the NPath Complexity of a conditional-statement, the meassured value is then returned as a string. | |
visitDoWhileStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a do-while-statement, the meassured value is then returned as a string. | |
visitElseIfStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of an elseif-statement, the meassured value is then returned as a string. | |
visitForStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a for-statement, the meassured value is then returned as a string. | |
visitForeachStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a for-statement, the meassured value is then returned as a string. | |
visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void | Visits a function node. | |
visitIfStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of an if-statement, the meassured value is then returned as a string. | |
visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void | Visits a code interface object. | |
visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void | Visits a method node. | |
visitReturnStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a return-statement, the meassured value is then returned as a string. | |
visitSwitchStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a switch-statement, the meassured value is then returned as a string. | |
visitTryStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a try-catch-statement, the meassured value is then returned as a string. | |
visitWhileStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | This method calculates the NPath Complexity of a while-statement, the meassured value is then returned as a string. |
메소드 | 설명 | |
---|---|---|
calculateComplexity ( PDepend\Source\AST\AbstractASTCallable $callable ) : void | This method will calculate the NPath complexity for the given callable instance. |
protected calculateComplexity ( PDepend\Source\AST\AbstractASTCallable $callable ) : void | ||
$callable | PDepend\Source\AST\AbstractASTCallable | |
리턴 | void |
array(
'npath' => '17'
)
public getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array | ||
$artifact | PDepend\Source\AST\ASTArtifact | |
리턴 | array |
public sumComplexity ( PDepend\Source\AST\ASTNode $node ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
리턴 | string |
? :
-- NP(?) = NP() + NP() + NP() + 2 --
public visitConditionalExpression ( $node, string $data ) : string | ||
$data | string | |
리턴 | string |
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. |
리턴 | string |
elseif ()
S;
-- NP(elseif) = NP() + NP() + 1 --
elseif ()
else
S;
-- NP(if) = NP() + NP() + NP( --
public visitElseIfStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
for (; ; )
S;
-- NP(for) = NP() + NP() + NP() + NP() + 1 --
public visitForStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
fpreach ()
S;
-- NP(foreach) = NP() + NP() + 1 --
public visitForeachStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
public visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void | ||
$function | PDepend\Source\AST\ASTFunction | |
리턴 | void |
if ()
S;
-- NP(if) = NP() + NP() + 1 --
if ()
else
S;
-- NP(if) = NP() + NP() + NP( --
public visitIfStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
public visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void | ||
$interface | PDepend\Source\AST\ASTInterface | |
리턴 | void |
public visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void | ||
$method | PDepend\Source\AST\ASTMethod | |
리턴 | void |
return ;
-- NP(return) = NP() --
public visitReturnStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
switch ()
...
-- NP(switch) = NP() + NP() + NP() ... --
public visitSwitchStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
try
catch
-- NP(try) = NP() + NP() --
try
catch
catch
...
-- NP(try) = NP() + NP() + NP() ... --
public visitTryStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |
while ()
S;
-- NP(while) = NP() + NP() + 1 --
public visitWhileStatement ( PDepend\Source\AST\ASTNode $node, string $data ) : string | ||
$node | PDepend\Source\AST\ASTNode | The currently visited node. |
$data | string | The previously calculated npath value. |
리턴 | string |