Class BooleanExpressionComplexityCheck.Context

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

Represents context (method/expression) in which we check complexity.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    Should we perform check in current context or not.
    private int
    Count of boolean operators.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Context(boolean checking)
    Creates new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks if we violate maximum allowed complexity.
    boolean
    Getter for checking property.
    void
    Increases operator counter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      private 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 violate maximum allowed complexity.
      Parameters:
      ast - a node we check now.