Class QualityMetricLimits
java.lang.Object
org.ek9lang.compiler.phase5.QualityMetricLimits
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
FieldsModifier and TypeFieldDescription(package private) static final intMaximum cyclomatic-style complexity for any callable construct (method/operator/function).(package private) static final intMaximum 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 intMaximum statements for functions - standalone units can be somewhat larger.(package private) static final intMaximum statements for methods - class methods should have focused responsibility.(package private) static final intMaximum statements for operators - should be single-purpose and brief.(package private) static final intMaximum statements for service operations - web operations, moderate complexity. -
Method Summary
-
Field Details
-
MAX_STATEMENTS_OPERATOR
static final int MAX_STATEMENTS_OPERATORMaximum statements for operators - should be single-purpose and brief.- See Also:
-
MAX_STATEMENTS_METHOD
static final int MAX_STATEMENTS_METHODMaximum statements for methods - class methods should have focused responsibility.- See Also:
-
MAX_STATEMENTS_FUNCTION
static final int MAX_STATEMENTS_FUNCTIONMaximum statements for functions - standalone units can be somewhat larger.- See Also:
-
MAX_STATEMENTS_SERVICE_OPERATION
static final int MAX_STATEMENTS_SERVICE_OPERATIONMaximum statements for service operations - web operations, moderate complexity.- See Also:
-
MAX_COMPLEXITY_CALLABLE
static final int MAX_COMPLEXITY_CALLABLEMaximum cyclomatic-style complexity for any callable construct (method/operator/function).- See Also:
-
MAX_COMPLEXITY_TYPE
static final int MAX_COMPLEXITY_TYPEMaximum 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:
-