Summary
- Analysis Period: Last 24 hours
- Files Analyzed: 1,002 (Go + CJS/JS files from commit
722cdd1)
- Total Violations: 17
- Date: 2026-04-17
| Severity |
Count |
| π¨ BLOCKER |
0 |
| β οΈ WARNING |
16 |
| iοΈ INFO |
1 |
β οΈ WARNING Violations
These violations should be addressed soon to prevent further structural debt.
File Too Large β pkg/workflow/compiler_activation_job.go
File: pkg/workflow/compiler_activation_job.go | Lines: 1,084
Commit: 722cdd1 β [aw-compat] Downgrade strict missing-permission failures for default GitHub toolsets to warnings (#26816)
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: The file already follows a functional decomposition pattern (many small helper functions). The main opportunity is to extract buildActivationJob (see Function violation below) into a dedicated orchestration file, e.g. compiler_activation_job_builder.go. Secondary helpers such as addActivationInteractionPermissions*, shouldInclude*, and activationEventSet could move to a compiler_activation_job_helpers.go file, keeping each under 400 lines.
Function Too Large β buildActivationJob in pkg/workflow/compiler_activation_job.go
File: pkg/workflow/compiler_activation_job.go | Function: buildActivationJob | Lines: 624
Commit: 722cdd1 β [aw-compat] Downgrade strict missing-permission failures for default GitHub toolsets to warnings
Issue: buildActivationJob is 624 lines β more than 3Γ the 200-line threshold. This makes it very hard to read, test, or modify safely.
Suggested fix: Decompose into smaller, focused builder functions:
buildActivationJobTriggerSteps() β gathers the trigger/on-section steps
buildActivationJobPermissionSteps() β handles permissions setup
buildActivationJobPromptStep() β delegates to generatePromptInActivationJob
buildActivationJobOutputSteps() β handles output/sanitization steps
Each sub-function should be independently testable and under 100 lines.
File Too Large β pkg/workflow/cache.go
File: pkg/workflow/cache.go | Lines: 1,007
Commit: 722cdd1 β [aw-compat] Downgrade strict missing-permission failures for default GitHub toolsets to warnings
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Identify the distinct concerns inside this file β caching strategy, data structures, and eviction logic are typically separable. Extract into cache_types.go (data models), cache_store.go (read/write operations), and keep cache.go as the top-level orchestration layer.
File Too Large β actions/setup/js/log_parser_shared.cjs
File: actions/setup/js/log_parser_shared.cjs | Lines: 1,703
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: The file mixes log-parsing entry points with multiple formatting concerns. Split into:
log_parser_conversation.cjs β generateConversationMarkdown, generateInformationSection
log_parser_formatters.cjs β formatToolUse, formatInitializationSummary, formatMcpParameters, formatResultPreview
log_parser_summary.cjs β generatePlainTextSummary, generateCopilotCliStyleSummary
- Keep
log_parser_shared.cjs as a thin re-export barrel
Function Too Large β generatePlainTextSummary in log_parser_shared.cjs
File: actions/setup/js/log_parser_shared.cjs | Function: generatePlainTextSummary | Lines: ~211
Issue: Function exceeds the 200-line threshold.
Suggested fix: Extract sections (header, body, tool-use summary, footer) into smaller helpers and delegate from generatePlainTextSummary.
Function Too Large β generateCopilotCliStyleSummary in log_parser_shared.cjs
File: actions/setup/js/log_parser_shared.cjs | Function: generateCopilotCliStyleSummary | Lines: ~201
Issue: Function exceeds the 200-line threshold.
Suggested fix: Same strategy as generatePlainTextSummary β extract per-section helpers.
File Too Large β actions/setup/js/create_pull_request.cjs
File: actions/setup/js/create_pull_request.cjs | Lines: 1,678
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Split into create_pull_request_client.cjs (API client setup, label/assignee helpers) and create_pull_request_patch.cjs (patch enforcement and preview logic). The main orchestration function should stay in create_pull_request.cjs but be refactored (see Function violation below).
Function Too Large β main in create_pull_request.cjs
File: actions/setup/js/create_pull_request.cjs | Function: main | Lines: ~1,442
Issue: main is ~1,442 lines β the largest single function violation. It combines client initialization, fallback issue creation, PR diff generation, patch application, label management, and error handling.
Suggested fix: Decompose into a pipeline of clearly named async functions:
initializeClients(config) β sets up GitHub clients
preparePullRequestContent(config, clients) β builds title/body/labels
applyPatchAndPush(config, clients, content) β handles patch enforcement and git push
finalizePullRequest(config, clients, pr) β labels, reviews, assignments
Each phase should be independently testable. The main function should orchestrate them with error handling only.
File Too Large β actions/setup/js/handle_agent_failure.cjs
File: actions/setup/js/handle_agent_failure.cjs | Lines: 1,590
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Extract context-building functions (all the build*Context helpers) into a dedicated handle_agent_failure_context.cjs file. The main function (see Function violation below) should live in the current file as a thin orchestrator.
Function Too Large β main in handle_agent_failure.cjs
File: actions/setup/js/handle_agent_failure.cjs | Function: main | Lines: ~616
Issue: main is ~616 lines.
Suggested fix: Extract distinct phases β issue parent creation (ensureParentIssue), context assembly (calling build*Context functions), and issue/comment posting β into separate async functions called from main.
File Too Large β actions/setup/js/update_project.cjs
File: actions/setup/js/update_project.cjs | Lines: 1,451
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Separate project field update logic from project item query and mutation logic. Consider update_project_fields.cjs for field-specific logic and update_project_queries.cjs for GraphQL query/mutation definitions.
File Too Large β actions/setup/js/safe_output_handler_manager.cjs
File: actions/setup/js/safe_output_handler_manager.cjs | Lines: 1,301
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Extract individual handler registrations into per-handler files or a safe_output_handlers/ subdirectory, keeping safe_output_handler_manager.cjs as a registration and dispatch layer only.
File Too Large β actions/setup/js/sanitize_content_core.cjs
File: actions/setup/js/sanitize_content_core.cjs | Lines: 1,224
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Separate sanitization rules (regex patterns, replacement logic) from orchestration code. Consider sanitize_content_rules.cjs for the rule definitions and sanitize_content_pipeline.cjs for the processing pipeline.
File Too Large β actions/setup/js/runtime_import.cjs
File: actions/setup/js/runtime_import.cjs | Lines: 1,022
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Group runtime-specific import handling into separate modules (e.g., runtime_import_node.cjs, runtime_import_python.cjs) and keep runtime_import.cjs as a dispatcher.
File Too Large β actions/setup/js/safe_outputs_handlers.cjs
File: actions/setup/js/safe_outputs_handlers.cjs | Lines: 1,007
Commit: 722cdd1
Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Similar to safe_output_handler_manager.cjs β split handlers by domain (issue handlers, PR handlers, discussion handlers) into focused files.
iοΈ INFO Violations
Informational findings. Consider addressing in future refactoring.
pkg/workflow/cache.go: 2 exported identifiers β export count is within limits; noted for context only given the file size.
Configuration
Thresholds from .architecture.yml:
- File size BLOCKER: 2,000 lines
- File size WARNING: 1,000 lines
- Function size WARNING: 200 lines
- Max public exports INFO: 10
Action Checklist
ποΈ Thresholds are configured in .architecture.yml at the repository root.
ποΈ Architecture report by Architecture Guardian Β· β 1.5M Β· β·
Summary
722cdd1)File Too Large β
pkg/workflow/compiler_activation_job.goFile:
pkg/workflow/compiler_activation_job.go| Lines: 1,084Commit:
722cdd1β [aw-compat] Downgrade strict missing-permission failures for default GitHub toolsets to warnings (#26816)Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: The file already follows a functional decomposition pattern (many small helper functions). The main opportunity is to extract
buildActivationJob(see Function violation below) into a dedicated orchestration file, e.g.compiler_activation_job_builder.go. Secondary helpers such asaddActivationInteractionPermissions*,shouldInclude*, andactivationEventSetcould move to acompiler_activation_job_helpers.gofile, keeping each under 400 lines.Function Too Large β
buildActivationJobinpkg/workflow/compiler_activation_job.goFile:
pkg/workflow/compiler_activation_job.go| Function:buildActivationJob| Lines: 624Commit:
722cdd1β [aw-compat] Downgrade strict missing-permission failures for default GitHub toolsets to warningsIssue:
buildActivationJobis 624 lines β more than 3Γ the 200-line threshold. This makes it very hard to read, test, or modify safely.Suggested fix: Decompose into smaller, focused builder functions:
buildActivationJobTriggerSteps()β gathers the trigger/on-section stepsbuildActivationJobPermissionSteps()β handles permissions setupbuildActivationJobPromptStep()β delegates togeneratePromptInActivationJobbuildActivationJobOutputSteps()β handles output/sanitization stepsEach sub-function should be independently testable and under 100 lines.
File Too Large β
pkg/workflow/cache.goFile:
pkg/workflow/cache.go| Lines: 1,007Commit:
722cdd1β [aw-compat] Downgrade strict missing-permission failures for default GitHub toolsets to warningsIssue: File exceeds the 1,000-line warning threshold.
Suggested fix: Identify the distinct concerns inside this file β caching strategy, data structures, and eviction logic are typically separable. Extract into
cache_types.go(data models),cache_store.go(read/write operations), and keepcache.goas the top-level orchestration layer.File Too Large β
actions/setup/js/log_parser_shared.cjsFile:
actions/setup/js/log_parser_shared.cjs| Lines: 1,703Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: The file mixes log-parsing entry points with multiple formatting concerns. Split into:
log_parser_conversation.cjsβgenerateConversationMarkdown,generateInformationSectionlog_parser_formatters.cjsβformatToolUse,formatInitializationSummary,formatMcpParameters,formatResultPreviewlog_parser_summary.cjsβgeneratePlainTextSummary,generateCopilotCliStyleSummarylog_parser_shared.cjsas a thin re-export barrelFunction Too Large β
generatePlainTextSummaryinlog_parser_shared.cjsFile:
actions/setup/js/log_parser_shared.cjs| Function:generatePlainTextSummary| Lines: ~211Issue: Function exceeds the 200-line threshold.
Suggested fix: Extract sections (header, body, tool-use summary, footer) into smaller helpers and delegate from
generatePlainTextSummary.Function Too Large β
generateCopilotCliStyleSummaryinlog_parser_shared.cjsFile:
actions/setup/js/log_parser_shared.cjs| Function:generateCopilotCliStyleSummary| Lines: ~201Issue: Function exceeds the 200-line threshold.
Suggested fix: Same strategy as
generatePlainTextSummaryβ extract per-section helpers.File Too Large β
actions/setup/js/create_pull_request.cjsFile:
actions/setup/js/create_pull_request.cjs| Lines: 1,678Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Split into
create_pull_request_client.cjs(API client setup, label/assignee helpers) andcreate_pull_request_patch.cjs(patch enforcement and preview logic). Themainorchestration function should stay increate_pull_request.cjsbut be refactored (see Function violation below).Function Too Large β
mainincreate_pull_request.cjsFile:
actions/setup/js/create_pull_request.cjs| Function:main| Lines: ~1,442Issue:
mainis ~1,442 lines β the largest single function violation. It combines client initialization, fallback issue creation, PR diff generation, patch application, label management, and error handling.Suggested fix: Decompose into a pipeline of clearly named async functions:
initializeClients(config)β sets up GitHub clientspreparePullRequestContent(config, clients)β builds title/body/labelsapplyPatchAndPush(config, clients, content)β handles patch enforcement and git pushfinalizePullRequest(config, clients, pr)β labels, reviews, assignmentsEach phase should be independently testable. The
mainfunction should orchestrate them with error handling only.File Too Large β
actions/setup/js/handle_agent_failure.cjsFile:
actions/setup/js/handle_agent_failure.cjs| Lines: 1,590Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Extract context-building functions (all the
build*Contexthelpers) into a dedicatedhandle_agent_failure_context.cjsfile. Themainfunction (see Function violation below) should live in the current file as a thin orchestrator.Function Too Large β
maininhandle_agent_failure.cjsFile:
actions/setup/js/handle_agent_failure.cjs| Function:main| Lines: ~616Issue:
mainis ~616 lines.Suggested fix: Extract distinct phases β issue parent creation (
ensureParentIssue), context assembly (callingbuild*Contextfunctions), and issue/comment posting β into separate async functions called frommain.File Too Large β
actions/setup/js/update_project.cjsFile:
actions/setup/js/update_project.cjs| Lines: 1,451Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Separate project field update logic from project item query and mutation logic. Consider
update_project_fields.cjsfor field-specific logic andupdate_project_queries.cjsfor GraphQL query/mutation definitions.File Too Large β
actions/setup/js/safe_output_handler_manager.cjsFile:
actions/setup/js/safe_output_handler_manager.cjs| Lines: 1,301Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Extract individual handler registrations into per-handler files or a
safe_output_handlers/subdirectory, keepingsafe_output_handler_manager.cjsas a registration and dispatch layer only.File Too Large β
actions/setup/js/sanitize_content_core.cjsFile:
actions/setup/js/sanitize_content_core.cjs| Lines: 1,224Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Separate sanitization rules (regex patterns, replacement logic) from orchestration code. Consider
sanitize_content_rules.cjsfor the rule definitions andsanitize_content_pipeline.cjsfor the processing pipeline.File Too Large β
actions/setup/js/runtime_import.cjsFile:
actions/setup/js/runtime_import.cjs| Lines: 1,022Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Group runtime-specific import handling into separate modules (e.g.,
runtime_import_node.cjs,runtime_import_python.cjs) and keepruntime_import.cjsas a dispatcher.File Too Large β
actions/setup/js/safe_outputs_handlers.cjsFile:
actions/setup/js/safe_outputs_handlers.cjs| Lines: 1,007Commit:
722cdd1Issue: File exceeds the 1,000-line warning threshold.
Suggested fix: Similar to
safe_output_handler_manager.cjsβ split handlers by domain (issue handlers, PR handlers, discussion handlers) into focused files.iοΈ INFO Violations
pkg/workflow/cache.go: 2 exported identifiers β export count is within limits; noted for context only given the file size.Configuration
Thresholds from
.architecture.yml:Action Checklist
buildActivationJobinpkg/workflow/compiler_activation_job.go(624 lines β target β€ 100 lines per function)pkg/workflow/compiler_activation_job.go(1,084 lines) into focused sub-filespkg/workflow/cache.go(1,007 lines) intocache_types.go+cache_store.gomainincreate_pull_request.cjs(~1,442 lines) into a pipeline of async functionsactions/setup/js/log_parser_shared.cjs(1,703 lines) into per-concern modulesmaininhandle_agent_failure.cjs(~616 lines)update_project.cjs,safe_output_handler_manager.cjs,sanitize_content_core.cjs,runtime_import.cjs,safe_outputs_handlers.cjs)