Skip to content

[Code Quality] Split oversized buildSafeOutputsHandlerOutputsAndActionSteps (238 lines) into focused helpers #47656

Description

@github-actions

Description

compiler_safe_outputs_job.go improved from score 78 to 82 in the latest compiler quality analysis thanks to recent refactoring, but one large method remains: buildSafeOutputsHandlerOutputsAndActionSteps at 238 lines. The file is also 1042 lines total, 30% above the 800-line guideline.

This is the last major refactoring opportunity in this file after buildSafeOutputsJobFromParts was already reduced from 275 to 59 lines.

Suggested Changes

  • Identify the logical sub-responsibilities of buildSafeOutputsHandlerOutputsAndActionSteps
  • Extract cohesive helper functions (e.g. one for outputs assembly, one for action steps assembly)
  • Target method length <= 80 lines per extracted helper
  • Aim to bring file total below 900 lines

Files Affected

  • pkg/compiler/compiler_safe_outputs_job.go (line ~238 for the method)

Success Criteria

  • buildSafeOutputsHandlerOutputsAndActionSteps reduced to <= 80 lines
  • File total below 900 lines
  • Compiler quality score improves to >= 90
  • All existing tests pass (make test-unit)
  • make golint-custom reports no new violations

Priority

Medium — last unaddressed refactoring item in this file

Source

Extracted from Daily Compiler Code Quality Report #47451

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 42.2 AIC · ⌖ 5.29 AIC · ⊞ 7.1K ·

  • expires on Jul 24, 2026, 11:12 AM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions