Skip to content

[duplicate-code] Duplicate Code Analysis Report #1529

@github-actions

Description

@github-actions

Analysis of recent commits on main (HEAD: 18c5699)

Summary

Static analysis of the Go source files changed in the latest commit (18c5699) identified 3 significant duplication patterns in the internal/logger and internal/cmd packages. The most impactful is a ~15-line structural duplicate within a single function; the others are cross-file repetitions of the same delegation/lookup pattern.

Detected Patterns

  1. Duplicate RPCMessageInfo construction – Severity: Medium – See sub-issue #aw_rpc01
  2. Log-level quartet public API wrappers – Severity: Low – See sub-issue #aw_logquart
  3. getDefault*() flag helper functions – Severity: Low – See sub-issue #aw_flagdefault

Overall Impact

Metric Value
Total duplicated lines (approx.) ~55
Affected files 6
Maintainability risk Low–Medium
Refactoring priority Low (no correctness risk; maintainability improvement only)

The duplications are cosmetic rather than correctness-critical. The codebase already uses good abstractions (generic initGlobalLogger[T], logFuncs dispatch map) that could be extended slightly to eliminate the remaining patterns.

Next Steps

  1. Review sub-issues for detailed analysis and refactoring recommendations
  2. Address Pattern 1 first (highest line-count, easiest refactor)
  3. Patterns 2 and 3 are lower priority and can be bundled into a single clean-up PR

Analysis Metadata

  • Analyzed files: 68 Go source files (excluding *_test.go and test/ directory)
  • Detection method: Manual semantic analysis (grep + structural comparison)
  • Commit: 18c569988f5fd4dc7a68c31af24fa874ff82784b
  • Analysis date: 2026-03-01

Generated by Duplicate Code Detector

  • expires on Mar 8, 2026, 3:04 AM UTC

Sub-issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions