Skip to content
Arxo Arxo

CLI and Integration

CLI usage, integrations, advanced features, and troubleshooting. For an overview, see Circular Dependencies.

When call-graph data is available, SCC also emits function-level keys:

{
"scc.function.cycle_count": 507,
"scc.function.call_mass": 172,
"scc.function.cycle_cut_candidates_count": 4
}

Use case: find circular call paths even when module-level imports are mostly clean.

Configure SCC under metrics[].config for the metric with id: scc.

KeyTypeDefaultWhat it controls
use_git_historyboolfalseLoad git history and populate churn / hotspot_score in cycle details
emit_findingsbooltrueEmit cycle findings in results[].findings
max_cycles_in_uinumber50Cap number of cycles included in ui_schemas.scc.scc_details
edge_modestringallEdge set used for SCC: all, runtime_only, structural_only
max_findingsnumberunsetMaximum number of SCC findings emitted
emit_function_findingsbooltrueEmit findings for function-level cycles when call graph exists

Example:

metrics:
- id: scc
config:
edge_mode: all
emit_findings: true
emit_function_findings: true
max_cycles_in_ui: 50
max_findings: 100
use_git_history: true

Compatibility note: SCC also accepts these keys under a nested scc: object inside the metric config, but direct keys (shown above) are recommended.

If edge_mode is invalid, analysis returns an error for SCC config parsing.

Terminal window
# Detect cycles
arxo analyze
# JSON output
arxo analyze --format json
# Run only SCC
arxo analyze --metric scc
Terminal window
# Enforce SCC policy from config
arxo analyze --config arxo.yml
# Exit code 1 if policy fails
echo $?
Terminal window
# Module-level SCC numeric keys
arxo analyze --format json | jq '.results[] | select(.id=="scc") | .data[] | select(.key|test("^scc\\.(component_count|cycle_count|max_cycle_size|total_nodes_in_cycles)$"))'
# Function-level numeric keys
arxo analyze --format json | jq '.results[] | select(.id=="scc") | .data[] | select(.key|startswith("scc.function."))'
# Per-cycle details (cycle microscope payload)
arxo analyze --format json | jq '.ui_schemas.scc.scc_details[] | select((.nodes | length) > 1)'
# Function call-cycle cut candidates (UI category)
arxo analyze --format json | jq '.ui_schemas.scc.issues.categories.cycle_cut_candidates.critical'
# Structured SCC outputs in result data
arxo analyze --format json | jq '.results[] | select(.id=="scc") | .data[] | select(.key|test("^scc\\.(cycle_summary|cut_candidates|cycles|top_cycles_by_risk|top_cut_candidates|condensed_dag|config)$"))'
.pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: arxo-scc
name: Check for circular dependencies
entry: arxo analyze --metric scc --format json
language: system
pass_filenames: false
.github/workflows/architecture.yml
name: Architecture Checks
on: [push, pull_request]
jobs:
cycles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arxo-dev/setup-arxo@v1
- run: arxo analyze --metric scc --config arxo.yml

The Arxo IDE can surface cycles inline:

  • diagnostics on imports contributing to cycles
  • cycle path drill-down
  • quick metric access for cycle counts and sizes

”No cycles detected” but code has circular imports

Section titled “”No cycles detected” but code has circular imports”

Cause: Grouping level is too coarse.

Solution:

data:
import_graph:
group_by: file

Cause: The cycle spans many intermediate modules.

Solution:

Terminal window
arxo analyze --format json | jq '.ui_schemas.scc.scc_details[] | select((.nodes | length) > 10)'

Cause: git history was not loaded for SCC.

Solution:

metrics:
- id: scc
config:
use_git_history: true

Debug:

Terminal window
ARXO_SCC_DEBUG=1 arxo analyze

Expected debug line:

[scc] use_git_history=true git_history=Some edge_mode=all

Canonical SCC metric keys emitted by the plugin are scc.* and scc.function.*.

Some downstream consumers (for compatibility) may expose mirrored names like scc.module.max_cycle_size. Treat them as aliases when present.

For policies and new integrations, prefer canonical scc.* keys.