PHP Class PDepend\Metrics\Analyzer\CrapIndexAnalyzer

Inheritance: extends PDepend\Metrics\AbstractAnalyzer, implements PDepend\Metrics\AggregateAnalyzer, implements PDepend\Metrics\AnalyzerNodeAware
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
addAnalyzer ( PDepend\Metrics\Analyzer $analyzer ) : void Adds an analyzer that this analyzer depends on.
analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void Performs the crap index analysis.
getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array(string=>float) Returns the calculated metrics for the given node or an empty array when no metrics exist for the given node.
getRequiredAnalyzers ( ) : array(string) Returns an array with analyzer class names that are required by the crap index analyzers.
isEnabled ( ) : boolean Returns true when this analyzer is enabled.
visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void Visits the given function.
visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void Visits the given method.

Private Methods

Method Description
calculateCoverage ( PDepend\Source\AST\AbstractASTCallable $callable ) : float Calculates the code coverage for the given callable object.
calculateCrapIndex ( PDepend\Source\AST\AbstractASTCallable $callable ) : float Calculates the crap index for the given callable.
createCoverageReport ( ) : PDepend\Util\Coverage\Report Creates a new coverage report instance.
createOrReturnCoverageReport ( ) : PDepend\Util\Coverage\Report Returns a previously created report instance or creates a new report instance.
doAnalyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void Performs the crap index analysis.
visitCallable ( PDepend\Source\AST\AbstractASTCallable $callable ) : void Visits the given callable instance.

Method Details

addAnalyzer() public method

Adds an analyzer that this analyzer depends on.
public addAnalyzer ( PDepend\Metrics\Analyzer $analyzer ) : void
$analyzer PDepend\Metrics\Analyzer
return void

analyze() public method

Performs the crap index analysis.
public analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void
$namespaces PDepend\Source\AST\ASTNamespace[]
return void

getNodeMetrics() public method

Returns the calculated metrics for the given node or an empty array when no metrics exist for the given node.
public getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array(string=>float)
$artifact PDepend\Source\AST\ASTArtifact
return array(string=>float)

getRequiredAnalyzers() public method

Returns an array with analyzer class names that are required by the crap index analyzers.
public getRequiredAnalyzers ( ) : array(string)
return array(string)

isEnabled() public method

Returns true when this analyzer is enabled.
public isEnabled ( ) : boolean
return boolean

visitFunction() public method

Visits the given function.
public visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void
$function PDepend\Source\AST\ASTFunction
return void

visitMethod() public method

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