PHP Class PDepend\Metrics\Analyzer\DependencyAnalyzer

Inheritance: extends PDepend\Metrics\AbstractAnalyzer
Exibir arquivo Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$nodeSet

Public Methods

Method Description
analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
getAfferents ( PDepend\Source\AST\AbstractASTArtifact $node ) : PDepend\Source\AST\AbstractASTArtifact[] Returns an array of all afferent nodes.
getCycle ( PDepend\Source\AST\AbstractASTArtifact $node ) : PDepend\Source\AST\AbstractASTArtifact[] Returns an array of nodes that build a cycle for the requested node or it returns null if no cycle exists .
getEfferents ( PDepend\Source\AST\AbstractASTArtifact $node ) : PDepend\Source\AST\AbstractASTArtifact[] Returns an array of all efferent nodes.
getStats ( PDepend\Source\AST\AbstractASTArtifact $node ) : array Returns the statistics for the requested node.
visitClass ( PDepend\Source\AST\ASTClass $class ) : void Visits a class node.
visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void Visits an interface node.
visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void Visits a method node.
visitNamespace ( PDepend\Source\AST\ASTNamespace $namespace ) : void Visits a namespace node.

Protected Methods

Method Description
calculateAbstractness ( ) : void Calculates the abstractness for all analyzed nodes.
calculateDistance ( ) : void Calculates the distance to an optimal value.
calculateInstability ( ) : void Calculates the instability for all analyzed nodes.
collectCycle ( array &$list, PDepend\Source\AST\ASTNamespace $namespace ) : boolean Collects a single cycle that is reachable by this namespace. All namespaces that are part of the cylce are stored in the given $list array.
initNamespaceMetric ( PDepend\Source\AST\ASTNamespace $namespace ) : void Initializes the node metric record for the given $namespace.
postProcess ( ) : void Post processes all analyzed nodes.
visitType ( PDepend\Source\AST\AbstractASTClassOrInterface $type ) : void Generic visit method for classes and interfaces. Both visit methods delegate calls to this method.

Private Methods

Method Description
collectDependencies ( PDepend\Source\AST\ASTNamespace $namespaceA, PDepend\Source\AST\ASTNamespace $namespaceB ) : void Collects the dependencies between the two given namespaces.

Method Details

analyze() public method

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

calculateAbstractness() protected method

Calculates the abstractness for all analyzed nodes.
protected calculateAbstractness ( ) : void
return void

calculateDistance() protected method

Calculates the distance to an optimal value.
protected calculateDistance ( ) : void
return void

calculateInstability() protected method

Calculates the instability for all analyzed nodes.
protected calculateInstability ( ) : void
return void

collectCycle() protected method

Collects a single cycle that is reachable by this namespace. All namespaces that are part of the cylce are stored in the given $list array.
protected collectCycle ( array &$list, PDepend\Source\AST\ASTNamespace $namespace ) : boolean
$list array
$namespace PDepend\Source\AST\ASTNamespace
return boolean If this method detects a cycle the return value is true otherwise this method will return false.

getAfferents() public method

Returns an array of all afferent nodes.
public getAfferents ( PDepend\Source\AST\AbstractASTArtifact $node ) : PDepend\Source\AST\AbstractASTArtifact[]
$node PDepend\Source\AST\AbstractASTArtifact
return PDepend\Source\AST\AbstractASTArtifact[]

getCycle() public method

Returns an array of nodes that build a cycle for the requested node or it returns null if no cycle exists .
public getCycle ( PDepend\Source\AST\AbstractASTArtifact $node ) : PDepend\Source\AST\AbstractASTArtifact[]
$node PDepend\Source\AST\AbstractASTArtifact
return PDepend\Source\AST\AbstractASTArtifact[]

getEfferents() public method

Returns an array of all efferent nodes.
public getEfferents ( PDepend\Source\AST\AbstractASTArtifact $node ) : PDepend\Source\AST\AbstractASTArtifact[]
$node PDepend\Source\AST\AbstractASTArtifact
return PDepend\Source\AST\AbstractASTArtifact[]

getStats() public method

Returns the statistics for the requested node.
public getStats ( PDepend\Source\AST\AbstractASTArtifact $node ) : array
$node PDepend\Source\AST\AbstractASTArtifact
return array

initNamespaceMetric() protected method

Initializes the node metric record for the given $namespace.
protected initNamespaceMetric ( PDepend\Source\AST\ASTNamespace $namespace ) : void
$namespace PDepend\Source\AST\ASTNamespace
return void

postProcess() protected method

Post processes all analyzed nodes.
protected postProcess ( ) : void
return void

visitClass() public method

Visits a class node.
public visitClass ( PDepend\Source\AST\ASTClass $class ) : void
$class PDepend\Source\AST\ASTClass
return void

visitInterface() public method

Visits an interface node.
public visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void
$interface PDepend\Source\AST\ASTInterface
return void

visitMethod() public method

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

visitNamespace() public method

Visits a namespace node.
public visitNamespace ( PDepend\Source\AST\ASTNamespace $namespace ) : void
$namespace PDepend\Source\AST\ASTNamespace
return void

visitType() protected method

Generic visit method for classes and interfaces. Both visit methods delegate calls to this method.
protected visitType ( PDepend\Source\AST\AbstractASTClassOrInterface $type ) : void
$type PDepend\Source\AST\AbstractASTClassOrInterface
return void

Property Details

$nodeSet protected_oe property

protected $nodeSet