PHP Класс 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.
Наследование: extends PDepend\Metrics\AbstractAnalyzer, implements PDepend\Metrics\AnalyzerNodeAware, implements PDepend\Metrics\AnalyzerFilterAware, implements PDepend\Metrics\AnalyzerProjectAware
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

analyze() публичный метод

Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
public analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void
$namespaces PDepend\Source\AST\ASTNamespace[]
Результат void

getNodeMetrics() публичный метод

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
Результат array(string=>mixed)

getProjectMetrics() публичный метод

array( 'andc' => 0.73, 'ahh' => 0.56 )
public getProjectMetrics ( ) : array(string=>mixed)
Результат array(string=>mixed)

visitClass() публичный метод

Visits a class node.
public visitClass ( PDepend\Source\AST\ASTClass $class ) : void
$class PDepend\Source\AST\ASTClass
Результат void