Checkstyle fixes
This commit is contained in:
@ -173,38 +173,6 @@ import net.sourceforge.pmd.lang.java.oom.signature.OperationSignature;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the declaration nodes of all methods or constructors that are declared inside a class.
|
||||
*
|
||||
* @param node The class in which to look for.
|
||||
* @param includeNested Include operations found in nested classes?
|
||||
*
|
||||
* @return The list of all operations declared inside the specified class.
|
||||
*
|
||||
* TODO:cf this one is computed every time
|
||||
*/
|
||||
private static List<ASTMethodOrConstructorDeclaration> findOperations(ASTAnyTypeDeclaration node,
|
||||
boolean includeNested) {
|
||||
|
||||
if (includeNested) {
|
||||
return node.findDescendantsOfType(ASTMethodOrConstructorDeclaration.class);
|
||||
}
|
||||
|
||||
List<ASTClassOrInterfaceBodyDeclaration> outerDecls
|
||||
= node.jjtGetChild(0).findChildrenOfType(ASTClassOrInterfaceBodyDeclaration.class);
|
||||
|
||||
|
||||
List<ASTMethodOrConstructorDeclaration> operations = new ArrayList<>();
|
||||
|
||||
for (ASTClassOrInterfaceBodyDeclaration decl : outerDecls) {
|
||||
if (decl.jjtGetChild(0) instanceof ASTMethodOrConstructorDeclaration) {
|
||||
operations.add((ASTMethodOrConstructorDeclaration) decl.jjtGetChild(0));
|
||||
}
|
||||
}
|
||||
return operations;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Computes the value of a metric for an operation.
|
||||
*
|
||||
|
@ -20,28 +20,28 @@ public enum OperationMetricKey implements MetricKey<ASTMethodOrConstructorDeclar
|
||||
*
|
||||
* @see net.sourceforge.pmd.lang.java.oom.metrics.AtfdMetric
|
||||
*/
|
||||
ATFD(new AtfdClassMetric()),
|
||||
ATFD(new AtfdOperationMetric()),
|
||||
|
||||
/**
|
||||
* Cyclomatic complexity.
|
||||
*
|
||||
* @see net.sourceforge.pmd.lang.java.oom.metrics.CycloMetric
|
||||
*/
|
||||
CYCLO(new CycloClassMetric()),
|
||||
CYCLO(new CycloOperationMetric()),
|
||||
|
||||
/**
|
||||
* Non Commenting Source Statements.
|
||||
*
|
||||
* @see net.sourceforge.pmd.lang.java.oom.metrics.NcssMetric
|
||||
*/
|
||||
NCSS(new NcssClassMetric()),
|
||||
NCSS(new NcssOperationMetric()),
|
||||
|
||||
/**
|
||||
* Lines of Code.
|
||||
*
|
||||
* @see net.sourceforge.pmd.lang.java.oom.metrics.LocMetric
|
||||
*/
|
||||
LOC(new LocClassMetric());
|
||||
LOC(new LocOperationMetric());
|
||||
|
||||
private final OperationMetric calculator;
|
||||
|
||||
|
Reference in New Issue
Block a user