Skip to main content

Module dashboard

Module dashboard 

Expand description

Dashboard-specific analyses: the parameterised SQL queries that feed the single-file SPA dashboard’s widgets.

These mirror the per-analysis modules elsewhere in analyses/ — each is a parameterised SQL query over the already-ingested fact store that returns a row struct. They live here rather than in the output layer because a query failure is an analysis failure (exit code 4), not an output/I/O failure. The row structs they return are serialised into the SPA JSON payload by output::spa.

Structs§

CloneSummary
Per-file clone overlay row: how many distinct clone groups touch the path. Surfaced as a colour-mode toggle on the hotspot circle-pack so users can see structural-duplication hotspots overlaid on the same file layout they already know from the cognitive / author / AI modes.
DailyCommit
One day’s commit count for the calendar heatmap.
ImportEdgeRow
One resolved import edge for the architecture force-graph widget.
KameiRiskRow
Per-commit Kamei JIT-SDP feature row for the Delivery Risk Sparkline widget. Drops the merge-commit subset (their Kamei vectors are 0 by design — see gix_repo.rs::changed_files_for_commit) and the date-null fringe.
TrendPoint
One (month, path, score) point in the trends multi-line.
XRayEntry
One function in the X-Ray sunburst.

Functions§

run_clone_summary
Per-file clone-group counts from the clones table. Empty result when no clone groups exist (small repo, no Tier-1 sources, or min_clone_node_count filtered everything out at ingest time). One row per path that appears in ≥ 1 clone family — files with zero clone groups are dropped so the payload stays compact.
run_daily_commits
Per-day commit counts for the calendar heatmap (W10). Returns one row per day with at least one commit, sorted by date ascending.
run_imports_for_arch_graph
Pull every resolved import edge from the imports table. Only resolved edges (where target_path is non-NULL) participate so the SPA graph reflects the dependency surface CodeLore can actually visualise.
run_kamei_risk
Pull the last-N non-merge commits with their Kamei JIT-SDP feature vector for the Delivery Risk Sparkline widget. Returns rows in chronological order (oldest → newest) so the widget can render left-to-right as a calendar-time bar series.
run_trends
Build a per-(month, path) trend series restricted to paths for the trends multi-line widget (W9). The score per (month, path) is the count of revisions that touched the path during the month. Empty paths returns an empty Vec — the widget renders nothing.
run_xray
Aggregate function-level cognitive complexity per (path, function) from the complexity_metrics table for the X-Ray sunburst (W8). Returns at most limit rows ordered by cognitive DESC, since the sunburst becomes unreadable past a few hundred functions and the JSON payload would blow up on monorepos otherwise.