Problem
Two small modules are extracted into their own files but don't earn their depth — they just move code around without concentrating complexity.
05c-outcome-distribution.js (32 lines)
- Only caller:
06a-render-outcome-chart.js
- Deletion test: removing it means inlining a 12-line reduce loop into the chart renderer. Complexity disperses slightly but doesn't concentrate anywhere.
05d-calc-stats.js
- Small aggregation function; single primary consumer in
07-render-charts.js
- Deletion test: same result — the caller would inline the aggregation without meaningful added complexity
These modules require a context switch (open a new file, load its definitions) to understand logic that reads naturally inline next to the code that uses it.
Files involved
src/js/05c-outcome-distribution.js
src/js/05d-calc-stats.js
src/js/06a-render-outcome-chart.js
src/js/07-render-charts.js
Proposed solution
Two options:
- Inline — move the logic into the single caller; delete the files
- Document as domain formulas — if the computation is considered stable domain logic worth naming (e.g. "Outcome Distribution" is a concept in
CONTEXT.md), keep the file but add a comment pointing to the domain definition so the context switch has payoff
Benefits
- Fewer files to bounce between when reading the render path
- Outcome distribution logic lives next to the chart that uses it
- Reduces module count without losing any domain knowledge
Note
This is lower priority than the other architecture issues in this batch — it's a tidying opportunity, not a structural problem.
Category
Deepening opportunity — architecture review
Problem
Two small modules are extracted into their own files but don't earn their depth — they just move code around without concentrating complexity.
05c-outcome-distribution.js(32 lines)06a-render-outcome-chart.js05d-calc-stats.js07-render-charts.jsThese modules require a context switch (open a new file, load its definitions) to understand logic that reads naturally inline next to the code that uses it.
Files involved
src/js/05c-outcome-distribution.jssrc/js/05d-calc-stats.jssrc/js/06a-render-outcome-chart.jssrc/js/07-render-charts.jsProposed solution
Two options:
CONTEXT.md), keep the file but add a comment pointing to the domain definition so the context switch has payoffBenefits
Note
This is lower priority than the other architecture issues in this batch — it's a tidying opportunity, not a structural problem.
Category
Deepening opportunity — architecture review