Refactoring Suggestions
Refactoring Suggestions
Section titled “Refactoring Suggestions”Arxo can generate concrete refactoring suggestions from the Ricci curvature metric. This is useful after running an analysis with ricci_curvature enabled and exporting JSON.
How it works
Section titled “How it works”-
Run analysis with the
ricci_curvaturemetric and JSON output:metrics:- id: ricci_curvatureenabled: truereport:format: jsonfile: report.json -
The JSON report contains Ricci curvature results, including:
- Flagged edges (e.g. negative curvature, high risk)
- Peripheral coupling issues (core-periphery violations)
-
Tooling can read this JSON and produce human-readable refactoring suggestions: which edges to review, call sites involved, and recommended actions (e.g. introduce interface, move code).
What you get
Section titled “What you get”Suggestions typically include:
- Edge: From-module → To-module
- Risk score / category: From Ricci curvature and peripheral analysis
- Call sites: File and symbol for callers and callees, with call counts
- Details: Short explanations and concrete steps (e.g. break dependency, reduce coupling)
Using the JSON report
Section titled “Using the JSON report”The JSON report structure includes metrics[] with id: "ricci_curvature". Under ui_schema.issues.categories you find:
flagged_for_review: edges flagged by Ricci curvatureperipheral_coupling: core-periphery coupling issues
Each issue has from, to, and optional entity/call information that can be turned into refactoring suggestions (e.g. via a script or the internal suggest_refactors API).
Related
Section titled “Related”- Ricci Curvature — metric description and interpretation
- Refactoring Recommendations — metric for refactoring recommendations
- Reports — output formats, including JSON