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 latest commit (8f964e0) identified 2 significant duplication patterns in the Go codebase. Both patterns meet the threshold (>10 lines or 3+ similar occurrences) and affect maintainability.
Maintainability Risk: Medium — both patterns are in active code paths; a bug fix or format change in one copy must be manually mirrored to the other(s)
Refactoring Priority: Low-Medium — no correctness issue today, but extraction into shared helpers reduces future maintenance burden
Next Steps
Review individual pattern sub-issues for detailed analysis
Prioritize refactoring based on severity and impact
Consider adding a shared buildMCPTextResponse helper in internal/mcp/ or internal/server/
Analysis Metadata
Analyzed Files: 98 Go files (non-test, non-workflow)
Summary
Analysis of the latest commit (8f964e0) identified 2 significant duplication patterns in the Go codebase. Both patterns meet the threshold (>10 lines or 3+ similar occurrences) and affect maintainability.
Detected Patterns
MCP Text Response Wrapping - Severity: Medium - See sub-issue [duplicate-code] Duplicate Code Pattern: Raw MCP Text-Content Envelope Construction #4326
Raw
map[string]interface{}construction for{"content":[{"type":"text","text":"..."}]}repeated in 4 locations across 3 files.Collaborator Permission Logging Block - Severity: Medium - See sub-issue [duplicate-code] Duplicate Code Pattern: Collaborator Permission Parse/Log/Wrap Block #4327
Near-identical 15-line permission-parse/log/wrap block duplicated across
internal/server/unified.goandinternal/proxy/proxy.go.Overall Impact
internal/server/unified.go,internal/proxy/proxy.go,internal/server/system_tools.go,internal/server/circuit_breaker.go)Next Steps
buildMCPTextResponsehelper ininternal/mcp/orinternal/server/Analysis Metadata