PHP 클래스 PDepend\Metrics\Analyzer\NPathComplexityAnalyzer

상속: extends PDepend\Metrics\AbstractCachingAnalyzer, implements PDepend\Metrics\AnalyzerFilterAware, implements PDepend\Metrics\AnalyzerNodeAware
파일 보기 프로젝트 열기: pdepend/pdepend 1 사용 예제들

공개 메소드들

메소드 설명
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.

메소드 상세

analyze() 공개 메소드

Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
public analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void
$namespaces PDepend\Source\AST\ASTNamespace[]
리턴 void

calculateComplexity() 보호된 메소드

This method will calculate the NPath complexity for the given callable instance.
부터: 0.9.12
protected calculateComplexity ( PDepend\Source\AST\AbstractASTCallable $callable ) : void
$callable PDepend\Source\AST\AbstractASTCallable
리턴 void

getNodeMetrics() 공개 메소드

array( 'npath' => '17' )
public getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array
$artifact PDepend\Source\AST\ASTArtifact
리턴 array

sumComplexity() 공개 메소드

Calculates the expression sum of the given node.
부터: 0.9.12
public sumComplexity ( PDepend\Source\AST\ASTNode $node ) : string
$node PDepend\Source\AST\ASTNode The currently visited node.
리턴 string

visitConditionalExpression() 공개 메소드

? : -- NP(?) = NP() + NP() + NP() + 2 --
부터: 0.9.12
public visitConditionalExpression ( $node, string $data ) : string
$data string
리턴 string

visitDoWhileStatement() 공개 메소드

do while () S; -- NP(do) = NP() + NP() + 1 --
부터: 0.9.12
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

visitElseIfStatement() 공개 메소드

elseif () S; -- NP(elseif) = NP() + NP() + 1 -- elseif () else S; -- NP(if) = NP() + NP() + NP( --
부터: 0.9.12
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

visitForStatement() 공개 메소드

for (; ; ) S; -- NP(for) = NP() + NP() + NP() + NP() + 1 --
부터: 0.9.12
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

visitForeachStatement() 공개 메소드

fpreach () S; -- NP(foreach) = NP() + NP() + 1 --
부터: 0.9.12
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

visitFunction() 공개 메소드

Visits a function node.
public visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void
$function PDepend\Source\AST\ASTFunction
리턴 void

visitIfStatement() 공개 메소드

if () S; -- NP(if) = NP() + NP() + 1 -- if () else S; -- NP(if) = NP() + NP() + NP( --
부터: 0.9.12
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

visitInterface() 공개 메소드

Visits a code interface object.
public visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void
$interface PDepend\Source\AST\ASTInterface
리턴 void

visitMethod() 공개 메소드

Visits a method node.
public visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void
$method PDepend\Source\AST\ASTMethod
리턴 void

visitReturnStatement() 공개 메소드

return ; -- NP(return) = NP() --
부터: 0.9.12
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

visitSwitchStatement() 공개 메소드

switch () ... -- NP(switch) = NP() + NP() + NP() ... --
부터: 0.9.12
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

visitTryStatement() 공개 메소드

try catch -- NP(try) = NP() + NP() -- try catch catch ... -- NP(try) = NP() + NP() + NP() ... --
부터: 0.9.12
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

visitWhileStatement() 공개 메소드

while () S; -- NP(while) = NP() + NP() + 1 --
부터: 0.9.12
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