find_hotspots
Identify C/C++ functions that are called from many locations, indicating architectural weight. Use this data to prioritize refactoring, optimization, or testing efforts.
Instructions
Find the most-called C/C++ functions ranked by caller count — libclang call-graph hotspot detection. Identifies functions with the most architectural weight — good targets for refactoring, optimization, or extra testing. Text-based search cannot aggregate caller statistics across the full call graph.
Use for high-level impact assessment: changing a hotspot affects many call sites. The result tells you which functions carry the most "architectural weight" across the entire codebase.
By default, SDK/vendor paths are auto-excluded so hotspots reflect
project code. Use project_only=False to see all results including
vendor code.
For the callers of a specific hotspot, follow up with find_callers
or find_all_callers_recursive.
Read-only. No side effects. Requires the reference index
(fw-context index — refs on by default).
Args:
project_root: Project root. Auto-detected if omitted.
limit: Number of top-called functions to return (default 20).
project_only: When True (default), filters to is_project = 1
symbols so hotspots reflect project code.
exclude_paths: Additional LIKE patterns to exclude (user-supplied
tool parameter). E.g. ['lib/%'].
Returns: list of dicts, each with: name, qualified_name, kind, file, line, caller_count (int — total number of call sites), signature.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of top-called functions to return (default 20). | |
| project_only | No | When True (default), auto-excludes SDK/vendor paths so hotspots reflect project code. | |
| project_root | No | Project root. Auto-detected if omitted. | |
| exclude_paths | No | Additional LIKE patterns to exclude. Merged with defaults. E.g. ['lib/%']. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |