Skip to content

[duplicate-code] Duplicate Code Analysis Report #2983

@github-actions

Description

@github-actions

Analysis of commit 1631b99

Summary

Analysis of the latest commit (Go SDK usage improvements refactor) detected 1 significant duplication pattern across 2 files. The commit itself did an excellent job eliminating several instances of duplication (pagination helper, resourceContents type, cache eviction). The remaining pattern involves consumer code re-implementing config defaults that the config loading layer already guarantees.

Detected Patterns

  1. Config defaults re-implemented in consumers – Severity: Medium – See sub-issue [duplicate-code] Duplicate Code Pattern: Config defaults re-implemented in server and launcher consumers #2984

Overall Impact

  • Total Duplicated Lines: ~20 lines across internal/server/unified.go and internal/launcher/launcher.go
  • Affected Files: 2 files
  • Maintainability Risk: Medium — if a new field is added with a default in the config package but the consumer files are not updated, stale fallback logic silently takes over
  • Refactoring Priority: Medium — straightforward cleanup once confirmed safe

Next Steps

  1. Review sub-issue [duplicate-code] Duplicate Code Pattern: Config defaults re-implemented in server and launcher consumers #2984 for detailed analysis
  2. Verify config loading guarantees (that cfg.Gateway is always non-nil after loading) via test coverage
  3. Remove the redundant fallback blocks and rely on the config package's established defaults

Analysis Metadata

  • Analyzed Files: 87 non-test Go files changed in commit
  • Detection Method: Semantic pattern analysis (nil-guard + fallback default re-implementation)
  • Commit: 1631b99
  • Analysis Date: 2026-04-01

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