Skip to content

[duplicate-code] Duplicate Code Analysis Report #6728

@github-actions

Description

@github-actions

🔍 Duplicate Code Analysis Report

Analysis of latest commit on main

Summary

This analysis identified 3 significant duplication patterns across the Go codebase. Two are structural/copy-paste duplications in internal/proxy/ and internal/logger/, and one is a functional overlap between server transport setup files.

Detected Patterns

  1. Numeric Argument Extraction in restBackendCaller - Severity: Medium - See sub-issue [duplicate-code] Duplicate Code Pattern: Numeric Argument Extraction in restBackendCaller #6729
  2. Logger Level Function Boilerplate - Severity: Low - See sub-issue [duplicate-code] Duplicate Code Pattern: Logger Level Function Boilerplate Across Logger Types #6730
  3. buildMCPHandler Setup in Transport vs Routed Mode - Severity: Low - See sub-issue [duplicate-code] Duplicate Code Pattern: buildMCPHandler Setup in transport.go and routed.go #6731

Overall Impact

  • Total Duplicated Lines: ~50 lines across all patterns
  • Affected Files: 6 files (proxy/proxy.go, logger/file_logger.go, logger/markdown_logger.go, logger/server_file_logger.go, server/transport.go, server/routed.go)
  • Maintainability Risk: Medium — the proxy pattern is a clear copy-paste risk; logger and server setup patterns are structural but intentional
  • Refactoring Priority: Pattern 1 (proxy) is highest priority; patterns 2–3 are cosmetic/low-risk

Next Steps

  1. Review individual pattern sub-issues for detailed analysis
  2. Prioritize the proxy numeric argument extraction refactor (Pattern 1)
  3. Consider whether logger boilerplate reduction is worth additional abstraction complexity

Analysis Metadata

  • Analyzed Files: ~120 Go files changed in latest commit
  • Detection Method: Semantic code analysis (pattern search, structural comparison)
  • Analysis Date: 2026-05-30

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions