[Bug] Per-module, area and graph hotspot counts include test and generated files that the main hotspot count skips

Open
#6,266 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@leo7martins is already working on this.

Since Nov 25, 2026.

  • #6272 by @leo7martins — open

Assessment

This issue has not been assessed yet.

Description

bug help wanted

Summary

Per-module, area, graph and report hotspot counts still count the raw is_hotspot flag. The main counts use count_hotspots with DEFAULT_HELD (#6241), which skips test, generated, vendored and other held origins, so the two disagree.

Mechanism

  • Raw flag: core/analysis/module_health.py:63, core/analysis/areas/rollup.py:140, server/mcp_server/tool_context/sections.py:269, server/routers/graph/community.py:176, graph/full_graph.py:204, core/report/sections/_estate.py:64.
  • Shared scope: server/services/hotspots.py (count_hotspots, shown_hotspot, DEFAULT_HELD).

Repro

rows = [production hotspot, test-origin hotspot, generated-origin hotspot]
_score(ModuleAccumulator(module_path="m", files=rows))["hotspot_count"]

Output on main (6ea4f0a3e): hotspot_count 3. The hotspot list shows 1 for the same rows.

Impact

A module card or graph community reports more hotspots than the list it links to, and test files lower the module health score.

Done looks like

  • Each site counts through the held-origin scope. Core cannot import server, so move the held set to core if a core site needs it.
  • Totals match the list for the same repo.
  • Help wanted: spans core and server.

Tests

One case per site with a test-origin and a generated hotspot; the count equals the list.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.