Skip to content

refactor: reduce complexity of execute_impl in reply_to_pr_comment.rs - #2418

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-reply-to-pr-comment-bdd54ab57a85f54b
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-reply-to-pr-comment-bdd54ab57a85f54b

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

cognitive_complexity flagged nothing, so I used clippy::too_many_lines. ReplyToPrCommentResult::execute_impl was 120/100 lines. It is no longer flagged.

Extracted three helpers:

  • resolve_repo_name: allowed-repositories check and alias lookup.
  • thread_comments_url: builds the API URL.
  • build_result: maps the HTTP response to an ExecutionResult.

Behaviour is unchanged. cargo test --bin ado-aw reply_to_pr passed (10 tests). The clippy run reported no errors and no longer flags this function. I did not run the full cargo test suite.

Generated by Cyclomatic Complexity Reducer · auto · 32.6 AIC · ⊞ 6.5K · ◷

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