Code audit
Complexity concentration
Enji Guard finds where tangled structure slows changes and shows how to simplify it.
Where is our code most tangled right now?
Connecting to Enji Guard via MCP…
Reading the latest complexity audit…
Worked 4 s · Enji Guard via MCP ›
Score 69/100 — needs attention. 2 findings:
- High riskPayment status drives stock holds and refunds
- High riskDiscount rules span cart, checkout and refunds
Untangle them.
Splitting payment and stock state…
Running checkout and refund tests…
Worked 66 s ›
Done. Both untangled, behavior unchanged:
- Payment, holds and refunds each keep own state
- Refunds use the discount locked at checkout
Existing tests pass. Ready for your review.
What the audit checks
Six areas, from complexity hotspots to component boundaries.
Complexity hotspots
Where tightly connected logic is concentrated and when it is justified.
Decisions and modes
Which combinations of branches, flags and modes widen a change.
State and lifecycle
Where shared state, async work or recovery ties different flows together.
Coordination and dependencies
Do interfaces contain coordination rules or pass them on to callers?
Scope of a change
What else needs changing or retesting when an existing feature changes.
Component boundaries
Whether boundaries let parts evolve without adding coordination.
From shared state to recovery
What a report can find at each step
Shared state
What different features read and write in the same state.
Async work
Which parts depend on the order in which async work finishes.
Transitions
Which state changes are allowed and what determines their order.
Retries
Where retry rules depend on progress in other flows.
Recovery
How work resumes after an interruption.
What's in the report
- A 0–100 score
- Complexity hotspots and the features they affect
- Scope — what was checked and what wasn't
What the audit is not
- Does not flag file size on its own
- Does not flag missing tooling as a defect
- Does not access production systems
Connect a repository
GitHub or GitLab. The audit doesn't change your code.
Enji Guard