Skip to content

[duplicate-code] Duplicate Code Analysis Report #6070

@github-actions

Description

@github-actions

Summary

Analysis of commit 2b301a404f5573ad4eb198b7cfbf479d47b247d5 found 2 significant duplication patterns in the Go source files changed in this push. Both patterns exceed the 10-line threshold and represent structural duplication that affects maintainability.

Detected Patterns

This analysis found 2 significant duplication patterns:

  1. OpenTelemetry tracer field + span creation pattern — Severity: Medium — See sub-issue [duplicate-code] Duplicate Code Pattern: OTel Tracer Field and Span Creation in unified.go and proxy/handler.go #6071
  2. HTTP response writer status-code wrapper — Severity: Low-Medium — See sub-issue [duplicate-code] Duplicate Code Pattern: HTTP Response Writer Status-Code Wrapper in server and tracing packages #6072

Overall Impact

  • Total Duplicated Lines: ~45 lines across patterns
  • Affected Files: 4 files (internal/server/unified.go, internal/proxy/handler.go, internal/server/response_writer.go, internal/tracing/http.go)
  • Maintainability Risk: Medium — changes to OTel span attributes or response-writer behavior must be made in multiple places
  • Refactoring Priority: Low-Medium (non-blocking, but worthwhile on next refactor pass)

Next Steps

  1. Review individual pattern sub-issues for detailed analysis
  2. Prioritize refactoring based on severity and impact
  3. Create implementation plan for highest priority patterns

Analysis Metadata

  • Analyzed Files: ~110 Go files (non-test, non-workflow)
  • Detection Method: Semantic code analysis (grep + manual review)
  • Commit: 2b301a404f5573ad4eb198b7cfbf479d47b247d5
  • Analysis Date: 2026-05-20T03:40:11Z

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