Class QualityMetricLimits

java.lang.Object
org.ek9lang.compiler.phase5.QualityMetricLimits

final class QualityMetricLimits extends Object
Central home for the code-quality metric limits that are SHARED across more than one check in this phase. Single-owner thresholds (cognitive complexity, nesting depth, expression complexity, the coupling/cohesion/inheritance-depth genus tables) deliberately stay co-located with the one check that owns them - only the cross-referenced limits live here, so they are referenced rather than copied.

The statement budgets are enforced by AcceptableStatementCountOrError and re-used by AcceptableCombinedComplexitySizeOrError to normalise its size ratio. The callable complexity ceiling is enforced by AcceptableConstructComplexityOrError and re-used by AcceptableCombinedComplexitySizeOrError to normalise its complexity ratio - the two MUST stay equal for the combined ratio to be meaningful, which is exactly why the value lives in one place here.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final int
    Maximum cyclomatic-style complexity for any callable construct (method/operator/function).
    (package private) static final int
    Maximum aggregated complexity for a type/template-type (sum of its members' complexity) - large so that only a class accumulating a very large number of (even moderately complex) methods trips it, forcing the developer to break the type up.
    (package private) static final int
    Maximum statements for functions - standalone units can be somewhat larger.
    (package private) static final int
    Maximum statements for methods - class methods should have focused responsibility.
    (package private) static final int
    Maximum statements for operators - should be single-purpose and brief.
    (package private) static final int
    Maximum statements for service operations - web operations, moderate complexity.
  • Method Summary

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_STATEMENTS_OPERATOR

      static final int MAX_STATEMENTS_OPERATOR
      Maximum statements for operators - should be single-purpose and brief.
      See Also:
    • MAX_STATEMENTS_METHOD

      static final int MAX_STATEMENTS_METHOD
      Maximum statements for methods - class methods should have focused responsibility.
      See Also:
    • MAX_STATEMENTS_FUNCTION

      static final int MAX_STATEMENTS_FUNCTION
      Maximum statements for functions - standalone units can be somewhat larger.
      See Also:
    • MAX_STATEMENTS_SERVICE_OPERATION

      static final int MAX_STATEMENTS_SERVICE_OPERATION
      Maximum statements for service operations - web operations, moderate complexity.
      See Also:
    • MAX_COMPLEXITY_CALLABLE

      static final int MAX_COMPLEXITY_CALLABLE
      Maximum cyclomatic-style complexity for any callable construct (method/operator/function).
      See Also:
    • MAX_COMPLEXITY_TYPE

      static final int MAX_COMPLEXITY_TYPE
      Maximum aggregated complexity for a type/template-type (sum of its members' complexity) - large so that only a class accumulating a very large number of (even moderately complex) methods trips it, forcing the developer to break the type up.
      See Also: