-
Notifications
You must be signed in to change notification settings - Fork 225
Closed
Labels
automationcode-qualitycookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!refactoringtask-mining
Description
Description
The compiler.go file contains 20+ repetitive blocks of error formatting code that follow the same pattern. Extracting this into a helper function would reduce approximately 200 lines of code duplication and improve maintainability.
Current Pattern (Repeated ~20 times)
formattedErr := console.FormatError(console.CompilerError{
Position: console.ErrorPosition{
File: markdownPath,
Line: 1,
Column: 1,
},
Type: "error",
Message: err.Error(),
})
return errors.New(formattedErr)Proposed Solution
Extract into a helper function:
func formatCompilerError(markdownPath string, err error) error {
formattedErr := console.FormatError(console.CompilerError{
Position: console.ErrorPosition{
File: markdownPath,
Line: 1,
Column: 1,
},
Type: "error",
Message: err.Error(),
})
return errors.New(formattedErr)
}Usage: Replace 20+ repetitive blocks with return formatCompilerError(markdownPath, err)
Files Affected
pkg/workflow/compiler.go(20+ instances of repetitive error formatting)
Success Criteria
- Helper function
formatCompilerError()created - All 20+ repetitive blocks replaced with helper function call
- Code reduction of ~200 lines achieved
- All existing tests pass
- No change to error message output format
Impact
- Severity: Medium - Improves code maintainability
- Effort: Low - Estimated 30 minutes
- Lines Reduced: ~200 lines
- Risk: Minimal - Simple refactoring with no behavior change
Source
Extracted from Daily Compiler Code Quality Report - 2026-01-28
Priority
Medium-High - Reduces technical debt and improves code readability
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 11, 2026, 9:11 AM UTC
Reactions are currently unavailable
Metadata
Metadata
Labels
automationcode-qualitycookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!refactoringtask-mining