[daily-compiler-quality] Daily Compiler Code Quality Report - 2026-04-15 #26502
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Daily Compiler Quality Check. A newer discussion is available at Discussion #26743. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🔍 Compiler Code Quality Analysis Report
Analysis Date: 2026-04-15⚠️ One file below quality threshold — 2/3 files meet quality standards
Files Analyzed:
compiler_safe_outputs_job.go,compiler_yaml.go,compiler_yaml_main_job.goOverall Status:
Executive Summary
Today's rotation covers three key compiler files totaling 2,597 lines. Two of the three files (
compiler_yaml.goat 80/100 andcompiler_yaml_main_job.goat 79/100) meet the human-written quality threshold of 75 points, showing solid Go craftsmanship with strong error handling and good comment density. However,compiler_safe_outputs_job.goscores 70/100 — below threshold — due primarily to a 497-line monolithic function (buildConsolidatedSafeOutputsJob) that handles 14+ distinct concerns and a brittle hardcoded step-insertion index that is fragile to future changes.A potential correctness issue was identified in
compiler_yaml.go: the firstprocessMarkdownBodycall at line 433 uses direct assignment (expressionMappings = exprMaps) rather thanappend, which could silently discard expression mappings from prior steps when both imported markdown with inputs (Step 1a) and subsequent content produce mappings. This merits investigation.On the positive side,
compiler_yaml_main_job.godemonstrates the best security-narrated code in the compiler suite, with 31.1% comment density that explains the threat being mitigated at each security-sensitive step (credential cleaning, OTLP header masking, base folder restoration after PR checkout).Files Analyzed Today
📁 compiler_safe_outputs_job.go — Score: 70/100⚠️
Rating: Acceptable (below threshold)
Size: 805 lines | Git Hash:
d48c8b1Function Count: 10 | Max Function Length: 497 lines (
buildConsolidatedSafeOutputsJob)Test Coverage: 1029 test lines / 805 source = 1.28x ratio
Scores Breakdown
✅ Strengths
fmt.Errorfwith%w, including per-index error messagesbuildJobLevelSafeOutputEnvVarsis a clean 78-line pure function with per-variable documentationresolveSafeOutputsEnvironmentand detection condition helpers are focused single-responsibility functionsbuildConsolidatedSafeOutputsJobat 497 lines (High Priority)buildSafeOutputsSetupSteps+buildHandlerSteps+ thin ~60-line orchestratorInline 33-condition
hasHandlerManagerTypesboolean (Medium Priority)func hasHandlerManagerTypes(safeOutputs *SafeOutputsConfig) boolBrittle hardcoded
insertIndex += 6magic number (Medium Priority)Missing godoc on 6 of 8 package-level functions (Low Priority)
resolveSafeOutputsEnvironment,buildDetectionSuccessCondition,buildDetectionPassedCondition,buildSafeOutputItemsManifestUploadStep,buildSarifArtifactUploadStep,buildCustomScriptFilesStep💡 Recommendations
hasHandlerManagerTypesas a named predicate functioninsertIndexcounting with ordered slice concatenationbuildConsolidatedSafeOutputsJobinto 3 focused sub-builders📁 compiler_yaml.go — Score: 80/100 ✅
Rating: Good
Size: 911 lines | Git Hash:
d48c8b1Function Count: 16 | Max Function Length: 232 lines (
generatePrompt)Test Coverage: 1440 test lines / 911 source = 1.58x ratio
Scores Breakdown
✅ Strengths
generateYAML(67 lines) is a clean orchestrator with excellent body-before-header pattern and capacity commentstrings.Builderpre-allocation at 64KB with rationale comment — consistent Go performance idiomgenerateWorkflowBody(46 lines) is a model of focused responsibilityeffectiveStrictMode/effectiveSafeUpdate— clean 12-15 line functions with priority-order commentsstringutil.StripANSIat all user-content interpolation sites (security-conscious)generatePromptat 232 lines (Medium Priority)buildImportedChunks,buildRuntimeImportChunks,extractExpressionMappingsprocessMarkdownBodyexpression mapping overwrite (Medium Priority)expressionMappings = exprMaps(direct assignment vs.append)expressionMappings = append(expressionMappings, exprMaps...)for correctnessEngine-to-env-var mapping duplication in
generateCreateAwInfo(Low Priority)engineID→ env var constant duplicates mapping that exists inpkg/constantsengineEnvVarMapwriteStepsSectionimplicit invariant (Low Priority)📁 compiler_yaml_main_job.go — Score: 79/100 ✅
Rating: Good
Size: 881 lines | Git Hash:
d48c8b1Function Count: 7 | Max Function Length: ~700 lines (
generateMainJobSteps)Test Coverage: 904 test lines / 881 source = 1.03x ratio
Scores Breakdown
✅ Strengths
fmt.Errorfcalls use%waddCustomStepsAsIsandaddCustomStepsWithRuntimeInsertionare focused, clean helpers (~25 and ~60 lines)parseRepositoryImportSpecis a textbook parsing helper with named regex capture groups and clear error messagesgenerateMainJobStepsat ~700 lines (High Priority)Raw YAML string fragments for artifact download (Lines 317-321) (Low Priority)
buildArtifactDownloadStepshelper used elsewhere in the codebaseTest ratio of 1.03x is the lowest in today's set (Low Priority)
Overall Statistics
Quality Score Distribution
compiler_yaml.go(80),compiler_yaml_main_job.go(79)compiler_safe_outputs_job.go(70)Average Score: 76.3/100⚠️ 2 of 3 files meet threshold (≥75)
Human-Written Quality:
📈 Historical Trends (16 days)
Cumulative Scores Across All Analyzed Files
compiler_orchestrator.gocompiler.gocompiler_safe_outputs.gocompiler_jobs.gocompiler_orchestrator_workflow.gocompiler_yaml_main_job.gocompiler_yaml.gocompiler_safe_outputs_config.gocompiler_activation_job.gocompiler_pre_activation_job.gocompiler_safe_outputs_job.goRecurring Patterns Across All Analyzed Files
Systemic Issues (appear in 3+ files):
buildActivationJob(596 lines),buildConsolidatedSafeOutputsJob(497 lines),generateMainJobSteps(~700 lines),buildPreActivationJob(421 lines) all exceed the 50-line ideal by an order of magnitudecompiler_activation_job.go,compiler_safe_outputs_job.go,compiler_yaml_main_job.go— makes step shapes untestableSystemic Strengths:
fmt.Errorf(%w)is consistently applied across all fileslogger.New("workflow:filename")) used correctly throughoutconsole.FormatWarningMessage) used for user-facing outputActionable Recommendations
🔴 Immediate Actions (High Priority)
Investigate
compiler_yaml.go:433expression mapping overwriteexpressionMappings = exprMapsdirect assignment at line 433 may silently discard prior mappingsexpressionMappings = append(expressionMappings, exprMaps...)(or verify it's intentional with a comment)Extract
hasHandlerManagerTypesincompiler_safe_outputs_job.go🟠 Short-term Improvements (Medium Priority)
buildConsolidatedSafeOutputsJob— 3 focused sub-builders, thin orchestratorgeneratePromptincompiler_yaml.go— 3 focused sub-buildersinsertIndexcalculation — replace counting with ordered slice concatenationgenerateMainJobSteps— 5-6 phase sub-builders🟡 Long-term Goals (Low Priority)
compiler_yaml_main_job.go(currently 1.03x ratio) targeting the 30+ conditional branchescompiler_orchestrator_workflow.go(last score: 79, Apr-12),compiler_pre_activation_job.go(last score: 65, Apr-12),compiler_types.go(not yet analyzed)💾 Cache Memory Summary
Cache Location:
/tmp/gh-aw/cache-memory/Files Written:
compiler-quality-analysis-2026-04-15.json— today's full analysiscompiler-quality-rotation.json— updated rotation state (next_index: 9)Next Analysis Schedule
Based on rotation (next_index: 9), next files to analyze:
compiler_orchestrator_workflow.go— last score: 79 (Apr-12), pending re-checkcompiler_pre_activation_job.go— last score: 65 (Apr-12), below thresholdcompiler_types.go— never analyzedConclusion
The compiler suite continues at good overall quality with an average of 76.3/100 for today's files. The standout observation is the recurring monolithic-orchestrator pattern: the four largest functions in the compiler suite (
generateMainJobSteps,buildConsolidatedSafeOutputsJob,buildActivationJob,buildPreActivationJob) all exceed 400 lines, suggesting a systemic design preference for single large orchestrators over composition of focused helpers.Key Takeaways:
compiler_yaml_main_job.gosets the bar for the suitecompiler_safe_outputs_job.goneeds structural refactoring (70/100)compiler_yaml.go:433warrants investigationReferences:
Beta Was this translation helpful? Give feedback.
All reactions