repowiserepowise
Sign in
grafana/grafana
OverviewDocsArchitectureKnowledge GraphFilesCode HealthSecurityRefactoring

People & History

CommitsContributorsDecisions
Chat
Stats
repowiserepowise
ExplorePricingDocs
Sign in
repowisegrafana/grafana
GR
GR

grafana / grafana

typescriptgomainb010d253.4M linessynced 1mo ago

Code health

7.9out of 10Good

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.

Full health report →
Documentation10,237pages0 with model-written prose, 10,237 built from the indexScore validation12/207.3× baselineTop-ranked files that did go on to need a bug fixDead code1,511exportsUnused exports that nothing in the graph reaches

Do next

5 things worth doing this quarter.

Worth planning

  • Break up slice2Bean (CCN 119, 411 lines)

    pkg/util/xorm/session.go:341

    slice2Bean nests its control flow deeply; 104 files import it.

    gain
    up to +1.8 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 119, 411 lines, nests 12 deep
    severity
    critical
    Medium effort, worth a check
  • Break up buildConds (CCN 70, 190 lines)

    pkg/util/xorm/engine_cond.go:38

    buildConds nests its control flow deeply; 84 files import it.

    gain
    up to +1.8 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 70, 190 lines, nests 8 deep
    severity
    critical
    Medium effort, worth a check
  • 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.

    status
    Accepted, drifting
    Small effort, worth a check
  • 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.

    symbols
    1179
    lines
    16,115
    safe to delete
    Yes(inferred)
    Medium effort
  • 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.

    gain
    up to +1.4 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 26, 99 lines, nests 9 deep
    severity
    critical
    Medium effort, worth a check
Lines of code
3.4M
Files
18,146
Symbols
87,932
Modules
18
Languages
9

Recent activity

All commits →

Commits

  • b010d25bGrafana Datasource: Remove deprecated getDataSourceSrv usage from QueryEditor (#130291)1mo ago
  • ad7771dcDocs: Git Sync - Missing steps for import (#130470)1mo ago
  • 275e6d21Panel options: Document onChange merge semantics for option editors (#129848)1mo ago
  • ced9641eDocs: Add multi-select grouping (#128050)1mo ago
  • e3d72421Dashboard: Allow multiselected elements to be grouped (#127159)1mo ago
  • 248a8196Datasources: Unify the plugin DataSourcePicker with the core picker (#130258)1mo ago

Decisions

  • Unify KV regex acceptance with Grafana API validatorsactive · 1mo ago
  • Add rules search spec, generated types, and index builders (no routes yet)proposed · 1mo ago
  • Add missing expression validations to new rules APIproposed · 1mo ago
  • Upgrade grafana-app-sdk to v0.51.3 with unchanged manifest codegenproposed · 1mo ago
  • Add 'default' alias for default routing treeproposed · 1mo ago
  • Promote notifications API resources to v1beta1proposed · 1mo ago
▸

Everything we found

26,701 open

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.

  • worst item is critical severity. Code health13,721Untested hotspot · pkg/registry/apps/annotation/memory_store.go11 findings · 8.9 deducted→
  • worst item is medium severity. Refactoring1,890FixedRoleRegistrations+1.5 health, S effort · pkg/api/accesscontrol.go→
  • worst item is high severity. Decisions1,239Unify KV regex acceptance with Grafana API validators1 drifting from the code · 37 awaiting review · 1201 hotspots ungoverned→
  • worst item is medium severity. Ownership8,285pkg/extensions/enterprise_imports.go87% single-owner concentration, 54 commits in 90d→
  • worst item is low severity. Dead code1,566emails/grunt/copy.jsUnreachable symbol (0 lines)→

Composition

Open the graph →
typescript 61%go 37%
javascript 1%shell 1%makefile 0%Other 0%

Explore this codebase

  • Docs10,237 pages across 18 modules→
  • ChatAsk this codebase a question and get an answer with its sources.→
  • Files18,146 files with per-file docs, health and history→
  • ArchitectureDependency graph, layers, and 1,190 entry points→
  • Code healthPer-file scores, 20,402 open findings, coverage and refactoring targets→
  • Knowledge graphEntities, communities, and the paths between them→
  • Change couplingFiles that keep changing together, mined from commit history→
  • CommitsChange-risk ranked history with agent provenance→
  • ContributorsBus factor, per-file maintainers, and the human/agent split→
  • StatsSize class, origin, lifetime churn, rhythm and records→
  • CostsWhat indexing this snapshot cost, by model and by run.→