Interface MetricLimit
- All Known Implementing Classes:
MetricLimit.CompoundLimit, MetricLimit.GenusLimit, MetricLimit.RatioLimit, MetricLimit.ScalarLimit
public sealed interface MetricLimit
permits MetricLimit.ScalarLimit, MetricLimit.GenusLimit, MetricLimit.CompoundLimit, MetricLimit.RatioLimit
A single enforced quality/architecture metric limit, self-describing enough that BOTH the phase-5
checker that fires the error AND the MCP/IDE enquiry layer that reports headroom can read it from
the one place — see
MetricLimits for the registry and the rationale.
The seven gates are genuinely heterogeneous, so this is a sealed hierarchy rather than one record with a soup of nullable fields:
MetricLimit.ScalarLimit— a single threshold with a comparator (E11016 module coupling, E11040 injection fields, E11042 registrations, E11043 injected-types-per-method).MetricLimit.GenusLimit— a per-SymbolGenusthreshold table with a fallback and a set of genera that are exempt entirely (E11015 construct coupling, E11014 LCOM4 cohesion).MetricLimit.CompoundLimit— a multi-input compound condition guarded by a minimum size (E11017 module cohesion: absolute group cap AND relative disconnection ratio).
Fire-point parity. Each shape exposes an isOver(...) that is the EXACT predicate
the checker uses to fire, and (for the scalar/genus shapes) a usableMax/limitFor
from which the enquiry layer derives its bands — so "over" means "the checker would fire" and
"at-limit" means "one more crosses", structurally, not by a re-implemented guess.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumHow a measured value is compared against the limit.static final recordA compound limit that fires only when an absolute cap AND a relative ratio are BOTH exceeded, and only once the module is at leastminConstructsin size (small modules are naturally disconnected and are exempt).static final recordA per-genus threshold table:byGenusholds explicit limits,fallbackcovers genera not listed, andexemptgenera are not checked at all (soMetricLimit.GenusLimit.limitFor(SymbolGenus)is empty andMetricLimit.GenusLimit.isOver(int, SymbolGenus)is always false for them).static final recordA gate on a fractional score rather than a count — E11020 multiplies a construct's complexity ratio by its statement ratio and fires above 0.50, so neither operand is a limit in its own right and the threshold cannot be an int.static final recordA single-threshold limit with a comparator. -
Method Summary