Summary
Daily custom lint scan identified 635 functions exceeding the 60-line length limit across pkg/workflow, pkg/cli, and pkg/parser.
Root Cause
Functions with complex logic or many sequential operations have accumulated beyond the target limit of 60 lines. This affects code readability, testability, and maintenance.
Affected Subsystems
pkg/workflow/ - largest concentration (majority of 635 findings)
pkg/cli/ - several functions in various commands
pkg/parser/ - a few parser and validation functions
Example Functions (representative sample)
buildMaintenanceWorkflowYAML (936 lines) in maintenance_workflow_yaml.go
buildPreActivationJob (489 lines) in compiler_pre_activation_job.go
commentOutProcessedFieldsInOnSection (625 lines) in frontmatter_extraction_yaml.go
GetExecutionSteps (565 lines) in copilot_engine_execution.go
GetExecutionSteps (382 lines) in claude_engine.go
- Many functions in range 100-300 lines
Remediation Strategy
Refactor functions into smaller, focused helpers. See validation-refactoring.md for guidelines:
Approach
- Extract helper functions for distinct logical sections
- Use option structs to pass complex parameters
- Create intermediate builders for multi-step operations
- Maintain existing public APIs; internal helpers can be private
- Add comprehensive unit tests for extracted functions
- Run
make golint-custom after refactoring to validate
Validation Checklist
Next Steps (Prioritized)
- Ultra-long functions (>300 lines):
buildMaintenanceWorkflowYAML (936), commentOutProcessedFieldsInOnSection (625), buildPreActivationJob (489), GetExecutionSteps copilot (565)
- Long engine functions (200-300 lines): Various
GetExecutionSteps, log parsing functions
- Medium functions (100-200 lines): Builder functions, configuration parsers
- Remaining functions (60-100 lines): Final pass
Estimated Effort
This is a large, multi-session refactoring task. Recommend slicing by subsystem or function-size tier.
Labels
lint-monster, refactoring, code-quality
Generated by 🧌 LintMonster · haiku45 75K · ◷
Summary
Daily custom lint scan identified 635 functions exceeding the 60-line length limit across
pkg/workflow,pkg/cli, andpkg/parser.Root Cause
Functions with complex logic or many sequential operations have accumulated beyond the target limit of 60 lines. This affects code readability, testability, and maintenance.
Affected Subsystems
pkg/workflow/- largest concentration (majority of 635 findings)pkg/cli/- several functions in various commandspkg/parser/- a few parser and validation functionsExample Functions (representative sample)
buildMaintenanceWorkflowYAML(936 lines) inmaintenance_workflow_yaml.gobuildPreActivationJob(489 lines) incompiler_pre_activation_job.gocommentOutProcessedFieldsInOnSection(625 lines) infrontmatter_extraction_yaml.goGetExecutionSteps(565 lines) incopilot_engine_execution.goGetExecutionSteps(382 lines) inclaude_engine.goRemediation Strategy
Refactor functions into smaller, focused helpers. See validation-refactoring.md for guidelines:
Approach
make golint-customafter refactoring to validateValidation Checklist
go test -v ./...make golint-customNext Steps (Prioritized)
buildMaintenanceWorkflowYAML(936),commentOutProcessedFieldsInOnSection(625),buildPreActivationJob(489),GetExecutionStepscopilot (565)GetExecutionSteps, log parsing functionsEstimated Effort
This is a large, multi-session refactoring task. Recommend slicing by subsystem or function-size tier.
Labels
lint-monster, refactoring, code-quality