Audits
How the complexity concentration audit works
See how Enji Guard traces concentrated complexity to concrete change and maintenance costs.
Audit page Complexity concentration auditWhat this audit answers
Where does concentrated complexity make an ordinary product change harder to implement or verify? The audit looks for places where decisions, state, or coordination tie capabilities together. It also identifies concentrations that serve a coherent purpose and are already contained by a narrow interface.
What Enji Guard inspects
Enji Guard maps candidate hotspots across owned files and subsystems. File size and approximate complexity measurements guide selection. Source inspection follows branches, flags, shared mutable state, asynchronous transitions, and dependencies through relevant callers and tests.
The audit traces a realistic change to a supported capability and identifies the other rules, modes, and checks it would touch. For a proposed simplification, it considers what could change independently, which coordination would disappear, and which invariants must still hold together.
Diagnostic criteria
The report rates applicable criteria from 0 to 5. An inapplicable criterion or one with insufficient evidence has an explanation in place of a rating.
- Concentration. Check whether dense logic is contained and justified by its role in the product.
- Decisions and modes. Trace combinations of branches, flags, and implicit ordering.
- State and lifecycle. Follow shared state, transitions, asynchronous effects, and recovery.
- Orchestration and dependencies. Check how much a component must know about other rules, collaborators, or protocols.
- Independent change. Trace how far an ordinary capability change and its verification reach.
- Boundaries. Check whether boundaries contain complexity and keep shared invariants coherent.
How evidence becomes findings
A finding links the interacting decisions or state to a concrete change scenario and explains the resulting coordination or revalidation cost. The structured report includes a summary, source-backed findings, diagnostic criteria, recommendations, scope limits, and a score when supported. It records material concentrations and why they matter, including reasons for retaining coherent complexity. Recommendations explain the smallest useful simplification and which behavior to preserve.
Low covers a small local burden. Medium covers a material module-level or bounded subsystem burden on an important capability. High requires substantial coupling of multiple important capabilities, with broad coordination or revalidation for ordinary changes. Critical requires independent evidence of exceptional systemic harm to essential capabilities, invariants, or the ability to maintain them safely. A current change burden can be established from code before an incident occurs. Optional opportunities without a demonstrated material burden can appear as Info.
How the score works
Enji Guard calculates scores the same way across audits. The calculation starts at 100 and deducts 25 points per Critical finding, 14 per High, 7 per Medium, and 3 per Low. Info findings deduct zero. The calculation counts each independent root cause once when the evidence supports medium or high confidence. One Critical or at least two High findings cap the result at 69. The final score stays within 0–100. Diagnostic criterion ratings do not enter the calculation.
Limitations and boundaries
The audit is read-only. File size and complexity counts guide investigation and carry no severity by themselves. Separate simple operations can produce a high total, and necessary atomic work may belong together. Coverage limits are stated for material paths. A result based on an older audit focused on separation of concerns may have a different scope, which limits score comparisons.
Review and rerun
Use the change scenario in a finding to check which coordination a proposed simplification removes and which invariants it preserves. After a change, rerun against the new commit and compare evidence for that same capability before interpreting the score difference.
Enji Guard