Skip to main content
A hotspot is a file where complexity and change frequency overlap: complicated code that the team also touches all the time. That intersection is the highest-leverage refactoring target — CodeScene reports that top hotspots typically occupy ~5% of a codebase yet absorb ~18% of development effort and ~23% of fixed defects. Complexity alone over-flags stable legacy code nobody touches; frequency alone flags churning-but-trivial files; the product flags what actually costs money.

What mehen emits

history.hotspot is one of the default mehen diff columns.

Better than the classic form

The open hotspot definition from the literature uses LOC as its complexity proxy because that’s what a history-mining tool can compute without parsing code. mehen has real parsers, so it upgrades the proxy to cognitive complexity summed over the file — a measure of how hard the code actually is to understand, not merely how long it is. The complexity input is family-aware: SQL files use sql.cognitive_complexity and Markdown files use their own cognitive-load measure, so hotspots aren’t degenerate outside the shared source-code suite. Note that CodeScene’s prioritization and ranking layer on top of this signal is proprietary and probabilistic; mehen deliberately implements only the open, reproducible complexity-times-frequency overlap.

How to read it

References

See also