Each building is one function in a simulated 64-function codebase, laid out on an 8×8 grid ("code city," after Wettel & Lanza's real static-analysis visualization). Per building:
height = lines of code (LOC)
width = cyclomatic complexity (branch count)
color = that function's own Maintainability Index
The Maintainability Index (MI) is the real formula used by Visual Studio / Radon, combining Halstead Volume (a proxy for raw code "surface area"), cyclomatic complexity (CC), and LOC into one 0–100 score:
MI = 171 − 5.2·ln(HV) − 0.23·CC − 16.2·ln(LOC)
(clamped to 0–100; HV ≈ LOC · log2(LOC + 1) here)
An MI above 85 is easy to maintain (green), 65–85 is moderate (amber), and below 65 signals real risk (red) — the same thresholds tools like Visual Studio's Code Metrics use. Duplication and test coverage don't feed the classic MI formula directly, but they compound real-world risk: this sim applies a small extra penalty per function for high duplication and rewards high coverage, since duplicated, untested code is the code that actually breaks in production.
- Sliders — set the codebase-wide averages; every building gets its own metrics sampled around that average, so the skyline is never uniform.
- Extract method — simulates breaking long functions into smaller ones: LOC and complexity drop across the board.
- Remove duplication — halves the duplication metric, the classic "extract shared helper" refactor.
- Add tests — raises coverage, which lowers the effective risk penalty even before other metrics change.