Analysis of commit 80f243c
Assignee: @copilot
Summary
create_missing_tool_issue.cjs, create_missing_data_issue.cjs, and create_report_incomplete_issue.cjs each build the same buildMissingIssueHandler(...) wrapper with only literals and item names changed. The repeated structure is roughly 18-20 lines per file and is easy to drift.
Duplication Details
Pattern: Missing-issue handler config wrapper
- Severity: Medium
- Occurrences: 3
- Locations:
actions/setup/js/create_missing_tool_issue.cjs (lines 18-38)
actions/setup/js/create_missing_data_issue.cjs (lines 18-40)
actions/setup/js/create_report_incomplete_issue.cjs (lines 20-40)
- Code Sample:
main = buildMissingIssueHandler({
handlerType: HANDLER_TYPE,
defaultTitlePrefix: "...",
defaultLabels: ["agentic-workflows"],
itemsField: "...",
templatePath: getPromptPath("..."),
templateListKey: "...",
buildCommentHeader: runUrl => [...],
renderCommentItem: (...) => {...},
renderIssueItem: (...) => {...},
})
Impact Analysis
- Maintainability: edits to one handler shape need to be mirrored in three files.
- Bug Risk: drift in comment/issue rendering or default labels is easy to introduce.
- Code Bloat: three near-identical config blocks add avoidable repetition.
Refactoring Recommendations
- Extract a small config factory for missing-issue handlers, e.g.
buildMissingIssueConfig(kind, templates, renderers).
- Keep only the per-kind literals in each entrypoint.
- Consider a shared metadata table for the
missing tool, missing data, and incomplete variants.
Implementation Checklist
Analysis Metadata
- Analyzed Files: 3
- Detection Method: Serena semantic code analysis
- Commit: 80f243c
- Analysis Date: 2026-06-19 UTC
Generated by 🔍 Duplicate Code Detector · 15 AIC · ⌖ 2.59 AIC · ⊞ 14.8K · ◷
Analysis of commit 80f243c
Assignee:
@copilotSummary
create_missing_tool_issue.cjs,create_missing_data_issue.cjs, andcreate_report_incomplete_issue.cjseach build the samebuildMissingIssueHandler(...)wrapper with only literals and item names changed. The repeated structure is roughly 18-20 lines per file and is easy to drift.Duplication Details
Pattern: Missing-issue handler config wrapper
actions/setup/js/create_missing_tool_issue.cjs(lines 18-38)actions/setup/js/create_missing_data_issue.cjs(lines 18-40)actions/setup/js/create_report_incomplete_issue.cjs(lines 20-40)Impact Analysis
Refactoring Recommendations
buildMissingIssueConfig(kind, templates, renderers).missing tool,missing data, andincompletevariants.Implementation Checklist
Analysis Metadata