Class BooleanExpressionComplexityCheck.Context

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.Context
Enclosing class:
BooleanExpressionComplexityCheck

private class BooleanExpressionComplexityCheck.Context extends Object
Represents context (method/expression) in which we check complexity.
  • Field Details

    • checking

      private final boolean checking
      Should we perform check in current context or not. Usually false if we are inside equals() method.
    • count

      private int count
      Count of boolean operators.
  • Constructor Details

    • Context

      Context(boolean checking)
      Creates new instance.
      Parameters:
      checking - should we check in current context or not.
  • Method Details

    • isChecking

      public boolean isChecking()
      Getter for checking property.
      Returns:
      should we check in current context or not.
    • visitBooleanOperator

      public void visitBooleanOperator()
      Increases operator counter.
    • checkCount

      public void checkCount(DetailAST ast)
      Checks if we violates maximum allowed complexity.
      Parameters:
      ast - a node we check now.