Skip to content

[duplicate-code] Duplicate Code Analysis Report #8551

Description

@github-actions

Summary

Analysis of commit d3050f7. Examined 146 non-test Go source files. The codebase is generally well-refactored (the recent commit #8507 specifically addressed 4 duplication findings). One significant duplication pattern meeting the >10-line threshold was identified.

Detected Patterns

This analysis found 1 significant duplication pattern:

  1. CompileToolResponseFilter / CompileToolResponseFilterWithVars in jqschema.go — Severity: Medium — See sub-issue [duplicate-code] Duplicate Code Pattern: jq filter compile pipeline duplicated in jqschema.go #8553

Overall Impact

  • Total Duplicated Lines: ~20 lines (structural near-duplication across 2 functions of 29 and 33 lines respectively)
  • Affected Files: 1 (internal/middleware/jqschema.go)
  • Maintainability Risk: Medium — any change to the parse/cache/compile pipeline (e.g., adding metrics, changing error messages, adjusting cache semantics) must be made in two places
  • Refactoring Priority: Low-Medium — the duplication is contained to a single file and the two functions are well-named

Next Steps

  1. Review the individual pattern sub-issue for detailed refactoring guidance
  2. Consider extracting a private compileFilterWithOpts helper as described in [duplicate-code] Duplicate Code Pattern: jq filter compile pipeline duplicated in jqschema.go #8553

Analysis Metadata

  • Analyzed Files: 146 Go files (non-test, internal/ packages)
  • Detection Method: Semantic code analysis — symbol-level inspection, pattern search, function-body comparison
  • Commit: d3050f7
  • Analysis Date: 2026-07-03 03:43 UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions