Introducing Hotspots: Find Risky Functions and Stop Regressions

Launch: Hotspots surfaces risky functions by combining complexity and change, explains drivers, and blocks regressions in CI.

Stephen Collins ·
editorial hotspots complexity tech-debt ci

Today, I’m launching Hotspots — a lightweight way to surface the tiny set of functions that dominate your risk and to keep them from getting worse.

What’s shipping

  • Snapshot analysis: rank functions into risk bands and generate an optional HTML report for sharing.
  • Explain mode: driver labels that clarify why a function is risky and where to focus a refactor.
  • CI guardrails: delta checks and policies that block risky regressions before they merge.
  • Simple CLI: no build step required; point it at your repo and go.

Why I built it

Refactors often start with “this looks messy,” then balloon without moving the needle. Incidents, on the other hand, keep recurring in the same few places — complex code that also changes often. I built Hotspots to make those places obvious, actionable, and protected by policy.

How it fits your day

  • Local triage: run a snapshot, scan the ranked list, and pick the top 2–3 items.
  • PR safety net: run delta mode in CI so complexity spikes fail early.
  • Shareable context: attach an HTML report to planning docs or retros.

Quick start

hotspots analyze src/
hotspots analyze src/ --mode snapshot --format html --output .hotspots/report.html
hotspots analyze src/ --mode delta --policy

What you’ll see

  • A prioritized list of functions with risk bands and clear driver labels
  • Concise actions (e.g., “Reduce branching; extract sub‑functions”) to guide refactors
  • Policy results for PRs with pass/warn/fail signals

Roadmap (next few iterations)

  • Richer policy presets and easier tuning per repo
  • Better suppression/waiver workflow with reasons and expiry
  • Trend views to track counts of critical/high functions over time

Docs and examples live at https://docs.hotspots.dev. Source at https://github.com/Stephen-Collins-tech/hotspots.

Refactor what matters — and keep it that way.