Skip to content

refactor: reduce complexity of execute_impl in update_wiki_page.rs - #2438

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-update-wiki-page-490cbfe2ff38a266
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-update-wiki-page-490cbfe2ff38a266

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

UpdateWikiPageResult::execute_impl was flagged by clippy::too_many_lines (157/100). Clippy's cognitive_complexity lint flagged nothing.

  • Extracted resolve_effective_path, which handles path normalization, traversal rejection, path-prefix enforcement and title-prefix application.
  • Extracted update_success_result, which builds the success result from the PUT response.

Behaviour and error messages are unchanged.

Complexity: too_many_lines went from 157/100 to 124/100. The function is still flagged, but it is much shorter.

Validation:

  • cargo clippy --all-targets --all-features: no errors.
  • cargo test --bin ado-aw update_wiki: 29 passed, 0 failed.
  • The full cargo test suite was not run.

Generated by Cyclomatic Complexity Reducer · auto · 38.6 AIC · ⊞ 6.7K · ◷

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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 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