Skip to content

refactor(engine): decompose God Classes (Eval, Exp, Mappings, QueryPlan) and eliminate historical LDScript/KGRAM relics - #651

Merged
remiceres merged 7 commits into
feature/corese-nextfrom
refactor/650-engine-eval-exp-decomposition
Oct 27, 2026
Merged

remiceres merged 7 commits into
feature/corese-nextfrom
refactor/650-engine-eval-exp-decomposition

Conversation

@remiceres

Copy link
Copy Markdown
Contributor

Closes #650

Summary of Changes

  1. God Class Decompositions:

    • Eval.java (-628 lines): Extracted 7 SRP evaluators (EvalMinus, EvalUnion, EvalService, EvalValues, EvalFilter, EvalBind, EvalSubQuery).
    • Exp.java (-379 lines): Extracted ExpPatternScope.java.
    • Mappings.java (-1,005 lines): Extracted MappingsSorter, MappingsDistinctFilter, MappingsRelationalOperations, MappingsAggregator.
    • QueryPlan.java (-543 lines): Extracted QueryClauses.java and QueryExpIndexer.java.
  2. Scaffolding & Dead Code Elimination:

    • Removed Pointerable, PointerObject, Loopable, IterableEntity, PointerType, and Extension.
    • Removed legacy LDScript destructuring protocols (getValue(String, int), getBinding(int), getList()) from Mapping and Memory.
    • Removed 27 unused opcodes in ExprType, unused URIs in ExpType, and unused prefixes in Message.
    • Fixed latent bug in Mapping.project() where unprojected variables were retained in internal maps.
  3. Architecture & Event Streamlining:

    • Relocated Group.java from pattern to solution package.
    • Streamlined ProcessVisitor and ProcessVisitorDefault notification contracts (removed uncalled dead hooks: path, step, slice, produce).
  4. Quality & Validation:

    • 0 SonarLint alerts across the entire module.
    • 100% passing tests in corese-core (4,880+ tests in 27s).

…arLint alerts in core.next

- Extract 7 SRP pattern evaluators from Eval.java into dedicated components:
  EvalMinus, EvalUnion, EvalService, EvalValues, EvalFilter, EvalBind, EvalSubQuery
- Extract variable scoping and pattern traversal from Exp.java into ExpPatternScope.java
- Add unit test suites for all extracted evaluators and scope analyzer
- Fix 172 SonarLint issues across 32 test files in core.next (naming S100/S101, text blocks S6203,
  constants S1170, scope S1450/S3398, escapes S5665, whitespace S2479)
- Zero SonarLint warnings across all 974 files (main + test) in core.next
- Fixes #650
…ter, distinct filter, aggregator, and relational operations
@github-actions

Copy link
Copy Markdown
Overall Project 58.35% -0.37% 🍏
Files changed 77.4% 🍏

File Coverage
ExpType.java 100% 🍏
EvalValues.java 100% 🍏
EvalMinus.java 98.54% -1.46% 🍏
QueryClauses.java 98.28% -1.72% 🍏
EvaluationState.java 96.88% 🍏
Group.java 94.98% 🍏
MappingsSorter.java 93.11% -6.89% 🍏
MappingsDistinctFilter.java 92.05% -7.95% 🍏
EvalVisitorDispatcher.java 91.53% 🍏
EvalSubQuery.java 86.67% -13.33% 🍏
QueryExpIndexer.java 83.86% -16.14% 🍏
NodeImpl.java 82.99% 🍏
EvalUnion.java 80.88% -19.12% 🍏
Eval.java 80.81% -1.68% 🍏
ExpPatternScope.java 80.39% -19.61% 🍏
Mappings.java 80.08% -14.43% 🍏
MappingsAggregator.java 79.97% -20.03% 🍏
ProcessVisitorDefault.java 78.87% 🍏
QueryPlan.java 74.04% -0.58% 🍏
Mapping.java 73.06% 🍏
ProcessVisitor.java 70% -5% ❌
Exp.java 65.65% -1.96% ❌
EvalFilter.java 59.07% -40.93% ❌
MappingsRelationalOperations.java 56.43% -43.57% ❌
Memory.java 56.32% 🍏
EvalService.java 44.89% -55.11% ❌
EvalBind.java 23.06% -76.94% ❌
Node.java 15.38% 🍏
Edge.java 10.2% 🍏
EdgeInv.java 0% 🍏
Path.java 0% 🍏
Message.java 0% -33.33% ❌

@github-actions

Copy link
Copy Markdown

Test Results

  436 files    436 suites   29s ⏱️
3 432 tests 3 432 ✅ 0 💤 0 ❌
3 466 runs  3 466 ✅ 0 💤 0 ❌

Results for commit 11dcb8f.

@remiceres
remiceres merged commit 92fcd52 into feature/corese-next Oct 27, 2026
2 checks passed
@remiceres
remiceres deleted the refactor/650-engine-eval-exp-decomposition branch October 27, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant