hotspot

command module
v1.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 13 Imported by: 0

README

Hotspot

GitHub Actions Workflow Status Go Report Card License GitHub Release

Hotspot is a CLI tool that analyzes Git history to diagnose technical debt and bus factor risk based on developer activity, ownership, and churn patterns.

Hotspot

This tool operates as a data-driven development intelligence. While traditional SCA tools focus on code structure and style, and DORA metrics track team performance, Hotspot analyzes actual development behavior - commit patterns, ownership distribution, churn trends, and maintenance activity - to diagnose technical debt and bus factor risk within your code at the file and folder level.

Motivation

For years, I've managed projects where everyone knew which files were the maintenance nightmares—the ones where a small change led to a two-day debugging session. As engineers, we invest heavily in Code Correctness - we run linters, use SCA tools, and write comprehensive unit tests.

However, these traditional QA methods often fail against System Resilience. Outages rarely stem from syntax errors; they're caused by code that's too complex, too fragile, or owned by too few people.

Hotspot was born to fix that: providing a transparent, auditable tool for teams to diagnose the technical debt and knowledge risk that truly drive production instability.

Key features
  • 🔍 See what matters - rank files and folders by activity, complexity, etc.
  • Fast results - analyze thousands of files in seconds
  • 🧮 Rich insights - contributors, churn, size, age, and risk metrics
  • 🎯 Actionable filters - narrow down by path, exclude noise, or track trends over time
  • 📊 Export results - save to CSV/JSON/Parquet to track trends and progress
  • 🔄 CI/CD integration - enforce risk thresholds in pipelines
Target audience
  • 🧑‍💻 Developers tracking sprint or release activity
  • 🧹 Tech leads prioritizing refactors and risk across projects
  • 🧾 Managers monitoring bus factor and maintenance debt

Installation

Requirements
  • Go 1.25+ for building from source
  • Git 2.2.0+ for repository analysis
Install from source
go install github.com/huangsam/hotspot@latest
Download pre-built binary

Visit the latest release and download the tar archive for your system (supports Windows, macOS, and Linux), then extract the binary to your $PATH.

Quick start

# Analyze files for immediate, tactical risk
hotspot files

# Analyze folders for strategic, subsystem risk
hotspot folders

# For an explicit path
hotspot files /path/to/repo/pkg

For detailed usage, configuration options, and common workflows, see USERGUIDE.md.

Live demo

Here's a demo of Hotspot in action:

Hotspot Demo
Real world output

Here is what the tool shows for kubernetes/kubernetes:

Hotspot

This ranking displays the complexity score and a colored label based on:

hotspot files --mode complexity --start 2024-01-01T00:00:00Z --end 2025-01-01T00:00:00Z --workers 16 --follow --exclude 'vendor/,.pb.go'

Performance

All measurements are done using 14 concurrent workers on a Macbook Pro with the M3 Max chip.

Test repositories

The benchmarks use repositories of varying scales to demonstrate performance characteristics:

Repository Language Scale Description
csv-parser C++ Small Focused single-purpose CSV parsing library
fd Rust Medium Actively maintained CLI file search utility
git C Large Complex version control system
kubernetes Go Massive Distributed container orchestration platform
Benchmark results

Comprehensive performance benchmarks using this script. This shows cold vs warm timings:

Repository Files (Cold/Warm) Compare Files (Cold/Warm) Timeseries (Cold/Warm)
csv-parser 0.033s / 0.013s 0.127s / 0.035s 0.117s / 0.044s
fd 0.041s / 0.014s 0.073s / 0.034s 0.119s / 0.052s
git 0.611s / 0.032s 1.318s / 0.138s 2.260s / 0.215s
kubernetes 3.002s / 0.104s 7.207s / 1.525s 10.868s / 0.595s

The data shows that Hotspot caches Git analysis results to speed up repeated runs.

Documentation

Overview

Package main invokes entrypoint logic for hotspot CLI.

Directories

Path Synopsis
Package main provides a comprehensive performance benchmarking tool for the Hotspot CLI.
Package main provides a comprehensive performance benchmarking tool for the Hotspot CLI.
Package core has core logic for analysis, scoring and ranking.
Package core has core logic for analysis, scoring and ranking.
agg
Package agg has aggregation logic for Git activity data.
Package agg has aggregation logic for Git activity data.
algo
Package algo holds numerical logic for rankings and scores.
Package algo holds numerical logic for rankings and scores.
Package internal has helpers that are exclusive to the app runtime.
Package internal has helpers that are exclusive to the app runtime.
contract
Package contract provides interfaces and shared utilities for internal architecture.
Package contract provides interfaces and shared utilities for internal architecture.
iocache
Package iocache is for caching I/O calls.
Package iocache is for caching I/O calls.
outwriter
Package outwriter has output and writer logic.
Package outwriter has output and writer logic.
parquet
Package parquet provides data structures and functions for exporting hotspot analysis data to Parquet files using github.com/parquet-go/parquet-go.
Package parquet provides data structures and functions for exporting hotspot analysis data to Parquet files using github.com/parquet-go/parquet-go.
Package schema has configs, models and global variables for all parts of hotspot.
Package schema has configs, models and global variables for all parts of hotspot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL