Skip to content
Arxo Arxo

analyze_file_impact

Analyze the impact (blast radius) of changing one or more files in your codebase. This tool helps you understand how many other modules depend on the files you’re about to modify, either directly or transitively.

ParameterTypeRequiredDescription
project_pathstringYesAbsolute or relative path to the project root directory
file_pathsarray of stringsYesList of file paths to analyze (relative to project root)

Returns a JSON summary with metrics computed in the context of the changed files.

{
"results": [
{
"id": "string",
"values": {
"key": "value"
}
}
],
"violations": [],
"changed_files_context": ["string"] // Echo of input file_paths
}

The tool uses the quick preset internally, which includes:

  • SCC (cycles) — If changed files are inside a cycle, the blast radius is amplified
  • Centrality — High betweenness centrality means changes will ripple widely
  • L1 Overview — Risk categorization of changed files

Request:

{
"project_path": ".",
"file_paths": ["src/core/auth.ts"]
}

Response:

{
"results": [
{
"id": "scc",
"data": [
{ "key": "scc.max_cycle_size", "value": { "kind": "number", "v": 0 } }
]
},
{
"id": "centrality",
"data": [
{ "key": "centrality.module.betweenness_max", "value": { "kind": "number", "v": 0.42 } },
{ "key": "centrality.module.max_fan_in", "value": { "kind": "number", "v": 18 } },
{ "key": "centrality.module.max_fan_out", "value": { "kind": "number", "v": 3 } }
]
}
],
"violations": [],
"changed_files_context": ["src/core/auth.ts"]
}

Interpretation:

  • auth.ts has high betweenness (0.42) — it’s a critical dependency
  • 18 modules depend on it (fan-in)
  • It depends on only 3 modules (fan-out)
  • Not in a cycle (max_cycle_size = 0)
  • Risk: High — changes will ripple to 18+ modules

Request:

{
"project_path": "/path/to/project",
"file_paths": ["src/core/auth.ts", "src/core/session.ts", "src/utils/crypto.ts"]
}

Response:

{
"results": [
{
"id": "scc",
"data": [
{ "key": "scc.cycle_count", "value": { "kind": "number", "v": 1 } },
{ "key": "scc.max_cycle_size", "value": { "kind": "number", "v": 3 } }
]
},
{
"id": "centrality",
"values": {
"centrality.module.betweenness_max": 0.58
}
}
],
"violations": [],
"changed_files_context": [
"src/core/auth.ts",
"src/core/session.ts",
"src/utils/crypto.ts"
]
}

Interpretation:

  • These 3 files form a circular dependency (max_cycle_size = 3)
  • Extremely high betweenness (0.58) — critical hub
  • Risk: Very high — break the cycle before refactoring

Use this tool before making changes to understand impact:

1. analyze_file_impact → assess blast radius
2. If centrality is high:
a. get_hotspots → find other tightly coupled modules
b. suggest_refactors → get decoupling recommendations
3. If cycles exist:
a. Follow cycle-breaking workflow (see check_cycles)

See Workflows: Impact analysis before a refactor for a full example.

ErrorCauseSolution
missing required parameter: file_pathsfile_paths not providedInclude file_paths array in request
file_paths must be a non-empty arrayEmpty array providedInclude at least one file path
No such file or directoryInvalid project or file pathVerify paths exist and are relative to project root
  • Speed: 1-5 seconds (uses quick preset)
  • Caching: Does not use cache (always fresh analysis for changed files)
  • Scalability: Efficiently handles 10+ files in a single request
  • Before refactoring core modules
  • Before renaming widely-used functions/classes
  • In PR checks to assess change risk
  • When planning large-scale migrations
BetweennessRisk LevelRecommendation
< 0.1LowSafe to modify
0.1 - 0.3ModerateReview dependents carefully
0.3 - 0.5HighConsider introducing a facade/adapter
> 0.5Very highBreak dependencies before refactoring
  • High fan-in (>10) — Many modules depend on this file (hub module)
  • High fan-out (>10) — This file depends on many modules (potential god class)
  • High both — Critical junction point — refactor with extreme caution
Terminal window
# Analyze impact using CLI with changed files filter
arxo analyze --preset quick --changed-files src/core/auth.ts,src/core/session.ts