Skip to content

refactor(graph): split graph functions under the complexity limits and gate the self-test - #117

Merged
BartWaardenburg merged 7 commits into
mainfrom
refactor/graph-complexity
Nov 5, 2026
Merged

BartWaardenburg merged 7 commits into
mainfrom
refactor/graph-complexity

Conversation

@BartWaardenburg

@BartWaardenburg BartWaardenburg commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The self-check (code scanning) reported seven functions of the module graph, the file scan and the suppression registry over the complexity limits (cyclomatic 20, cognitive 15). This pull request splits each function:

  • Walker::enter: attr_frames and kind_facts.
  • add_files: CrateContext, add_file, add_items and inline_module.
  • Resolver::new: item_indexes, member_owner and import_indexes.
  • Resolver::resolve_path: step_all.
  • chains: push_chain, chain_start, chain_global, chain_segments and chain_member.
  • files::scan::scan: declares_module_in_block, is_macro_like and scan_tokens.
  • Registry::stale: warn_unknown and stale_marker.

The behavior does not change.

With this change, cargo fallow complexity reports no function of the cargo-fallow source. The complexity step of the action self-test now uses the gate, so a new function over the limits fails the job. The SARIF upload still runs when the gate fails. The output check expects no issue and no failed gate.

Validation

  • cargo fallow complexity reports none of these functions, and it reports no new function.
  • The JSON output, the stderr and the exit code of check, visibility, boundaries, files and deps are identical with main on cargo-fallow, ripgrep, typos, git-cliff, gitui, taplo and mdbook.

Test plan

  • cargo fallow complexity on this branch, merged with main, reports no issue.

  • cargo nextest run --profile ci --locked and cargo test --doc --locked pass.

  • cargo clippy --all-targets --locked -- -D warnings, also for x86_64-pc-windows-msvc.

  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items, hk run pre-commit --all.

@BartWaardenburg BartWaardenburg changed the title refactor(graph): split the graph, file scan and suppression functions under the complexity limits refactor(graph): split graph, file scan and suppression functions under the complexity limits Nov 5, 2026
…er the complexity limits

The self-check reported seven functions over the complexity limits:
`Walker::enter`, `add_files`, `Resolver::new`, `Resolver::resolve_path`,
`chains`, the file scan `scan` and `Registry::stale`. Each one now calls
smaller functions. The findings do not change.

Signed-off-by: Bart Waardenburg <bart@waardenburg.dev>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

cargo fallow files

0 issues, exit code 0.

Gate Status Enforced Observed
unused-files pass yes 0

@BartWaardenburg
BartWaardenburg force-pushed the refactor/graph-complexity branch from 5451076 to 514ea57 Compare November 5, 2026 08:43
…xity

Signed-off-by: Bart Waardenburg <bart@waardenburg.dev>
The cargo-fallow source is now under its own complexity limits. The
complexity step of the action self-test gave `fail-on-issues: 'false'`,
so a new function over the limits did not fail the job. The step now
uses the gate. The output check expects no issue and no failed gate.
The SARIF upload still runs when the gate fails.

Signed-off-by: Bart Waardenburg <bart@waardenburg.dev>
@BartWaardenburg BartWaardenburg changed the title refactor(graph): split graph, file scan and suppression functions under the complexity limits refactor(graph): split graph functions under the complexity limits and gate the self-test Nov 5, 2026
@BartWaardenburg
BartWaardenburg merged commit 7c71351 into main Nov 5, 2026
23 checks passed
@BartWaardenburg
BartWaardenburg deleted the refactor/graph-complexity branch November 5, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant