Code health
This codebase scores 7.9 out of 10 for code health, which we rate good. It also scores maintainability 8.7 and static performance 9.9 out of 10. The three are scored separately and never blended into one number. Risk is concentrated, as it usually is: 1,202 of 18,146 files are git hotspots, and they average 5.3 — which is where the fixes pay off most.
5 things worth doing this quarter.
Break up slice2Bean (CCN 119, 411 lines)
pkg/util/xorm/session.go:341
slice2Bean nests its control flow deeply; 104 files import it.
Break up buildConds (CCN 70, 190 lines)
pkg/util/xorm/engine_cond.go:38
buildConds nests its control flow deeply; 84 files import it.
Update the decision “Unify KV regex acceptance with Grafana API validators”: the code it governs has moved on
Agents and reviewers still follow it, so they are steered by a rule the code no longer keeps.
Delete 1,179 unused symbols and files (16,115 lines)
Nothing in the graph reaches them, across 460 files; every reader and agent pays to skip them.
Break up fieldValueColors (CCN 26, 99 lines)
public/app/plugins/panel/xychart/scatter.ts:599
fieldValueColors nests its control flow deeply; 6 files import it, changed 2 times in 90 days.
Every detector's open count by area, each with its worst example. An inventory, not a to-do list: the actions above are the part worth doing.