How we measure
Every number on the map comes from a formula you can read. Here they are, drawn.
From repository to city
Four steps, all of them on your machine.
- RepositoryA local folder or a clone.
- ReadFolders, lines, branches, git history, imports.
- Scan locallyTrivy · gitleaks · debt rules.
- City + reportBuildings, districts, findings, a grade.
In the local version, nothing but the chat leaves your machine.
Anatomy of a building
One folder with code in it. Nine things about it are readable at a glance.
- 1Red mast — hotspot
- 2Height = complexity:
1.5 + 1.1 × √complexity - 3Steps appear above 11 and 19 units tall
- 4Facade colour = the active lens
- 5Width =
√files - 6● vulnerabilities and misconfigurations, coloured by the worst one
- 7◆ possible secrets — the value is never shown
- 8Rooftop = district colour
- 9Heartbeat = it has a critical
What “complexity” counts
Decision points per file, summed per folder. A fast heuristic, not full cyclomatic complexity.
export function settle(orders, rates) { let total = 0; (const order of orders) { (!order.paid order.voided) continue; const rate = rates[order.currency]; (order.items.length rate) { const item = order.items.pop(); switch (item.kind) { 'refund': total -= price(item, rate); break; 'fee': total += fee(item, rate); break; } try { audit(item); } (e) { report(e); } } } return total;}
8decision points in this file
The folder adds up all of its files
- settle.js8
- invoice.js14
- tax.js5
billing/27
Building height7.21.5 + 1.1 × √27
Click a decision point to remove it, as if you had simplified the code, and watch the tower come down.
switch and try are not counted — only if for while case catch && ||.
Where findings come from
Three instruments. Two are standard tools; the third is a handful of rules with no tool behind it.
-
Trivy
ReadsLockfiles and manifests (npm, yarn, pnpm, pip, poetry, go.mod, Cargo, pom, gradle), built jars for Java, and Dockerfile, compose, Kubernetes and Terraform.
EmitsVulnerabilities and misconfigurations. Severity is Trivy’s.
-
gitleaks
ReadsThe working tree, with the default rule set.
EmitsPossible secrets, all counted as High today: they are not yet sorted into likely and doubtful, and that inflates risk. Only the rule and
file:lineare kept. -
Debt rules
ReadsEvery source file, plus commit counts from git.
EmitsTODO/FIXME/HACK/XXX = Low · over 500 lines = Medium · more than 0.25 branches per line in files over 50 lines = Medium · hotspot (commits × complexity in the top 5% of the repo) = High.
-
SARIF reports
ReadsThe
.sariffiles you drop into.codemap/: Snyk, Semgrep, CodeQL, ESLint, Checkov and any tool that exports SARIF 2.1.0.EmitsWith a
security-severity: a vulnerability (≥ 9 Critical, ≥ 7 High, ≥ 4 Medium). Without one: debt, Medium forerrorand Low otherwise. Whatever the tool suppressed stays out.
Four severities
- Critical
- High
- Medium
- Low
Hotspots
Every dot is a real folder of expressjs/express: to the right, how much it changed over the last 12 months; upwards, how much logic it holds. The 5 % with the largest product of the two gets a red mast.
- One folder (one building). Hover to see which.
- Hotspot: a red mast on the map and a High debt finding.
- Frontier: constant commits × complexity. The axes are logarithmic, which is why it is a straight line.
Risk of one building
The weights
Every finding standing on the building adds its weight. That sum is the risk.
- Critical10
- Hotspot6
- High5
- Medium2
- Low1
- Each debt finding0.2
From risk to colour
Logarithmic, so one critical already shows and a hundred do not saturate.
The grade, live
These sliders feed the product’s own scoring function — the same module the dashboard imports. Move them.
Inspection report
Score: 47 / 100 · Grade: D
47out of 100
Where the points go
- Start100
- Security −50.0cap 50
- Secrets −0.8cap 20
- Debt −1.9cap 30
The scale
A ≥ 90 · B ≥ 75 · C ≥ 60 · D ≥ 40 · E below.
The four lenses
The same city, four values, one ramp. Each lens normalises to 0–1 and paints the facades.
-
Risk
Decide what to fix first.
no findingscriticallog(1 + risk) / log(81)Logarithmic: one critical already shows, a hundred do not saturate. -
Debt
Plan refactors and see which district is rotting.
0 h16 h or morehours / 1616 hours is two working days: from there on, full red. -
Pulse
Tell living code from sleeping code. Asleep and risky is the worst combination.
a year agotoday1 − days / 365Touched today = 1; untouched for a year = 0. -
Traffic
Find the corridors the whole team walks down.
0 commitsthe busiestcommits / max(commits)Relative to the busiest building in the repository.
The same eight buildings, painted by each lens.
Ground heatEvery building radiates its value onto the ground. The district plate is tinted by mean × 1.3 and peak × 0.5.
Districts and links
How a path becomes a district
-
1
srcmainjavacomacmebillingservice
Filler folders are dropped:
src main java kotlin lib test. - 2 comacmebillingservice A district holding more than half of the buildings is split one level deeper.
- 3 billing District.
Links
External packages are ignored: only imports that resolve inside the repository become links.
Honest limits
- The grade is a heuristic to compare and prioritise, not a standard.
- Complexity is a token count, not real cyclomatic complexity.
- Secret scanners flag examples in docs and tests.
- Without a lockfile or built artifacts there are no dependency findings.
- On your machine there is no plan limit; there is a technical cap of 10k files per repository, adjustable. In Cloud the size depends on the plan.
- Pulse and Traffic look at the last 12 months of git. A clone without history leaves them empty, and the map says so.
- The grade thresholds are not calibrated against a corpus of repositories: they compare two versions of the same code well, not two companies.