public abstract class AbstractMetric extends Object implements Metric
Metric.Version
Constructor and Description |
---|
AbstractMetric() |
Modifier and Type | Method and Description |
---|---|
protected static double |
averageMetricOverOperations(ASTClassOrInterfaceDeclaration node,
OperationMetricKey key,
MetricVersion version,
boolean includeNested)
Gets the average of the value of an operation metric over all operations in this class (excluding nested
classes).
|
protected List<QualifiedName> |
findAllCalls(ASTMethodOrConstructorDeclaration node) |
static List<ASTMethodOrConstructorDeclaration> |
findOperations(ASTClassOrInterfaceDeclaration node,
boolean includeNested)
Finds the declaration nodes of all methods or constructors that are declared inside a class.
|
protected static PackageStats |
getTopLevelPackageStats()
Gives access to the toplevel package stats to metrics without having to pass them as a parameter to metrics.
|
protected static double |
highestMetricOverOperations(ASTClassOrInterfaceDeclaration node,
OperationMetricKey key,
MetricVersion version,
boolean includeNested)
Gets the highest value of an operation metric over all operations in this class (excluding nested classes).
|
protected static double |
sumMetricOverOperations(ASTClassOrInterfaceDeclaration node,
OperationMetricKey key,
MetricVersion version,
boolean includeNested)
Gets the sum of the value of an operation metric over all operations in this class (excluding nested classes).
|
boolean |
supports(AccessNode node)
Default implementation of the supports method, which filters out abstract nodes.
|
protected static PackageStats getTopLevelPackageStats()
Metrics
.protected static double sumMetricOverOperations(ASTClassOrInterfaceDeclaration node, OperationMetricKey key, MetricVersion version, boolean includeNested)
node
- The class node.key
- The operation metric to use.version
- Version of the metric.includeNested
- Adds the operations of nested classes to the sum.protected static double averageMetricOverOperations(ASTClassOrInterfaceDeclaration node, OperationMetricKey key, MetricVersion version, boolean includeNested)
node
- The class node.key
- The operation metric to use.version
- Version of the metric.includeNested
- Adds the operations of nested classes to the sum.protected static double highestMetricOverOperations(ASTClassOrInterfaceDeclaration node, OperationMetricKey key, MetricVersion version, boolean includeNested)
node
- The class node.key
- The operation metric to use.version
- Version of the metric.includeNested
- Adds the operations of nested classes to the sum.public static List<ASTMethodOrConstructorDeclaration> findOperations(ASTClassOrInterfaceDeclaration node, boolean includeNested)
node
- The class in which to look for.includeNested
- Include operations found in nested classes?protected List<QualifiedName> findAllCalls(ASTMethodOrConstructorDeclaration node)
public boolean supports(AccessNode node)
Copyright © 2002–2017 PMD. All rights reserved.