Skip to content

[Code Quality] Refactor top 50 complex functions to reverse growing complexity trend #46758

Description

@github-actions

Description

The Daily Sentrux report for 2026-07-20 shows 1,045 functions exceeding complexity thresholds, up from 988 two weeks ago (+57 in ~2 weeks). The codebase quality signal has slowly declined from 5239 to 5221 over 30 days, with complexity as the primary bottleneck.

The recommended action is to target the top 50 highest-complexity functions for refactoring, which could meaningfully move the quality signal from ~5221 toward 5500+.

Suggested Changes

  1. Run sentrux or equivalent to list all 1,045 complex functions sorted by complexity score
  2. Select the top 50 by complexity (highest score first)
  3. For each: split into smaller focused functions (≤20 lines each where possible), extract helpers, reduce nesting
  4. Validate: each refactored function should pass make test and reduce complexity below the threshold
  5. Target files are concentrated in pkg/workflow/ and pkg/cli/ based on prior lint reports

Files Affected

  • Concentrated in pkg/workflow/ and pkg/cli/ (based on prior analysis)
  • Run make golint-custom to identify specific files

Success Criteria

  • Net reduction of ≥50 complex functions (from 1,045 toward 995)
  • Sentrux quality signal improves from 5221 toward 5300+
  • All existing tests pass
  • No functions introduced above the complexity threshold

Source

Extracted from [daily-sentrux] Daily Sentrux Report - 2026-07-20

Priority

Medium — trend is worsening slowly; proactive refactoring now is cheaper than later

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 44.8 AIC · ⌖ 7.87 AIC · ⊞ 7K ·

  • expires on Jul 20, 2026, 11:50 PM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions