Skip to content

refactor: reduce complexity of summarize_step in src/compile/ir/summary.rs - #2383

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-summarize-step-63bd09ff79013ba6
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
refactor/reduce-complexity-summarize-step-63bd09ff79013ba6

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

summarize_step was flagged by clippy::too_many_lines (128/100): it built an 8-element tuple per step variant, repeating condition/env-ref handling in each arm, then patched auto_is_output inline.

Changes (behaviour-preserving):

  • Build StepSummary directly per variant, using a local bare constructor plus struct update syntax.
  • Extract condition handling into a summarize_condition closure.
  • Extract summarize_env_refs and mark_auto_is_output helpers (flattened with let-else).

Before/after: too_many_lines 128/100 → no longer flagged. cognitive_complexity flagged nothing at the default threshold.

Validation: cargo test passed (3410 unit tests plus integration tests, 0 failed). Clippy with -W clippy::too_many_lines no longer flags summarize_step.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com
  • spsprodeus21.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Cyclomatic Complexity Reducer · auto · 37.7 AIC · ⊞ 11.1K · ◷

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