Repository navigation
refactor(graph): split graph functions under the complexity limits and gate the self-test - #117
Merged
Merged
Conversation
…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>
cargo fallow files0 issues, exit code 0.
|
BartWaardenburg
force-pushed
the
refactor/graph-complexity
branch
from
November 5, 2026 08:43
5451076 to
514ea57
Compare
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_framesandkind_facts.add_files:CrateContext,add_file,add_itemsandinline_module.Resolver::new:item_indexes,member_ownerandimport_indexes.Resolver::resolve_path:step_all.chains:push_chain,chain_start,chain_global,chain_segmentsandchain_member.files::scan::scan:declares_module_in_block,is_macro_likeandscan_tokens.Registry::stale:warn_unknownandstale_marker.The behavior does not change.
With this change,
cargo fallow complexityreports 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 complexityreports none of these functions, and it reports no new function.check,visibility,boundaries,filesanddepsare identical withmainon cargo-fallow, ripgrep, typos, git-cliff, gitui, taplo and mdbook.Test plan
cargo fallow complexityon this branch, merged withmain, reports no issue.cargo nextest run --profile ci --lockedandcargo test --doc --lockedpass.cargo clippy --all-targets --locked -- -D warnings, also forx86_64-pc-windows-msvc.RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items,hk run pre-commit --all.