Ejemplo n.º 1
0
  @Override
  public void visitNode(Tree tree) {
    if (tree.is(Kind.COMPILATION_UNIT)) {
      fileMeasures.setFileComplexity(ComplexityVisitor.complexity(tree));

    } else if (tree.is(CLASS_NODES)) {
      fileMeasures.addClassComplexity(ComplexityVisitor.complexity(tree));

    } else if (tree.is(FUNCTION_NODES)) {
      fileMeasures.addFunctionComplexity(ComplexityVisitor.complexity(tree));
    }
  }
 @Override
 public void visitFunctionExpression(FunctionExpressionTree tree) {
   if (tree.equals(root)) {
     super.visitFunctionExpression(tree);
   }
 }
 @Override
 public void visitMethodDeclaration(MethodDeclarationTree tree) {
   if (tree.equals(root)) {
     super.visitMethodDeclaration(tree);
   }
 }