PHP Class PDepend\Metrics\Analyzer\NodeLocAnalyzer
It collects the total Lines Of Code(
loc), the None Comment Lines Of
Code(
ncloc), the Comment Lines Of Code(
cloc) and a approximated
Executable Lines Of Code(
eloc) for files, classes, interfaces,
methods, properties and function.
The current implementation has a limitation, that affects inline comments.
The following code will suppress one line of code.
function foo() {
foobar(); // Bad behaviour...
}
The same rule applies to class methods. mapi,
PLEASE, FIX THIS ISSUE.
Afficher le fichier
Open project: horde/horde
Class Usage Examples
Méthodes publiques
Méthode |
Description |
|
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 given $node instance. If there are no metrics for the
requested node, this method will return an empty array. |
|
getProjectMetrics ( ) : array |
Provides the project summary as an array. |
|
visitClass ( PDepend\Source\AST\ASTClass $class ) : void |
Visits a class node. |
|
visitCompilationUnit ( ASTCompilationUnit $compilationUnit ) : void |
Visits a file node. |
|
visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void |
Visits a function node. |
|
visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void |
Visits a code interface object. |
|
visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void |
Visits a method node. |
|
Private Methods
Méthode |
Description |
|
linesOfCode ( array $tokens, boolean $search = false ) : array |
Counts the Comment Lines Of Code (CLOC) and a pseudo Executable Lines Of
Code (ELOC) values. |
|
updateProjectMetrics ( string $id ) : void |
Updates the project metrics based on the node metrics identifier by the
given $id. |
|
Method Details
Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
public analyze ( PDepend\Source\AST\ASTNamespace[] $namespaces ) : void |
$namespaces |
PDepend\Source\AST\ASTNamespace[] |
|
Résultat |
void |
|
getNodeMetrics()
public méthode
array(
'loc' => 23,
'cloc' => 17,
'eloc' => 17,
'ncloc' => 42
)
public getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array |
$artifact |
PDepend\Source\AST\ASTArtifact |
|
Résultat |
array |
|
getProjectMetrics()
public méthode
array(
'loc' => 23,
'cloc' => 17,
'ncloc' => 42
)
visitClass()
public méthode
public visitClass ( PDepend\Source\AST\ASTClass $class ) : void |
$class |
PDepend\Source\AST\ASTClass |
|
Résultat |
void |
|
visitCompilationUnit()
public méthode
public visitCompilationUnit ( ASTCompilationUnit $compilationUnit ) : void |
$compilationUnit |
PDepend\Source\AST\ASTCompilationUnit |
|
Résultat |
void |
|
visitFunction()
public méthode
public visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void |
$function |
PDepend\Source\AST\ASTFunction |
|
Résultat |
void |
|
visitInterface()
public méthode
Visits a code interface object.
public visitInterface ( PDepend\Source\AST\ASTInterface $interface ) : void |
$interface |
PDepend\Source\AST\ASTInterface |
|
Résultat |
void |
|
visitMethod()
public méthode
public visitMethod ( PDepend\Source\AST\ASTMethod $method ) : void |
$method |
PDepend\Source\AST\ASTMethod |
|
Résultat |
void |
|