How the calculator works
About the Dark Code Risk Calculator
The Dark Code Risk Calculator is a free companion tool to the book Dark Code. It estimates how much dark code your engineering organisation merges each month and what that may cost. For the calculator, dark code is any code region that is un-reviewed, untested, undocumented, or lacks clear ownership, regardless of origin.
Your organisation
Team size, monthly new code (lines of code), total codebase size, review thoroughness, industry or compliance tier, defect density and the fully-burdened developer rate.
Your sources of dark code
The share of monthly code that is AI-generated, legacy or undocumented, third-party or vendored, and orphaned with no owner. The model unions them and caps at 100%.
What you get
Monthly dark code, remediation cost, security exposure, downtime risk, total enterprise risk cost, a Dark Code Risk Score from low to critical, a payback period, a 12-month exposure and a reading path in the book.
The formulas
- Dark lines of code: monthly lines of code × dark source mix × (1 − review coverage).
- Remediation: dark lines of code × defect density × hourly rate × compliance multiplier.
- Security and downtime: annual cost × effective dark ratio × attribution × compliance multiplier, then monthly.
- Risk score: cumulative dark code as a share of the entire codebase, so it is naturally lower than the monthly ratio for large codebases.
The model is designed to be conservative and directional, not definitive. Use the result as a governance signal, not a guarantee of outcomes. What to do with it is the subject of the book: what dark code is, and the questions leaders ask about it.
The book
Read the book
Dark Code is the field guide for engineering leaders who will be accountable for systems they did not fully author line by line.