Class AcceptableCombinedComplexitySizeOrError

java.lang.Object
org.ek9lang.compiler.phase5.AcceptableCombinedComplexitySizeOrError
All Implemented Interfaces:
Consumer<org.antlr.v4.runtime.tree.ParseTree>

class AcceptableCombinedComplexitySizeOrError extends Object implements Consumer<org.antlr.v4.runtime.tree.ParseTree>
Checks the combined complexity and statement count at function/method/operator exit. This catches the "both moderately high" scenario where individual metrics pass their limits but the combination represents a maintainability risk.

Research basis: NASA Software Assurance Technology Center studies found that modules with both high complexity AND large size have the lowest reliability. Individual limits miss this critical combination.

Formula: combined = (complexity/maxComplexity) × (statements/maxStatements) If combined exceeds 0.50, an error is emitted.

  • Constructor Details

    • AcceptableCombinedComplexitySizeOrError

      AcceptableCombinedComplexitySizeOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
  • Method Details

    • accept

      public void accept(org.antlr.v4.runtime.tree.ParseTree node)
      Specified by:
      accept in interface Consumer<org.antlr.v4.runtime.tree.ParseTree>