Skip to content

refactor: reduce complexity of resolve_imports_with_repo_root in imports/mod.rs - #2367

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-resolve-imports-0d1698b0ffd9fcfa
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-resolve-imports-0d1698b0ffd9fcfa

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

resolve_imports_with_repo_root was flagged by clippy::too_many_lines (141/100).

Extracted helpers (no behaviour change):

  • seed_queue builds the initial import queue.
  • check_resolution_limits enforces the lookup-count and depth limits.
  • record_edge_checking_cycles does ancestry/graph cycle detection and records the edge.
  • nested_entries_of applies import inputs and parses nested imports.

After the change the function is no longer flagged by too_many_lines. Clippy reports no new warnings in this file.

Validation: cargo test imports passed (60 passed in the main crate, 0 failed); cargo clippy --all-targets --all-features showed no new warnings.

Generated by Cyclomatic Complexity Reducer · auto · 30.3 AIC · ⊞ 11.2K · ◷

…rts/mod.rs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

This branch has not been deployed

No deployments
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.

0 participants