Skip to content
Arxo Arxo

get_hotspots

Identify architectural hotspots — modules with high coupling, high centrality, high churn, or trapped in circular dependencies. These are the modules most in need of refactoring attention.

ParameterTypeRequiredDescription
project_pathstringYesAbsolute or relative path to the project root directory
metric_typestringNoFilter hotspots by metric type (e.g., centrality, scc)

Returns a JSON summary with hotspot findings grouped by metric.

{
"hotspots": [
{
"metric": "string", // Metric ID (e.g., "centrality", "scc")
"title": "string", // Finding title (e.g., "Hub module detected")
"severity": "error|warning|info",
"evidence_count": "number" // Number of modules/evidence items
}
],
"findings_count": "number", // Total number of findings
"violations_count": "number" // Policy violations count
}
SeverityInterpretation
errorCritical issue — blocks architecture quality goals
warningSignificant issue — should be addressed soon
infoMinor issue or informational finding

Request:

{
"project_path": "."
}

Response:

{
"hotspots": [
{
"metric": "centrality",
"title": "Hub module detected",
"severity": "warning",
"evidence_count": 3
},
{
"metric": "scc",
"title": "Circular dependency",
"severity": "error",
"evidence_count": 2
},
{
"metric": "centrality",
"title": "High betweenness centrality",
"severity": "warning",
"evidence_count": 1
}
],
"findings_count": 6,
"violations_count": 1
}

Interpretation:

  • 3 hub modules (high fan-in)
  • 2 circular dependencies (cycles)
  • 1 module with high betweenness (critical junction point)
  • 6 total findings (sum of evidence counts)
  • 1 policy violation triggered

Request:

{
"project_path": ".",
"metric_type": "centrality"
}

Response:

{
"hotspots": [
{
"metric": "centrality",
"title": "Hub module detected",
"severity": "warning",
"evidence_count": 3
},
{
"metric": "centrality",
"title": "High betweenness centrality",
"severity": "warning",
"evidence_count": 1
}
],
"findings_count": 4,
"violations_count": 0
}

Request:

{
"project_path": "/path/to/clean-project"
}

Response:

{
"hotspots": [],
"findings_count": 0,
"violations_count": 0
}

Finding: "Hub module detected"

What it means: A module with high fan-in (many modules depend on it)

Why it matters: Changes ripple widely; testing burden is high; often a bottleneck

How to fix:

  • Split into smaller, focused modules
  • Extract interfaces/facades
  • Apply Dependency Inversion Principle

Finding: "God class detected"

What it means: A module with high fan-out (depends on many modules)

Why it matters: Violates Single Responsibility Principle; difficult to test and maintain

How to fix:

  • Extract responsibilities into separate modules
  • Apply Extract Class refactoring
  • Use dependency injection

Finding: "Circular dependency"

What it means: Modules form import cycles

Why it matters: Prevents modular compilation; amplifies change propagation; hides dependencies

How to fix:

  • Break the cycle by extracting shared interfaces
  • Introduce a mediator/event bus
  • Invert dependencies using abstractions

See Breaking Cycles for detailed guidance.

Finding: "High betweenness centrality"

What it means: Module sits on many shortest dependency paths

Why it matters: Critical junction point — failure affects many modules; single point of failure

How to fix:

  • Introduce redundant paths (alternative implementations)
  • Split module into smaller, independent units
  • Apply facade pattern to reduce coupling

Use this tool to prioritize refactoring efforts:

1. get_hotspots → identify problem areas
2. Sort by severity (errors first, then warnings)
3. For each hotspot:
a. Run analyze_file_impact on affected files
b. Run suggest_refactors for recommendations
c. Implement fixes
d. Re-run get_hotspots to verify improvement

See Workflows: Hotspot detection and refactoring for a full example.

ErrorCauseSolution
missing required parameter: project_pathproject_path not providedInclude project_path in request
No such file or directoryInvalid project pathVerify path exists and is accessible
Unknown metric_type: xyzInvalid filter valueOmit metric_type or use valid metric ID
  • Speed: 1-5 seconds (uses quick preset internally)
  • Caching: Does not use cache (always fresh analysis)
  • Scalability: Efficiently handles 10k+ module projects

Use metric_type to focus on specific concerns:

metric_typeWhat it finds
centralityHub modules, god classes, high betweenness
sccCircular dependencies
smellsArchitectural smells (hubs, god classes, etc.)
propagation_costHigh propagation risk modules

More evidence items means more modules affected. Prioritize hotspots with high evidence counts for maximum impact.

Example: 3 hub modules + 1 high betweenness = systemic coupling issue

Action: Consider a broader architectural refactoring (e.g., layer extraction, microservices split) rather than fixing modules individually.

If hotspots is empty but violations_count > 0, the violations are from metrics not included in the quick preset.

Action: Run analyze_architecture with ci or full preset to see all findings.

Terminal window
# Get hotspots using CLI
arxo analyze --preset quick --format json | jq '[.results[].findings[] | {metric: .id, title: .title, severity: .severity}]'