コード例 #1
0
 @Override
 public void visitForOfStatement(ForOfStatementTree tree) {
   nestedLevel++;
   checkNestedLevel(tree);
   super.visitForOfStatement(tree);
   nestedLevel--;
 }
コード例 #2
0
  @Override
  public void visitAssignmentExpression(AssignmentExpressionTree tree) {
    if (tree.is(Kind.ASSIGNMENT) && isUndefined(tree.expression())) {
      reportIssue(tree);
    }

    super.visitAssignmentExpression(tree);
  }
コード例 #3
0
  @Override
  public void visitInitializedBindingElement(InitializedBindingElementTree tree) {
    if (isUndefined(tree.right())) {
      reportIssue(tree);
    }

    super.visitInitializedBindingElement(tree);
  }
コード例 #4
0
  @Override
  public void visitAssignmentExpression(AssignmentExpressionTree tree) {
    if (inUpdate) {
      addCurrentLoopCounter(tree.variable());
    }

    super.visitAssignmentExpression(tree);
  }
コード例 #5
0
  @Override
  public void visitUnaryExpression(UnaryExpressionTree tree) {
    if (inUpdate && tree.is(INC_DEC_OPERATIONS)) {
      addCurrentLoopCounter(tree.expression());
    }

    super.visitUnaryExpression(tree);
  }
コード例 #6
0
 @Override
 public void scanFile(TreeVisitorContext context) {
   super.scanFile(context);
   nestedLevel = 0;
 }