Skip to content

[Code Quality] Break down 192 large files exceeding 500 LOC threshold #13962

@github-actions

Description

@github-actions

Description

The codebase has 192 files exceeding 500 lines of code, with an average file size of 559 lines. This affects the code organization quality score (7.4/25 points) and makes the codebase harder to navigate and maintain.

Impact: Large files reduce maintainability, increase cognitive load, and make it harder to understand and test individual components. The current quality score is 67.4/100, and improving code organization could boost this significantly.

Suggested Changes

Phase 1: Identify top 20 largest files (priority targets)

  1. Run analysis to find files >800 lines
  2. Prioritize compiler, workflow, and CLI files

Phase 2: Create refactoring plan for each large file
3. Group related functions into logical modules
4. Extract helper utilities into separate files
5. Split files by responsibility/concern

Phase 3: Incremental refactoring
6. Break down 1-2 large files per week
7. Maintain or improve test coverage during splits
8. Document file organization patterns in AGENTS.md

Files Affected

  • 192 files across the codebase (primarily in pkg/)
  • Known large files from compiler analysis:
    • pkg/workflow/compiler_activation_jobs.go (824 lines)
    • pkg/workflow/compiler_yaml_main_job.go (612 lines)
    • pkg/workflow/compiler_yaml.go (598 lines)
    • Plus 189 more files >500 LOC

Success Criteria

  • Number of files >500 LOC reduced from 192 to <150
  • Average file size reduced from 559 to <450 lines
  • Code organization score improves from 7.4/25 to >15/25
  • Overall quality score improves from 67.4 to >75
  • All existing tests pass
  • Test coverage maintained or improved (currently 2.22:1 ratio)

Source

Extracted from Daily Code Metrics Report - 2026-02-05

Key finding from report:

"⚠️ Code Organization (7.4/25): 192 files exceed 500 LOC - consider breaking down large files. Insights & Recommendations: Break Down Large Files - With 192 files exceeding 500 LOC, consider refactoring large files into smaller, more maintainable modules to improve code organization score."

Quality metrics:

  • Total LOC: 771,088
  • Average file size: 559 lines
  • Large files (>500 LOC): 192
  • Code organization score: 7.4/25 (needs improvement)

Priority

Medium - Long-term maintainability improvement. Should be tackled incrementally over time rather than all at once.

Estimated Effort

Long-term project (1-2 months for full completion)

  • Initial analysis and planning: 4 hours
  • Per-file refactoring: 2-4 hours each
  • Target: 1-2 files per week for sustainable progress

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 6, 2026, 5:16 PM UTC

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