PHP Class PDepend\Metrics\Analyzer\InheritanceAnalyzer

ANDC - Average Number of Derived Classes: The average number of direct subclasses of a class. This metric only covers classes in the analyzed system, no library or environment classes are covered. AHH - Average Hierarchy Height: The computed average of all inheritance trees within the analyzed system, external classes or interfaces are ignored.
Inheritance: extends PDepend\Metrics\AbstractAnalyzer, implements PDepend\Metrics\AnalyzerNodeAware, implements PDepend\Metrics\AnalyzerFilterAware, implements PDepend\Metrics\AnalyzerProjectAware
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Methods

Method Description
analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array(string=>mixed) This method will return an array with all generated metric values for the given $node. If there are no metrics for the requested node, this method will return an empty array.
getProjectMetrics ( ) : array(string=>mixed) Provides the project summary as an array.
visitClass ( PDepend\Source\AST\ASTClass $class ) : void Visits a class node.

Private Methods

Method Description
calculateDepthOfInheritanceTree ( PDepend\Source\AST\ASTClass $class ) : void Calculates the maximum HIT for the given class.
calculateNumberOfAddedAndOverwrittenMethods ( PDepend\Source\AST\ASTClass $class ) : void Calculates two metrics. The number of added methods and the number of overwritten methods.
calculateNumberOfDerivedClasses ( PDepend\Source\AST\ASTClass $class ) : void Calculates the number of derived classes.
doAnalyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void Calculates several inheritance related metrics for the given source namespaces.
initNodeMetricsForClass ( PDepend\Source\AST\ASTClass $class ) : void Initializes a empty metric container for the given class node.

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

getNodeMetrics() public method

This method will return an array with all generated metric values for the given $node. If there are no metrics for the requested node, this method will return an empty array.
public getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array(string=>mixed)
$artifact PDepend\Source\AST\ASTArtifact
return array(string=>mixed)

getProjectMetrics() public method

array( 'andc' => 0.73, 'ahh' => 0.56 )
public getProjectMetrics ( ) : array(string=>mixed)
return array(string=>mixed)

visitClass() public method

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