You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analysis of the gh-aw-mcpg Go codebase found 1 significant duplication pattern meeting the reporting threshold (>10 lines or 3+ similar instances), plus 2 intentional/documented patterns that are acknowledged in the codebase already.
Three nearly-identical 17-line functions (listTools, listResources, listPrompts) in internal/mcp/connection.go share identical boilerplate with only type-level differences.
Four logger types each define an identical 3-line withLock method delegating to withMutexLock. Explicitly documented in internal/logger/common.go as the expected pattern.
Three sets of four one-liner functions (LogInfo/LogWarn/LogError/LogDebug, their Md and WithServer variants) across file_logger.go, markdown_logger.go, and server_file_logger.go. Also explicitly documented in internal/logger/common.go.
Affected Files: 1 file with actionable duplication (internal/mcp/connection.go)
Maintainability Risk: Medium — if the list-operation contract changes (e.g., new error handling, session refresh), all three functions must be updated in sync
Refactoring Priority: Low-Medium — the code is correct and the pattern is stable; a generic helper would improve maintainability but carries no immediate bug risk
Next Steps
Review the sub-issue for the list* pattern and decide whether a generic helper is worth adding
No action needed for the documented logger patterns (already intentional)
Analysis Metadata
Analyzed Files: All non-test .go files in internal/ (≈80 files)
Detection Method: Semantic and structural pattern analysis
Commit: 893fa02 (Guard coverage: classify create_agent_task as read-write and blocked)
Analysis Date: 2026-04-04
Note: The HEAD commit modifies only Rust files; Go analysis covers the full current codebase state
Analysis of commit 893fa02 — triggered by
@lpcoxSummary
Analysis of the
gh-aw-mcpgGo codebase found 1 significant duplication pattern meeting the reporting threshold (>10 lines or 3+ similar instances), plus 2 intentional/documented patterns that are acknowledged in the codebase already.Detected Patterns
list*MCP Operations Structural Duplication — Severity: Medium — See sub-issue [duplicate-code] Duplicate Code Pattern: list* MCP Operations Structural Duplication #3156listTools,listResources,listPrompts) ininternal/mcp/connection.goshare identical boilerplate with only type-level differences.withLockMethod Boilerplate in Logger Types — Severity: Low (documented intentional pattern)withLockmethod delegating towithMutexLock. Explicitly documented ininternal/logger/common.goas the expected pattern.Log-Level Quad-Function Pattern — Severity: Low (documented intentional pattern)
LogInfo/LogWarn/LogError/LogDebug, theirMdandWithServervariants) acrossfile_logger.go,markdown_logger.go, andserver_file_logger.go. Also explicitly documented ininternal/logger/common.go.Overall Impact
listTools/listResources/listPrompts, 17 lines × 3)internal/mcp/connection.go)Next Steps
list*pattern and decide whether a generic helper is worth addingAnalysis Metadata
.gofiles ininternal/(≈80 files)893fa02(Guard coverage: classifycreate_agent_taskas read-write and blocked)