Public report — CLIProxyAPI, published 6 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 06-08-2026 @ 06:19 UTC Public
Code Health Audit

Router-For-Me/CLIProxyAPI

No baseline yet — first run
49% Weak
CriticalWeakAdequateStrongExemplary
upper third — near Adequate

Large · 175,679 LoC · rebuild ~2.0 person-years · weakest lens: Security (38%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

21/23dimensions tool-verifieddeterministic · confidence 1.0 · 2 LLM-assisted, advisory
1656findings with an exact file:lineof 1671 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
23/95dimensions across the health lenses175679 LoC — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

router-for-me/CLIProxyAPI carries serious gaps (49%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.

It is strongest in Architecture (99%) — the structure is clean and changes stay contained.

The area that most needs attention is Security (38%) — exposure to security and compliance incidents is elevated. Code Health (52%) is the next concern — changes there are slower and more error-prone.

Leadership focus, highest impact first: 47 High finding(s) (Static Analysis (SAST)); 7 Secret finding(s) (Secrets (history)); SAST step to CI running what this repository's stack ships (Security & performance tooling).

For scale: Large (~175,679 production lines); rebuilding it from scratch would take roughly ~2.0 person-years (~1–4 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (99%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Security 38% · 47% weightCode Health 52% · 26% weightReadiness 57% · 14% weightMaturity 64% · 8% weightArchitecture 99% · 4% weight

Raise Security 38 → 70 (the Healthy floor) ⇒ headline 49 → ~58.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €98,000–€490,000
Cost to rebuild€98,000–€490,000 (1.0–3.1 person-years (1,641–5,205 h), ~1–4 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 49% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~2.0 person-years of build effort (about ~€300,000 to rebuild). Its weakest lens is Security at 38% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 7 Secret finding(s) in Secrets (history) — start with api_tools.go (2), antigravity_executor.go, constants.go.
+7.5 pts · Low effort · Secrets (history)
2
Resolve the 47 High finding(s) in Static Analysis (SAST) — start with release.yaml (18), docker-image.yml (13), postgresstore.go (11).
+7.9 pts · Medium effort · Static Analysis (SAST)
3
Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
+3.8 pts · Medium effort · Security & performance tooling

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~2.0 person-years to rebuild), and its weakest lens is Security at 38%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~2.0 person-years rebuild (175,679 LoC) · weakest lens: Security 38%
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 344.2–2065.4 engineer-days every year, paid as drag on the ~1,461,460 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 9–21% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 360,360 line(s) changed over a 90-day window ⇒ ~1,461,460/year · D1/D2/D4 code quality: averaging 4.2/10 ⇒ a 9–21% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 47 High finding(s) in Static Analysis (SAST) — start with release.yaml (18), docker-image.yml (13), postgresstore.go (11). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 47 High finding(s) in Static Analysis (SAST) — start with release.yaml (18), docker-image.yml (13), postgresstore.go (11).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 4.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 9–21% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 4.2/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

120 modules, 249 dependencies — 1 dependency cycle, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

…7/internal/interfaces…/internal/pluginstore…v7/internal/signature…roxyAPI/v7/sdk/access…v7/sdk/cliproxy/usage…yAPI/v7/sdk/pluginapi…API/v7/sdk/translator…7/internal/auth/codex…/internal/homeplugins…l/watcher/synthesizer…LIProxyAPI/v7/sdk/api…sdk/cliproxy/executor…nal/client/codex/live…/v7/internal/thinking…I/v7/internal/watcher…I/v7/sdk/api/handlers…IProxyAPI/v7/sdk/auth…oxy/executionregistry…sdk/cliproxy/pipeline…untime/executor/helps…k/api/handlers/claude…k/api/handlers/gemini…rnal/runtime/executor…yAPI/v7/internal/home…API/v7/internal/cache…I/v7/internal/logging…k/api/handlers/openai…xyAPI/v7/internal/api…xyAPI/v7/sdk/cliproxy…/v7/internal/registry…7/internal/pluginhost…i/handlers/management…PI/v7/internal/config…timize-multi-agent-v2…xyAPI/v7/internal/cmd…/v7/sdk/cliproxy/auth…mples/custom-provider…ternal/api/middleware…internal/watcher/diff…API/v7/sdk/pluginhost…7/internal/interfaces1…/internal/pluginstore2…v7/internal/signature3…roxyAPI/v7/sdk/access4…v7/sdk/cliproxy/usage5…yAPI/v7/sdk/pluginapi6…API/v7/sdk/translator7…7/internal/auth/codex8…/internal/homeplugins9…l/watcher/synthesizer10…LIProxyAPI/v7/sdk/api11…sdk/cliproxy/executor12…nal/client/codex/live13…/v7/internal/thinking14…I/v7/internal/watcher15…I/v7/sdk/api/handlers16…IProxyAPI/v7/sdk/auth17…oxy/executionregistry18…sdk/cliproxy/pipeline19…untime/executor/helps20…k/api/handlers/claude21…k/api/handlers/gemini22…rnal/runtime/executor23…yAPI/v7/internal/home24…API/v7/internal/cache25…I/v7/internal/logging26…k/api/handlers/openai27…xyAPI/v7/internal/api28…xyAPI/v7/sdk/cliproxy29…/v7/internal/registry30…7/internal/pluginhost31…i/handlers/management32…PI/v7/internal/config33…timize-multi-agent-v234…xyAPI/v7/internal/cmd35…/v7/sdk/cliproxy/auth36…mples/custom-provider37…ternal/api/middleware38…internal/watcher/diff39…API/v7/sdk/pluginhost401142356121141451322342811622327141162725121253312418742121730212415242541811131131141154152110612132121121131342212333253622517121211755114168591533131013155491111111422811044112143218111311311415931521011111012232+80 more modules (most-connected shown)

At a glance — Code Health · 52% · Adequate · gated by D1, D2

At a glance — Architecture · 99% · Exemplary

At a glance — Maturity · 64% · Adequate · gated by M2

At a glance — Readiness · 57% · Adequate · gated by P3

At a glance — Security · 38% · Weak · gated by D28, D29, D36

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2021 — Injection50High / Critical
A02:2021 — Cryptographic Failures8High / Critical
A05:2021 — Security Misconfiguration3High / Critical
A06:2021 — Vulnerable & Outdated Components3Medium

Roadmap

Begin by resolving the 47 high-priority static analysis findings, focusing first on release.yaml, docker-image.yml, and postgresstore.go. Next, address the seven historical secret exposures in api_tools.go, antigravity_executor.go, and constants.go. To prevent future regressions, integrate a SAST step into the CI pipeline to fail the build on new security issues. Finally, implement health checks for deployed services and document key architectural decisions to ensure stable, auditable releases.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 7 Secret finding(s) in Secrets (history) — start with api_tools.go (2), antigravity_executor.go, constants.go.+7.5 ptsLowSecrets (history)
Resolve the 47 High finding(s) in Static Analysis (SAST) — start with release.yaml (18), docker-image.yml (13), postgresstore.go (11).+7.9 ptsMediumStatic Analysis (SAST)
Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.8 ptsMediumSecurity & performance tooling
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.+3.8 ptsMediumDeployment & Rollback
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with Dockerfile.+1.9 ptsLowIaC & Container Security
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing.+1.9 ptsLowSupply-chain Provenance & Signing
Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing.+1.9 ptsLowSupply-chain Provenance & Signing
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing.+1.9 ptsLowSupply-chain Provenance & Signing

File quality

Per-file score 0–10 — a quality signature. Of 334 files carrying findings, judged against the Production bar: 1% slop · 75% mixed · 24% near-clean.

FileScoreBandWorst signal
internal/store/postgresstore.go1.6SlopStatic Analysis (SAST): High: string-formatted-query
internal/api/handlers/management/auth_files.go2.7SlopSecrets (history): Secret: generic-api-key
internal/api/handlers/management/api_tools.go2.8SlopSecrets (history): Secret: generic-api-key
.github/workflows/docker-image.yml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/release.yaml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
Dockerfile4.4MixedIaC & Container Security: High IaC: DS-0002
sdk/auth/antigravity.go4.6MixedSecrets (history): Secret: generic-api-key
internal/runtime/executor/antigravity_executor.go4.6MixedSecrets (history): Secret: generic-api-key
sdk/cliproxy/auth/conductor_selection.go4.9MixedStatic Analysis (SAST): Medium: math-random-used
internal/runtime/executor/antigravity_executor_credits.go4.9MixedStatic Analysis (SAST): Medium: math-random-used
internal/store/postgres_cooldown_store.go5.0MixedStatic Analysis (SAST): High: string-formatted-query
internal/watcher/synthesizer/config.go5.0MixedChange Coupling: Boundary-crossing change coupling: config.go ↔ service.go
.github/workflows/pr-path-guard.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
internal/watcher/diff/config_diff.go6.3MixedCyclomatic Complexity: diff.BuildConfigChangeDetails (cyclomatic 125)
go.mod6.3MixedOSV Dependency Vulnerabilities: Medium vulnerability: GO-2026-5841
internal/translator/antigravity/claude/antigravity_claude_request.go7.0MixedCyclomatic Complexity: claude.ConvertClaudeRequestToAntigravity (cyclomatic 195)
internal/translator/gemini/openai/responses/gemini_openai-responses_response.go7.0MixedCyclomatic Complexity: responses.ConvertGeminiResponseToOpenAIResponses (cyclomatic 165)
internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go7.0MixedCyclomatic Complexity: chat_completions.ConvertOpenAIRequestToAntigravity (cyclomatic 126)
internal/translator/claude/openai/responses/claude_openai-responses_response.go7.0MixedCyclomatic Complexity: responses.ConvertClaudeResponseToOpenAIResponses (cyclomatic 91)
sdk/cliproxy/service_models.go7.0MixedCyclomatic Complexity: Service.registerModelsForAuthWithCache (cyclomatic 83)

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 21 of 23 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 23 dimensions across the health lenses
D1D2D3D4D13D15D16D19D21D28D29D31D34D35D36D38M1M2M3M4P1P3P4

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1656 of 1671 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019fd5b9-db83-7c17-8bb9-50a4e719ce13.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".

The LLM boundary

LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

412 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was claude.ConvertClaudeRequestToAntigravity at 195. A further 4 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being pluginhost.validPlugin at 24 — they are counted neither in the figure above nor in this dimension's score.

Applier.Apply (cyclomatic 16) · ×2internal/thinking/provider/codex/apply.go:44
claude.ConvertClaudeRequestToAntigravity (cyclomatic 195)internal/translator/antigravity/claude/antigravity_claude_request.go:318
responses.ConvertGeminiResponseToOpenAIResponses (cyclomatic 165)internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:118
main.main (cyclomatic 137)cmd/server/main.go:72
chat_completions.ConvertOpenAIRequestToAntigravity (cyclomatic 126)internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:30

+ 406 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 Applier.Apply (cyclomatic 16) finding(s) in Cyclomatic Complexity — start with apply.go (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 claude.ConvertClaudeRequestToAntigravity (cyclomatic 195) finding(s) in Cyclomatic Complexity — start with antigravity_claude_request.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 responses.ConvertGeminiResponseToOpenAIResponses (cyclomatic 165) finding(s) in Cyclomatic Complexity — start with gemini_openai-responses_response.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

629 method(s) exceeded the cognitive complexity threshold of 15; the worst was claude.ConvertClaudeRequestToAntigravity at 579.

Applier.Apply (cognitive 16) · ×2internal/thinking/provider/codex/apply.go:44
claude.ConvertClaudeRequestToAntigravity (cognitive 579)internal/translator/antigravity/claude/antigravity_claude_request.go:318
chat_completions.ConvertOpenAIRequestToAntigravity (cognitive 383)internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:30
chat_completions.ConvertOpenAIRequestToCodex (cognitive 379)internal/translator/codex/openai/chat-completions/codex_openai_request.go:30
chat_completions.ConvertOpenAIRequestToGemini (cognitive 377)internal/translator/gemini/openai/chat-completions/gemini_openai_request.go:29

+ 623 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 Applier.Apply (cognitive 16) finding(s) in Cognitive Complexity — start with apply.go (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 claude.ConvertClaudeRequestToAntigravity (cognitive 579) finding(s) in Cognitive Complexity — start with antigravity_claude_request.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 chat_completions.ConvertOpenAIRequestToAntigravity (cognitive 383) finding(s) in Cognitive Complexity — start with antigravity_openai_request.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.1 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 8.1 / 10 · rule-coverage 100% · ceiling Prevented

71 god class(es) detected.

FileTooLong: openai/openai_images_handlers.go · ×61sdk/api/handlers/openai/openai_images_handlers.go:0
TooManyMethods: Handler · ×10internal/api/handlers/management/handler.go:40

What to do

  1. Resolve the 61 FileTooLong finding(s) in God Classes — start with openai_images_handlers.go, antigravity_reasoning_replay.go, client.go. — One of this dimension's main actionable groups (61 warning-level).
  2. Resolve the 10 TooManyMethods finding(s) in God Classes — start with client.go (2), handler.go, host.go. — One of this dimension's main actionable groups (10 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication8.7 / 10Strong✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Verified

464 duplicated block group(s) detected.

Duplicated block (10 lines × 2) · ×58internal/api/handlers/management/auth_files_provider_oauth.go:468
Duplicated block (8 lines × 2) · ×55examples/plugin/claude-web-search-router/go/execution_fallback.go:145
Duplicated block (9 lines × 2) · ×54internal/api/handlers/management/api_tools.go:610
Duplicated block (11 lines × 2) · ×44examples/plugin/claude-web-search-router/go/execution_fallback.go:173
Duplicated block (7 lines × 2) · ×37internal/auth/codex/openai_auth.go:170

+ 36 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 58 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with gemini_vertex_executor.go (4), antigravity_openai_request.go (4), codex_openai_images.go (3). — One of this dimension's main actionable groups (58 warning-level).
  2. Resolve the 55 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with codex_reasoning_replay_cache.go (3), adapters_executors.go (2), adapters_interceptors.go (2). — One of this dimension's main actionable groups (55 warning-level).
  3. Resolve the 54 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with config_lists.go (4), claude_executor_request.go (2), openai_compat_executor.go (2). — One of this dimension's main actionable groups (54 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.3 / 10Exemplary✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: DocumentedVerifiedPrevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: cmd/server/main.go (21×137=2877); internal/translator/antigravity/claude/antigravity_claude_request.go (14×195=2730); internal/watcher/diff/config_diff.go (17×125=2125)

Hotspot: cmd/server/main.go · ×10cmd/server/main.go

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor8.2 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: DocumentedVerifiedPrevented · effective 8.2 / 10 · rule-coverage 100% · ceiling Documented

72 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is sdk/api/handlers/openai/openai_images_handlers.go.

Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)

What to do

  1. Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality / 10Exemplary◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

CLIProxyAPI's documentation is exemplary: the README and architecture/plugin directories are both complete, well-organized, and rich in content. The README covers CLI Proxy API with a sponsor section, an overview of supported providers (Kimi/K3, OpenAI GPT series), and a detailed table describing each provider's features plus links to K3 Quickstart and the Kimi Open Platform. A dedicated plugin directory lists every capability type with subdirectories for Go/C/Rust implementations, covers ABI layout, entry-point conventions, JSON-envelope formats, capabilities declarations, and an exhaustive scheduler/plugin example that includes configuration, behavior, build, and RPC method references. The SDK Watcher integration doc is concise but thorough, covering the AuthUpdate contract, watcher behavior (currentAuths snapshotting, auth-id-based merging), high-frequency handling (independent distribution loops, two-tier buffering), and a clear four-step deployment flow. The SDK documentation is comprehensive, well-organized, and complete for both the watcher integration (queue contract, shadow snapshot, dispatch buffer) and the CLI proxy module (installation/import, minimal embed, server options, embedded management API), with a dedicated advanced guide covering provider executors, translators, model registration, and access control.

The README briefly mentions 'CLIProxyAPI Tray' but does not describe what the tray does or how to configure it.README.md
The high-frequency handling section mentions 'ensureAuthUpdateQueue' and 'consumeAuthUpdates', but there is no link to where that code lives in the repo.docs/sdk-watcher_CN.md
The minimal embed example uses `WithConfigPath(docs/sdk-usage_CN.md

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

11 finding(s): 0 critical, 11 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

Secret: generic-api-key · ×7internal/runtime/executor/antigravity_executor.go:36detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

What to do

  1. Resolve the 7 Secret finding(s) in Secrets (history) — start with api_tools.go (2), antigravity_executor.go, constants.go. — One of this dimension's main actionable groups (7 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

119 finding(s): 0 critical, 47 high, 2 medium, 70 low.

High: github-actions-mutable-action-tag · ×47.github/workflows/agents-md-guard.yml:20detected by semgrep finding
Medium: math-random-used · ×2internal/runtime/executor/antigravity_executor_credits.go:9detected by semgrep finding
Low: use-of-unsafe-blockexamples/plugin/auth/go/main.go:171detected by semgrep finding

What to do

  1. Resolve the 47 High finding(s) in Static Analysis (SAST) — start with release.yaml (18), docker-image.yml (13), postgresstore.go (11). — One of this dimension's main actionable groups (47 issue-level).
  2. Resolve the 2 Medium finding(s) in Static Analysis (SAST) — start with antigravity_executor_credits.go, conductor_selection.go. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 Low finding(s) in Static Analysis (SAST) — start with main.go. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security9.5 / 10Exemplary✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

3 finding(s): 0 critical, 1 high, 1 medium, 1 low.

High IaC: DS-0002Dockerfiledetected by trivy finding
Medium IaC: CKV_DOCKER_3Dockerfile:1detected by trivy finding
Low IaC: DS-0026Dockerfiledetected by trivy finding

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

2 of 421 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is internal/tui/styles.go.

Further orphaned files (smaller)

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: auth_files.go↔oauth_sessions.go 73%; codex_executor.go↔types.go 50%; config.go↔service.go 50%

Boundary-crossing change coupling: codex_executor.go ↔ types.go · ×2internal/runtime/executor/codex_executor.go
Change coupling: auth_files.go ↔ oauth_sessions.go · ×2internal/api/handlers/management/auth_files.go

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

Unpinned build actions
PR-triggered workflow without a permissions block
No build provenance
No artifact signing
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D38 · OSV Dependency Vulnerabilities9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.

Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.

Maturity: DocumentedVerifiedPrevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

3 finding(s): 0 critical, 0 high, 3 medium, 0 low.

Medium vulnerability: GO-2026-5841 · ×2go.moddetected by osv-scanner finding
Medium CVE: GO-2026-4599go.moddetected by osv-scanner finding

✓ On the Gold path — maintain.

Detailed fixes: d38_recommendation.md · top locations in Appendix A, every location in findings.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 37 of 37 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P3 · Security & performance tooling2.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add gosec / govulncheck (or golangci-lint) (or `semgrep --config=auto`, which runs on any language) as a CI step.

What to do

  • Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • Deployment is orchestrated by compose, and the service already exposes health probe endpoints (healthz/livez/readyz or a container healthcheck), but no compose service declares a `healthcheck:` that uses them and nothing pins a previous image to fall back to — so a release that starts but does not serve looks healthy, and reversing it is a manual step.

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health52%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99%ExemplaryStrongest area.
Maturity64%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness57%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security38%Weak — gated by D28, D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 72 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over a document set that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~144821 lines of test source are present (.go, .rs) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Go module (go.mod/go.sum)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.go, .py) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Go module (go.mod/go.sum) — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is mostly .go, .py, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.go, .rs) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — applicable but not scored (2 of 2 signals for this style — below the bar we score at): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 1 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this check looks for (2 event-sourced shape(s) (event folds / event-recording aggregates))
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this check looks for (2 Go aggregate(s) recording domain events (own events-slice append / raise-record))
  • GD1 Unfinished & placeholder code — no source files
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Issue — 57 finding(s)
D29 · Static Analysis (SAST) · High · ×47
  • High: github-actions-mutable-action-tag .github/workflows/agents-md-guard.yml:20 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v7`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/auto-retarget-main-pr-to-dev.yml:23 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v7`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:17 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:19 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:26 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/setup-buildx-action@<40-character SHA>`. This step references `docker/setup-buildx-action@v3`; resolve the SHA it points at today with `gh api repos/docker/setup-buildx-action/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:28 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/login-action@<40-character SHA>`. This step references `docker/login-action@v3`; resolve the SHA it points at today with `gh api repos/docker/login-action/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:38 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/build-push-action@<40-character SHA>`. This step references `docker/build-push-action@v6`; resolve the SHA it points at today with `gh api repos/docker/build-push-action/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:55 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:57 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:64 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/setup-buildx-action@<40-character SHA>`. This step references `docker/setup-buildx-action@v3`; resolve the SHA it points at today with `gh api repos/docker/setup-buildx-action/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:66 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/login-action@<40-character SHA>`. This step references `docker/login-action@v3`; resolve the SHA it points at today with `gh api repos/docker/login-action/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:76 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/build-push-action@<40-character SHA>`. This step references `docker/build-push-action@v6`; resolve the SHA it points at today with `gh api repos/docker/build-push-action/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:96 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:98 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/setup-buildx-action@<40-character SHA>`. This step references `docker/setup-buildx-action@v3`; resolve the SHA it points at today with `gh api repos/docker/setup-buildx-action/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docker-image.yml:100 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/login-action@<40-character SHA>`. This step references `docker/login-action@v3`; resolve the SHA it points at today with `gh api repos/docker/login-action/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/pr-path-guard.yml:14 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/pr-path-guard.yml:19 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: tj-actions/changed-files@<40-character SHA>`. This step references `tj-actions/changed-files@v45`; resolve the SHA it points at today with `gh api repos/tj-actions/changed-files/commits/v45 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:20 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:127 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:130 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:140 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/cache@<40-character SHA>`. This step references `actions/cache@v4`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:186 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:254 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:257 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yaml:322 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
  • + 22 more in this group — see findings.md.
D28 · Secrets (history) · Secret · ×7
  • Secret: generic-api-key internal/runtime/executor/antigravity_executor.go:36 — matched rule 'generic-api-key'
  • Secret: generic-api-key internal/auth/antigravity/constants.go:7 — matched rule 'generic-api-key'
  • Secret: generic-api-key internal/api/handlers/management/api_tools.go:24 — matched rule 'generic-api-key'
  • Secret: generic-api-key internal/api/handlers/management/api_tools.go:27 — matched rule 'generic-api-key'
  • Secret: generic-api-key sdk/auth/antigravity.go:23 — matched rule 'generic-api-key'
  • Secret: generic-api-key internal/api/handlers/management/auth_files.go:286 — matched rule 'generic-api-key'
  • Secret: generic-api-key internal/auth/auth.go:23 — matched rule 'generic-api-key'
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: codex_executor.go ↔ types.go internal/runtime/executor/codex_executor.go — `internal/runtime/executor/codex_executor.go` (context internal) and `sdk/cliproxy/executor/types.go` (context sdk) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: config.go ↔ service.go internal/watcher/synthesizer/config.go — `internal/watcher/synthesizer/config.go` (context internal) and `sdk/cliproxy/service.go` (context sdk) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
D31 · IaC & Container Security · High IaC · ×1
  • High IaC: DS-0002 Dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN adduser --system --no-create-home app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
Warning — 1596 finding(s)
D3 · God Classes · FileTooLong · ×61
  • FileTooLong: openai/openai_images_handlers.go sdk/api/handlers/openai/openai_images_handlers.go:0 — FileTooLong — 1349 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/antigravity_reasoning_replay.go internal/runtime/executor/antigravity_reasoning_replay.go:0 — FileTooLong — 1346 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: home/client.go internal/home/client.go:0 — FileTooLong — 1313 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: store/gitstore.go internal/store/gitstore.go:0 — FileTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: management/config_lists.go internal/api/handlers/management/config_lists.go:0 — FileTooLong — 1225 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/xai_websockets_executor.go internal/runtime/executor/xai_websockets_executor.go:0 — FileTooLong — 1187 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: auth/conductor_cooldown.go sdk/cliproxy/auth/conductor_cooldown.go:0 — FileTooLong — 1186 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/claude_executor_request.go internal/runtime/executor/claude_executor_request.go:0 — FileTooLong — 1009 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: auth/conductor_selection.go sdk/cliproxy/auth/conductor_selection.go:0 — FileTooLong — 966 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: interactions/interactions_gemini_common.go internal/translator/gemini/interactions/interactions_gemini_common.go:0 — FileTooLong — 944 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: auth/conductor_execution.go sdk/cliproxy/auth/conductor_execution.go:0 — FileTooLong — 901 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: management/logs.go internal/api/handlers/management/logs.go:0 — FileTooLong — 894 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: responses/gemini_openai-responses_response.go internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:0 — FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: registry/model_registry.go internal/registry/model_registry.go:0 — FileTooLong — 830 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: auth/conductor_home.go sdk/cliproxy/auth/conductor_home.go:0 — FileTooLong — 828 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/claude_executor_cloaking.go internal/runtime/executor/claude_executor_cloaking.go:0 — FileTooLong — 823 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/codex_openai_images.go internal/runtime/executor/codex_openai_images.go:0 — FileTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: helps/usage_helpers.go internal/runtime/executor/helps/usage_helpers.go:0 — FileTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: responses/interactions_openai_responses_response.go internal/translator/openai/interactions/responses/interactions_openai_responses_response.go:0 — FileTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/gemini_vertex_executor.go internal/runtime/executor/gemini_vertex_executor.go:0 — FileTooLong — 776 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: responses/claude_openai-responses_response.go internal/translator/claude/openai/responses/claude_openai-responses_response.go:0 — FileTooLong — 771 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: executor/xai_executor_request.go internal/runtime/executor/xai_executor_request.go:0 — FileTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: auth/scheduler.go sdk/cliproxy/auth/scheduler.go:0 — FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: responses/claude_openai-responses_request.go internal/translator/claude/openai/responses/claude_openai-responses_request.go:0 — FileTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: openai/openai_videos_handlers.go sdk/api/handlers/openai/openai_videos_handlers.go:0 — FileTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 36 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×58
  • Duplicated block (10 lines × 2) internal/api/handlers/management/auth_files_provider_oauth.go:468 — internal/api/handlers/management/auth_files_provider_oauth.go:468-477 | sdk/auth/antigravity.go:197-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/auth_files_provider_oauth.go:468` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/api/handlers/management/config_basic.go:210 — internal/api/handlers/management/config_basic.go:210-219 | internal/api/handlers/management/config_basic.go:230-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/config_basic.go:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/api/handlers/management/logs.go:234 — internal/api/handlers/management/logs.go:234-243 | internal/logging/request_logger_writer.go:363-372 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/homeplugins/sync.go:152 — internal/homeplugins/sync.go:152-161 | internal/homeplugins/sync.go:257-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/homeplugins/sync.go:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) internal/homeplugins/sync.go:517 — internal/homeplugins/sync.go:517-526 | internal/pluginstore/install.go:421-430 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/homeplugins/sync.go:517` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/pluginhost/adapters.go:404 — internal/pluginhost/adapters.go:404-413 | internal/pluginhost/auth_provider.go:374-383 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters.go:404` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/pluginhost/adapters_executors.go:48 — internal/pluginhost/adapters_executors.go:48-57 | internal/pluginhost/adapters_executors.go:90-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_executors.go:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/pluginhost/adapters_usage_translation.go:283 — internal/pluginhost/adapters_usage_translation.go:283-292 | internal/pluginhost/adapters_usage_translation.go:307-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_usage_translation.go:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/pluginhost/adapters_usage_translation.go:333 — internal/pluginhost/adapters_usage_translation.go:333-342 | internal/pluginhost/adapters_usage_translation.go:359-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_usage_translation.go:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/pluginhost/auth_callbacks.go:528 — internal/pluginhost/auth_callbacks.go:528-537 | internal/api/handlers/management/auth_files.go:540-549 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/auth_callbacks.go:528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/pluginhost/config.go:49 — internal/pluginhost/config.go:49-59 | sdk/cliproxy/home_plugins.go:261-270 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/config.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/runtime/executor/aistudio_executor.go:400 — internal/runtime/executor/aistudio_executor.go:400-409 | internal/runtime/executor/claude_executor_tokens.go:221-230 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/aistudio_executor.go:400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/runtime/executor/antigravity_reasoning_replay.go:1456 — internal/runtime/executor/antigravity_reasoning_replay.go:1456-1465 | internal/runtime/executor/antigravity_reasoning_replay.go:1488-1497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_reasoning_replay.go:1456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/runtime/executor/claude_executor_cloaking.go:445 — internal/runtime/executor/claude_executor_cloaking.go:445-454 | internal/runtime/executor/claude_executor_cloaking.go:512-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) internal/runtime/executor/codex_executor_reasoning.go:746 — internal/runtime/executor/codex_executor_reasoning.go:746-755 | internal/translator/codex/claude/codex_claude_request.go:408-417 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_reasoning.go:746` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/runtime/executor/codex_executor_terminal.go:82 — internal/runtime/executor/codex_executor_terminal.go:82-91 | internal/runtime/executor/xai_executor_response.go:817-826 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_terminal.go:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/runtime/executor/codex_openai_images.go:94 — internal/runtime/executor/codex_openai_images.go:94-103 | internal/runtime/executor/codex_openai_images.go:191-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/runtime/executor/codex_openai_images.go:932 — internal/runtime/executor/codex_openai_images.go:932-941 | sdk/api/handlers/openai/openai_images_handlers.go:442-451 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:932` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/runtime/executor/codex_openai_images.go:943 — internal/runtime/executor/codex_openai_images.go:943-952 | sdk/api/handlers/openai/openai_images_handlers.go:453-463 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:943` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/runtime/executor/codex_websockets_session.go:435 — internal/runtime/executor/codex_websockets_session.go:435-444 | internal/runtime/executor/xai_websockets_executor.go:1066-1075 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:435` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:400 — internal/runtime/executor/gemini_vertex_executor.go:400-409 | internal/runtime/executor/gemini_vertex_executor.go:525-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:591 — internal/runtime/executor/gemini_vertex_executor.go:591-600 | internal/runtime/executor/gemini_vertex_executor.go:740-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_vertex_executor.go:591` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:649 — internal/runtime/executor/gemini_vertex_executor.go:649-658 | internal/runtime/executor/gemini_vertex_executor.go:795-804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_vertex_executor.go:649` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:911 — internal/runtime/executor/gemini_vertex_executor.go:911-920 | internal/runtime/executor/gemini_vertex_executor.go:1002-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/runtime/executor/openai_compat_executor.go:150 — internal/runtime/executor/openai_compat_executor.go:150-159 | internal/runtime/executor/openai_compat_executor.go:358-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 33 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×55
  • Duplicated block (8 lines × 2) examples/plugin/claude-web-search-router/go/execution_fallback.go:145 — examples/plugin/claude-web-search-router/go/execution_fallback.go:145-152 | examples/plugin/claude-web-search-router/go/execution_fallback.go:157-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/api/handlers/management/api_tools.go:602 — internal/api/handlers/management/api_tools.go:602-609 | sdk/cliproxy/auth/conductor_models.go:872-879 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/api_tools.go:602` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) internal/api/handlers/management/auth_files_provider_oauth.go:610 — internal/api/handlers/management/auth_files_provider_oauth.go:610-617 | internal/api/handlers/management/auth_files_provider_oauth.go:708-715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/auth_files_provider_oauth.go:610` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/api/handlers/management/plugins.go:702 — internal/api/handlers/management/plugins.go:702-709 | internal/pluginhost/config.go:210-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/plugins.go:702` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/auth/kimi/kimi.go:189 — internal/auth/kimi/kimi.go:189-196 | internal/auth/kimi/kimi.go:379-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/kimi/kimi.go:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/cache/codex_reasoning_replay_cache.go:267 — internal/cache/codex_reasoning_replay_cache.go:267-274 | internal/cache/xai_reasoning_replay_cache.go:164-171 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cache/codex_reasoning_replay_cache.go:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/cache/codex_reasoning_replay_cache.go:419 — internal/cache/codex_reasoning_replay_cache.go:419-426 | internal/cache/xai_reasoning_replay_cache.go:340-347 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) internal/cache/codex_reasoning_replay_cache.go:434 — internal/cache/codex_reasoning_replay_cache.go:434-441 | internal/cache/xai_reasoning_replay_cache.go:355-362 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cache/codex_reasoning_replay_cache.go:434` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/cmd/openai_login.go:56 — internal/cmd/openai_login.go:56-63 | internal/cmd/openai_device_login.go:44-51 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cmd/openai_login.go:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/config/vertex_compat.go:92 — internal/config/vertex_compat.go:92-99 | internal/config/config_normalization.go:185-192 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) internal/homeplugins/sync.go:576 — internal/homeplugins/sync.go:576-583 | internal/pluginhost/platform.go:48-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/homeplugins/sync.go:576` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/pluginhost/adapters_executors.go:702 — internal/pluginhost/adapters_executors.go:702-709 | internal/pluginhost/auth_provider.go:349-356 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_executors.go:702` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/pluginhost/adapters_executors.go:716 — internal/pluginhost/adapters_executors.go:716-723 | internal/pluginhost/auth_provider.go:363-370 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_executors.go:716` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) internal/pluginhost/adapters_interceptors.go:177 — internal/pluginhost/adapters_interceptors.go:177-184 | internal/pluginhost/adapters_interceptors.go:209-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_interceptors.go:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/pluginhost/adapters_interceptors.go:475 — internal/pluginhost/adapters_interceptors.go:475-482 | internal/pluginhost/adapters_interceptors.go:485-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_interceptors.go:475` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/runtime/executor/aistudio_executor.go:274 — internal/runtime/executor/aistudio_executor.go:274-281 | internal/runtime/executor/aistudio_executor.go:339-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/aistudio_executor.go:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/runtime/executor/aistudio_executor.go:455 — internal/runtime/executor/aistudio_executor.go:455-462 | internal/runtime/executor/gemini_vertex_executor.go:323-331 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) internal/runtime/executor/antigravity_reasoning_replay.go:160 — internal/runtime/executor/antigravity_reasoning_replay.go:160-167 | sdk/cliproxy/session/identity.go:473-480 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_reasoning_replay.go:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/runtime/executor/antigravity_reasoning_replay.go:547 — internal/runtime/executor/antigravity_reasoning_replay.go:547-554 | internal/runtime/executor/antigravity_reasoning_replay.go:1380-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_reasoning_replay.go:547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/runtime/executor/codex_openai_images.go:987 — internal/runtime/executor/codex_openai_images.go:987-994 | sdk/api/handlers/openai/openai_images_handlers.go:1665-1672 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:987` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/runtime/executor/codex_openai_images.go:1034 — internal/runtime/executor/codex_openai_images.go:1034-1041 | sdk/api/handlers/openai/openai_images_handlers.go:1705-1712 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:1034` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/runtime/executor/codex_websockets_session.go:188 — internal/runtime/executor/codex_websockets_session.go:188-196 | internal/runtime/executor/xai_websockets_executor.go:1151-1158 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:858 — internal/runtime/executor/gemini_vertex_executor.go:858-865 | internal/runtime/executor/gemini_vertex_executor.go:949-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/runtime/executor/openai_compat_executor.go:93 — internal/runtime/executor/openai_compat_executor.go:93-100 | internal/runtime/executor/openai_compat_executor.go:308-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) internal/runtime/executor/openai_compat_executor.go:215 — internal/runtime/executor/openai_compat_executor.go:215-222 | internal/runtime/executor/openai_compat_executor.go:496-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • + 30 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×54
  • Duplicated block (9 lines × 2) internal/api/handlers/management/api_tools.go:610 — internal/api/handlers/management/api_tools.go:610-619 | sdk/cliproxy/auth/conductor_models.go:880-888 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/api_tools.go:610` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/api/handlers/management/auth_files_provider_oauth.go:668 — internal/api/handlers/management/auth_files_provider_oauth.go:668-676 | sdk/auth/kimi.go:90-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/auth_files_provider_oauth.go:668` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/api/handlers/management/logs.go:630 — internal/api/handlers/management/logs.go:630-638 | internal/api/handlers/management/logs.go:1181-1189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:630` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/api/handlers/management/plugin_store.go:137 — internal/api/handlers/management/plugin_store.go:137-145 | internal/api/handlers/management/plugin_store.go:243-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/plugin_store.go:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/api/middleware/request_logging.go:373 — internal/api/middleware/request_logging.go:373-381 | internal/api/middleware/request_logging.go:405-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/middleware/request_logging.go:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/api/server_routes.go:383 — internal/api/server_routes.go:383-391 | internal/client/codex/live/live.go:290-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/server_routes.go:383` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/httpfetch/httpfetch.go:50 — internal/httpfetch/httpfetch.go:50-58 | internal/pluginstore/github.go:275-283 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/httpfetch/httpfetch.go:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/pluginhost/adapters_executors.go:652 — internal/pluginhost/adapters_executors.go:652-660 | internal/pluginhost/adapters_executors.go:778-786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_executors.go:652` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/pluginhost/host.go:218 — internal/pluginhost/host.go:218-227 | internal/pluginhost/host.go:232-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/host.go:218` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/pluginstore/github.go:69 — internal/pluginstore/github.go:69-77 | internal/pluginstore/github.go:96-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginstore/github.go:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/runtime/executor/claude_executor.go:239 — internal/runtime/executor/claude_executor.go:239-247 | internal/runtime/executor/codex_executor_request.go:67-75 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/runtime/executor/claude_executor_request.go:1351 — internal/runtime/executor/claude_executor_request.go:1351-1359 | internal/runtime/executor/claude_executor_request.go:1537-1545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/runtime/executor/claude_executor_request.go:1405 — internal/runtime/executor/claude_executor_request.go:1405-1413 | internal/runtime/executor/claude_executor_request.go:1585-1593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1405` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/runtime/executor/codex_executor_terminal.go:37 — internal/runtime/executor/codex_executor_terminal.go:37-45 | internal/runtime/executor/xai_executor_response.go:803-811 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (9 lines × 2) internal/runtime/executor/codex_openai_images.go:226 — internal/runtime/executor/codex_openai_images.go:226-234 | internal/runtime/executor/codex_openai_images.go:417-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) internal/runtime/executor/codex_websockets_session.go:658 — internal/runtime/executor/codex_websockets_session.go:658-666 | internal/runtime/executor/xai_websockets_executor.go:1354-1362 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (9 lines × 2) internal/runtime/executor/gemini_executor.go:731 — internal/runtime/executor/gemini_executor.go:731-739 | internal/runtime/executor/gemini_vertex_executor.go:1114-1122 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_executor.go:731` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/runtime/executor/openai_compat_executor.go:231 — internal/runtime/executor/openai_compat_executor.go:231-239 | internal/runtime/executor/openai_compat_executor.go:512-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/runtime/executor/openai_compat_executor.go:740 — internal/runtime/executor/openai_compat_executor.go:740-748 | sdk/api/handlers/openai/openai_images_handlers.go:523-531 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:740` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/runtime/executor/xai_executor_request.go:1048 — internal/runtime/executor/xai_executor_request.go:1048-1056 | internal/runtime/executor/xai_executor_response.go:92-100 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/xai_executor_request.go:1048` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/signature/claude.go:25 — internal/signature/claude.go:25-33 | internal/signature/claude_messages_sanitize.go:76-86 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/signature/claude.go:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/store/gitstore.go:676 — internal/store/gitstore.go:676-684 | sdk/auth/filestore.go:340-348 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:676` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/thinking/provider/antigravity/apply.go:41 — internal/thinking/provider/antigravity/apply.go:41-49 | internal/thinking/provider/gemini/apply.go:65-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/antigravity/apply.go:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:340 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:340-348 | internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:357-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:103 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:103-111 | internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:118-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 29 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×44
  • Duplicated block (11 lines × 2) examples/plugin/claude-web-search-router/go/execution_fallback.go:173 — examples/plugin/claude-web-search-router/go/execution_fallback.go:173-183 | examples/plugin/claude-web-search-router/go/stream_forward.go:77-87 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/plugin/claude-web-search-router/go/execution_fallback.go:173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/api/handlers/management/auth_files_provider_oauth.go:156 — internal/api/handlers/management/auth_files_provider_oauth.go:156-166 | sdk/auth/claude.go:207-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/auth_files_provider_oauth.go:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/api/handlers/management/logs.go:262 — internal/api/handlers/management/logs.go:262-272 | internal/api/handlers/management/logs.go:349-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/api/handlers/management/logs.go:334 — internal/api/handlers/management/logs.go:334-344 | internal/api/handlers/management/logs.go:390-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/api/handlers/management/plugin_store.go:902 — internal/api/handlers/management/plugin_store.go:902-912 | internal/homeplugins/sync.go:791-801 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/plugin_store.go:902` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/api/server_routes.go:421 — internal/api/server_routes.go:421-431 | internal/client/codex/live/live.go:317-327 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/server_routes.go:421` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/api/server_routes.go:609 — internal/api/server_routes.go:609-619 | internal/api/server_routes.go:676-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/server_routes.go:609` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/auth/claude/oauth_server.go:232 — internal/auth/claude/oauth_server.go:232-242 | internal/auth/codex/oauth_server.go:229-239 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/oauth_server.go:232` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/auth/claude/oauth_server.go:265 — internal/auth/claude/oauth_server.go:265-275 | internal/auth/codex/oauth_server.go:262-272 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/oauth_server.go:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/auth/kimi/kimi.go:332 — internal/auth/kimi/kimi.go:332-342 | internal/auth/kimi/kimi.go:424-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/kimi/kimi.go:332` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/home/client.go:1204 — internal/home/client.go:1204-1214 | internal/home/client.go:1230-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/home/client.go:1204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/pluginhost/auth_callbacks.go:307 — internal/pluginhost/auth_callbacks.go:307-317 | internal/api/handlers/management/auth_files_crud.go:466-476 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/auth_callbacks.go:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/pluginhost/management.go:269 — internal/pluginhost/management.go:269-279 | internal/pluginhost/management.go:313-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/management.go:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/pluginhost/platform.go:82 — internal/pluginhost/platform.go:82-92 | internal/pluginstore/install.go:492-502 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/platform.go:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/registry/model_registry.go:325 — internal/registry/model_registry.go:325-335 | internal/registry/model_registry.go:471-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) internal/runtime/executor/antigravity_reasoning_replay.go:714 — internal/runtime/executor/antigravity_reasoning_replay.go:714-724 | internal/runtime/executor/antigravity_reasoning_replay.go:750-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_reasoning_replay.go:714` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/runtime/executor/codex_openai_images.go:123 — internal/runtime/executor/codex_openai_images.go:123-133 | internal/runtime/executor/codex_openai_images.go:350-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) internal/runtime/executor/codex_openai_images.go:325 — internal/runtime/executor/codex_openai_images.go:325-335 | internal/runtime/executor/codex_openai_images.go:386-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) internal/runtime/executor/codex_websockets_session.go:492 — internal/runtime/executor/codex_websockets_session.go:492-502 | internal/runtime/executor/xai_websockets_executor.go:1123-1133 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/runtime/executor/kimi_executor.go:104 — internal/runtime/executor/kimi_executor.go:104-114 | internal/runtime/executor/kimi_executor.go:221-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) internal/runtime/executor/openai_compat_executor.go:728 — internal/runtime/executor/openai_compat_executor.go:728-738 | sdk/api/handlers/openai/openai_images_handlers.go:510-521 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/signature/claude_validation.go:790 — internal/signature/claude_validation.go:790-800 | internal/signature/gemini_validation.go:491-501 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/signature/claude_validation.go:790` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/signature/gemini_validation.go:439 — internal/signature/gemini_validation.go:439-449 | internal/signature/gemini_validation.go:453-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/signature/gemini_validation.go:439` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/store/gitstore.go:477 — internal/store/gitstore.go:477-487 | internal/store/objectstore.go:248-258 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:477` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/thinking/provider/codex/apply.go:63 — internal/thinking/provider/codex/apply.go:63-73 | internal/thinking/provider/openai/apply.go:60-70 — `internal/thinking/provider/codex/apply.go` and `internal/thinking/provider/openai/apply.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 42 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/codex/apply.go:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×37
  • Duplicated block (7 lines × 2) internal/auth/codex/openai_auth.go:170 — internal/auth/codex/openai_auth.go:170-176 | internal/auth/codex/openai_auth.go:274-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/codex/openai_auth.go:170` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) internal/logging/request_logger_format.go:278 — internal/logging/request_logger_format.go:278-284 | internal/logging/request_logger_format.go:306-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/logging/request_logger_format.go:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/logging/request_logger_home.go:155 — internal/logging/request_logger_home.go:155-161 | internal/logging/request_logger_streaming.go:112-118 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/logging/request_logger_home.go:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/pluginhost/config.go:214 — internal/pluginhost/config.go:214-220 | sdk/pluginhost/host.go:345-351 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/runtime/executor/antigravity_executor_credits.go:379 — internal/runtime/executor/antigravity_executor_credits.go:379-385 | internal/runtime/executor/antigravity_executor_credits.go:414-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/runtime/executor/claude_executor_request.go:197 — internal/runtime/executor/claude_executor_request.go:197-203 | internal/runtime/executor/claude_executor_request.go:231-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) internal/runtime/executor/claude_executor_request.go:1558 — internal/runtime/executor/claude_executor_request.go:1558-1564 | internal/runtime/executor/claude_executor_request.go:1608-1614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1558` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/runtime/executor/claude_executor_tokens.go:41 — internal/runtime/executor/claude_executor_tokens.go:41-47 | internal/runtime/executor/claude_executor_tokens.go:147-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_tokens.go:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/runtime/executor/codex_openai_images.go:341 — internal/runtime/executor/codex_openai_images.go:341-347 | internal/runtime/executor/codex_openai_images.go:402-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/runtime/executor/codex_openai_images.go:528 — internal/runtime/executor/codex_openai_images.go:528-534 | internal/runtime/executor/openai_compat_executor.go:700-706 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) internal/runtime/executor/codex_websockets_connection.go:199 — internal/runtime/executor/codex_websockets_connection.go:199-205 | sdk/proxyutil/proxy.go:103-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:927 — internal/runtime/executor/gemini_vertex_executor.go:927-933 | internal/runtime/executor/gemini_vertex_executor.go:1018-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:1117 — internal/runtime/executor/gemini_vertex_executor.go:1117-1123 | sdk/cliproxy/service_models.go:453-459 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_vertex_executor.go:1117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/runtime/executor/kimi_executor.go:126 — internal/runtime/executor/kimi_executor.go:126-132 | internal/runtime/executor/openai_compat_executor.go:121-127 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (7 lines × 2) internal/runtime/executor/openai_compat_executor.go:331 — internal/runtime/executor/openai_compat_executor.go:331-337 | internal/runtime/executor/xai_executor_request.go:77-83 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (7 lines × 2) internal/runtime/executor/xai_websockets_executor.go:836 — internal/runtime/executor/xai_websockets_executor.go:836-842 | internal/runtime/executor/xai_websockets_executor.go:846-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/thinking/provider/claude/apply.go:125 — internal/thinking/provider/claude/apply.go:125-131 | internal/thinking/provider/claude/apply.go:149-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/claude/apply.go:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:89 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:89-95 | internal/translator/gemini/interactions/interactions_gemini_common.go:372-378 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:272 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:272-278 | internal/translator/gemini/interactions/interactions_gemini_common.go:1174-1180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:299 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:299-305 | internal/translator/gemini/interactions/interactions_gemini_common.go:1201-1207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/interactions/interactions_antigravity_response.go:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:314 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:314-320 | internal/translator/gemini/interactions/interactions_gemini_common.go:1235-1241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/interactions/interactions_antigravity_response.go:314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:527 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:527-533 | internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:534-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:527` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) internal/translator/claude/openai/responses/claude_openai-responses_response.go:905 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:905-911 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:730-736 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/claude/openai/responses/claude_openai-responses_response.go:905` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/translator/codex/claude/codex_claude_response.go:161 — internal/translator/codex/claude/codex_claude_response.go:161-167 | internal/translator/codex/claude/codex_claude_response.go:365-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) internal/translator/codex/openai/chat-completions/codex_openai_response.go:248 — internal/translator/codex/openai/chat-completions/codex_openai_response.go:248-255 | internal/translator/codex/openai/chat-completions/codex_openai_response.go:318-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×32
  • Duplicated block (5 lines × 2) internal/client/codex/optimize-multi-agent-v2/optimize_multi_agent_v2.go:372 — internal/client/codex/optimize-multi-agent-v2/optimize_multi_agent_v2.go:372-376 | internal/client/codex/optimize-multi-agent-v2/optimize_multi_agent_v2.go:406-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/client/codex/optimize-multi-agent-v2/optimize_multi_agent_v2.go:372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/pluginhost/adapters_executors.go:637 — internal/pluginhost/adapters_executors.go:637-641 | internal/pluginhost/adapters_executors.go:763-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_executors.go:637` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (5 lines × 2) internal/pluginhost/management.go:330 — internal/pluginhost/management.go:330-334 | internal/pluginhost/management.go:352-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/management.go:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (5 lines × 2) internal/runtime/executor/aistudio_executor.go:130 — internal/runtime/executor/aistudio_executor.go:130-134 | internal/runtime/executor/aistudio_executor.go:199-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (5 lines × 2) internal/runtime/executor/codex_executor_terminal.go:225 — internal/runtime/executor/codex_executor_terminal.go:225-229 | internal/runtime/executor/codex_executor_terminal.go:230-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_terminal.go:225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/runtime/executor/gemini_executor.go:446 — internal/runtime/executor/gemini_executor.go:446-450 | internal/runtime/executor/openai_compat_executor.go:287-292 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_executor.go:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/runtime/executor/kimi_executor.go:325 — internal/runtime/executor/kimi_executor.go:325-329 | internal/runtime/executor/openai_compat_executor.go:455-459 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/kimi_executor.go:325` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/claude/antigravity_claude_request.go:892 — internal/translator/antigravity/claude/antigravity_claude_request.go:892-896 | internal/translator/gemini/claude/gemini_claude_request.go:264-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/claude/antigravity_claude_request.go:892` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/claude/antigravity_claude_request.go:915 — internal/translator/antigravity/claude/antigravity_claude_request.go:915-919 | internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:64-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/claude/antigravity_claude_request.go:915` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/claude/antigravity_claude_response.go:338 — internal/translator/antigravity/claude/antigravity_claude_response.go:338-342 | internal/translator/antigravity/claude/antigravity_claude_response.go:457-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:188 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:188-192 | internal/translator/gemini/interactions/interactions_gemini_common.go:345-349 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:227 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:227-231 | internal/translator/gemini/interactions/interactions_gemini_common.go:1129-1133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/interactions/interactions_antigravity_response.go:227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:257 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:257-261 | internal/translator/gemini/interactions/interactions_gemini_common.go:1159-1163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:287 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:287-291 | internal/translator/gemini/interactions/interactions_gemini_common.go:1189-1193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:169 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:169-173 | internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:211-215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/translator/claude/openai/chat-completions/claude_openai_response.go:246 — internal/translator/claude/openai/chat-completions/claude_openai_response.go:246-250 | internal/translator/claude/openai/chat-completions/claude_openai_response.go:411-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) internal/translator/claude/openai/responses/claude_openai-responses_response.go:206 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:206-211 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:284-288 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) internal/translator/claude/openai/responses/claude_openai-responses_response.go:397 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:397-401 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:199-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/translator/claude/openai/responses/claude_openai-responses_response.go:402 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:402-407 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:204-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) internal/translator/claude/openai/responses/claude_openai-responses_response.go:524 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:524-528 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:229-233 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) internal/translator/codex/claude/codex_claude_response.go:136 — internal/translator/codex/claude/codex_claude_response.go:136-140 | internal/translator/codex/claude/codex_claude_response.go:222-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/translator/gemini/claude/gemini_claude_request.go:295 — internal/translator/gemini/claude/gemini_claude_request.go:295-299 | internal/translator/gemini/openai/chat-completions/gemini_openai_request.go:59-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/claude/gemini_claude_request.go:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:320 — internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:320-324 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:327-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:392 — internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:392-396 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:1031-1035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:880 — internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:880-884 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:747-751 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:880` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×29
  • Duplicated block (12 lines × 2) examples/http-request/main.go:104 — examples/http-request/main.go:104-115 | examples/http-request/main.go:128-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `examples/http-request/main.go:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 2) internal/api/handlers/management/logs.go:43 — internal/api/handlers/management/logs.go:43-54 | internal/api/handlers/management/logs.go:138-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/api/handlers/management/logs.go:146 — internal/api/handlers/management/logs.go:146-157 | internal/api/handlers/management/logs.go:208-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/api/handlers/management/plugins.go:160 — internal/api/handlers/management/plugins.go:160-171 | internal/api/handlers/management/plugins.go:320-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/plugins.go:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/pluginhost/auth_callbacks.go:390 — internal/pluginhost/auth_callbacks.go:390-401 | internal/api/handlers/management/auth_files.go:311-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/auth_callbacks.go:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/pluginhost/auth_callbacks.go:505 — internal/pluginhost/auth_callbacks.go:505-516 | internal/api/handlers/management/auth_files_crud.go:418-429 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/auth_callbacks.go:505` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) internal/pluginhost/auth_callbacks.go:548 — internal/pluginhost/auth_callbacks.go:548-559 | internal/api/handlers/management/auth_files.go:481-492 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/auth_callbacks.go:548` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/pluginhost/auth_callbacks.go:581 — internal/pluginhost/auth_callbacks.go:581-592 | internal/api/handlers/management/auth_files.go:450-461 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/auth_callbacks.go:581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/registry/model_registry.go:550 — internal/registry/model_registry.go:550-561 | internal/registry/model_registry.go:658-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/registry/model_registry.go:550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/registry/model_updater.go:284 — internal/registry/model_updater.go:284-295 | sdk/cliproxy/auth/scheduler.go:517-528 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/registry/model_updater.go:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/runtime/executor/aistudio_executor.go:160 — internal/runtime/executor/aistudio_executor.go:160-172 | internal/runtime/executor/aistudio_executor.go:228-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/aistudio_executor.go:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/runtime/executor/claude_executor_cloaking.go:1038 — internal/runtime/executor/claude_executor_cloaking.go:1038-1049 | internal/runtime/executor/claude_executor_cloaking.go:1074-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_cloaking.go:1038` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/runtime/executor/codex_executor_reasoning.go:513 — internal/runtime/executor/codex_executor_reasoning.go:513-524 | internal/runtime/executor/xai_reasoning_replay.go:136-147 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_reasoning.go:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/runtime/executor/codex_websockets_connection.go:33 — internal/runtime/executor/codex_websockets_connection.go:33-45 | internal/runtime/executor/xai_websockets_executor.go:1042-1053 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/store/gitstore.go:381 — internal/store/gitstore.go:381-392 | sdk/auth/filestore.go:85-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) internal/store/gitstore.go:719 — internal/store/gitstore.go:719-730 | sdk/auth/filestore.go:421-432 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:719` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/thinking/apply.go:723 — internal/thinking/apply.go:723-734 | internal/thinking/apply.go:773-784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/apply.go:723` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/thinking/provider/kimi/apply.go:64 — internal/thinking/provider/kimi/apply.go:64-76 | internal/thinking/provider/kimi/apply.go:105-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/kimi/apply.go:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:149 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:149-160 | internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:260-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/interactions/interactions_antigravity_response.go:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:176 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:176-187 | internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:218-229 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) internal/translator/claude/gemini/claude_gemini_request.go:87 — internal/translator/claude/gemini/claude_gemini_request.go:87-98 | internal/translator/codex/gemini/codex_gemini_request.go:88-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/claude/gemini/claude_gemini_request.go:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/translator/claude/gemini/claude_gemini_request.go:303 — internal/translator/claude/gemini/claude_gemini_request.go:303-315 | internal/translator/codex/gemini/codex_gemini_request.go:214-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) internal/translator/gemini/claude/gemini_claude_response.go:140 — internal/translator/gemini/claude/gemini_claude_response.go:140-151 | internal/translator/gemini/claude/gemini_claude_response.go:168-179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/claude/gemini_claude_response.go:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) sdk/api/handlers/gemini/gemini_handlers.go:84 — sdk/api/handlers/gemini/gemini_handlers.go:84-95 | sdk/api/handlers/gemini/gemini_handlers.go:131-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/gemini/gemini_handlers.go:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) sdk/api/handlers/openai/openai_images_handlers.go:1156 — sdk/api/handlers/openai/openai_images_handlers.go:1156-1168 | sdk/api/handlers/openai/openai_images_handlers.go:1554-1565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×28
  • Duplicated block (6 lines × 2) internal/api/handlers/management/plugins.go:694 — internal/api/handlers/management/plugins.go:694-699 | internal/config/config_yaml.go:637-642 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/plugins.go:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/api/server_routes.go:306 — internal/api/server_routes.go:306-311 | internal/client/codex/live/live.go:721-726 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/server_routes.go:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/cache/antigravity_reasoning_replay_cache.go:542 — internal/cache/antigravity_reasoning_replay_cache.go:542-547 | internal/cache/antigravity_reasoning_replay_cache.go:601-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cache/antigravity_reasoning_replay_cache.go:542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) internal/cache/antigravity_reasoning_replay_cache.go:554 — internal/cache/antigravity_reasoning_replay_cache.go:554-559 | internal/cache/antigravity_reasoning_replay_cache.go:607-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cache/antigravity_reasoning_replay_cache.go:554` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) internal/pluginhost/adapters_executors.go:826 — internal/pluginhost/adapters_executors.go:826-831 | internal/pluginhost/rpc_client.go:578-583 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_executors.go:826` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/runtime/executor/codex_openai_images.go:107 — internal/runtime/executor/codex_openai_images.go:107-112 | internal/runtime/executor/codex_openai_images.go:204-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/runtime/executor/codex_openai_images.go:1011 — internal/runtime/executor/codex_openai_images.go:1011-1016 | sdk/api/handlers/openai/openai_responses_websocket_forward.go:294-301 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:1011` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/runtime/executor/gemini_executor.go:385 — internal/runtime/executor/gemini_executor.go:385-390 | internal/runtime/executor/gemini_executor.go:461-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) internal/runtime/executor/openai_compat_executor.go:128 — internal/runtime/executor/openai_compat_executor.go:128-133 | internal/runtime/executor/openai_compat_executor.go:338-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/antigravity/claude/antigravity_claude_response.go:170 — internal/translator/antigravity/claude/antigravity_claude_response.go:170-175 | internal/translator/antigravity/claude/antigravity_claude_response.go:195-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/claude/antigravity_claude_response.go:170` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:264 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:264-269 | internal/translator/gemini/interactions/interactions_gemini_common.go:1166-1171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/interactions/interactions_antigravity_response.go:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/codex/openai/chat-completions/codex_openai_response.go:106 — internal/translator/codex/openai/chat-completions/codex_openai_response.go:106-111 | internal/translator/codex/openai/chat-completions/codex_openai_response.go:406-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/codex/openai/chat-completions/codex_openai_response.go:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/codex/openai/chat-completions/codex_openai_response.go:228 — internal/translator/codex/openai/chat-completions/codex_openai_response.go:228-233 | internal/translator/codex/openai/chat-completions/codex_openai_response.go:253-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/codex/openai/chat-completions/codex_openai_response.go:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:89 — internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:89-95 | internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:294-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:619 — internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:619-624 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:677-682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:628 — internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:628-633 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:686-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:628` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:930 — internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:930-935 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:797-802 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:930` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/openai/interactions/chat-completions/interactions_openai_response.go:171 — internal/translator/openai/interactions/chat-completions/interactions_openai_response.go:171-176 | internal/translator/openai/interactions/responses/interactions_openai_responses_response.go:716-721 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) internal/translator/openai/interactions/chat-completions/interactions_openai_response.go:352 — internal/translator/openai/interactions/chat-completions/interactions_openai_response.go:352-357 | internal/translator/openai/interactions/responses/interactions_openai_responses_response.go:861-866 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/openai/interactions/chat-completions/interactions_openai_response.go:352` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/translator/openai/openai/responses/openai_openai-responses_response.go:547 — internal/translator/openai/openai/responses/openai_openai-responses_response.go:547-552 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:616-621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) internal/wsrelay/http.go:60 — internal/wsrelay/http.go:60-65 | internal/wsrelay/http.go:101-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) sdk/api/handlers/gemini/gemini_handlers.go:239 — sdk/api/handlers/gemini/gemini_handlers.go:239-244 | sdk/api/handlers/gemini/gemini_handlers.go:313-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/gemini/gemini_handlers.go:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) sdk/api/handlers/handlers_execution.go:170 — sdk/api/handlers/handlers_execution.go:170-175 | sdk/api/handlers/handlers_execution.go:204-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/handlers_execution.go:170` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:377 — sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:377-382 | sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:406-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) sdk/cliproxy/auth/conductor_stream.go:328 — sdk/cliproxy/auth/conductor_stream.go:328-333 | sdk/cliproxy/auth/conductor_stream.go:344-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×22
  • Duplicated block (13 lines × 2) examples/plugin/claude-web-search-router/go/execution_fallback.go:203 — examples/plugin/claude-web-search-router/go/execution_fallback.go:203-215 | examples/plugin/claude-web-search-router/go/stream_forward.go:103-115 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (13 lines × 2) cmd/fetch_antigravity_models/main.go:82 — cmd/fetch_antigravity_models/main.go:82-94 | cmd/fetch_codex_models/main.go:70-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/fetch_antigravity_models/main.go:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/api/handlers/management/auth_files_provider_oauth.go:47 — internal/api/handlers/management/auth_files_provider_oauth.go:47-59 | internal/api/handlers/management/auth_files_provider_oauth.go:207-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/auth_files_provider_oauth.go:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) internal/api/handlers/management/auth_files_provider_oauth.go:561 — internal/api/handlers/management/auth_files_provider_oauth.go:561-573 | sdk/auth/xai.go:94-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/auth_files_provider_oauth.go:561` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/api/handlers/management/config_auth_index.go:88 — internal/api/handlers/management/config_auth_index.go:88-100 | internal/api/handlers/management/config_auth_index.go:117-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (13 lines × 2) internal/auth/claude/anthropic_auth.go:637 — internal/auth/claude/anthropic_auth.go:637-649 | internal/auth/codex/openai_auth.go:303-315 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/anthropic_auth.go:637` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/auth/claude/oauth_server.go:87 — internal/auth/claude/oauth_server.go:87-99 | internal/auth/codex/oauth_server.go:84-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/oauth_server.go:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/runtime/executor/claude_executor_cloaking.go:1248 — internal/runtime/executor/claude_executor_cloaking.go:1248-1260 | internal/runtime/executor/claude_executor_cloaking.go:1343-1356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_cloaking.go:1248` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) internal/runtime/executor/codex_executor_reasoning.go:124 — internal/runtime/executor/codex_executor_reasoning.go:124-136 | sdk/cliproxy/auth/conductor_execution.go:1002-1014 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_reasoning.go:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/runtime/executor/codex_openai_images.go:457 — internal/runtime/executor/codex_openai_images.go:457-469 | internal/runtime/executor/openai_compat_executor.go:593-605 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_openai_images.go:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/runtime/executor/gemini_vertex_executor.go:1138 — internal/runtime/executor/gemini_vertex_executor.go:1138-1150 | sdk/cliproxy/service_models.go:469-481 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_vertex_executor.go:1138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/runtime/executor/openai_compat_executor.go:754 — internal/runtime/executor/openai_compat_executor.go:754-766 | sdk/api/handlers/openai/openai_images_handlers.go:537-550 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/openai_compat_executor.go:754` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/signature/claude_validation.go:262 — internal/signature/claude_validation.go:262-274 | internal/signature/claude_validation.go:292-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/signature/claude_validation.go:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/translator/antigravity/gemini/antigravity_gemini_request.go:317 — internal/translator/antigravity/gemini/antigravity_gemini_request.go:317-329 | internal/translator/antigravity/openai/responses/antigravity_openai-responses_request.go:53-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:208 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:208-220 | internal/translator/gemini/openai/chat-completions/gemini_openai_response.go:247-259 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/openai/chat-completions/antigravity_openai_response.go:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/watcher/synthesizer/config.go:113 — internal/watcher/synthesizer/config.go:113-125 | internal/watcher/synthesizer/config.go:174-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/watcher/synthesizer/config.go:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) sdk/api/handlers/handlers_execution.go:60 — sdk/api/handlers/handlers_execution.go:60-72 | sdk/api/handlers/handlers_execution.go:125-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) sdk/api/handlers/openai/openai_videos_handlers.go:800 — sdk/api/handlers/openai/openai_videos_handlers.go:800-812 | sdk/api/handlers/openai/openai_videos_handlers.go:1021-1033 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) sdk/cliproxy/session/identity.go:224 — sdk/cliproxy/session/identity.go:224-236 | sdk/cliproxy/session/identity.go:253-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/session/identity.go:224` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) sdk/cliproxy/usage/accounting.go:164 — sdk/cliproxy/usage/accounting.go:164-176 | sdk/cliproxy/usage/accounting.go:197-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/usage/accounting.go:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) internal/runtime/executor/antigravity_executor_execute.go:57 — internal/runtime/executor/antigravity_executor_execute.go:57-69 | internal/runtime/executor/antigravity_executor_execute.go:281-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) internal/runtime/executor/antigravity_executor_execute.go:125 — internal/runtime/executor/antigravity_executor_execute.go:125-138 | internal/runtime/executor/antigravity_executor_execute.go:349-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_executor_execute.go:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×13
  • Duplicated block (15 lines × 2) internal/auth/claude/oauth_server.go:124 — internal/auth/claude/oauth_server.go:124-138 | internal/auth/codex/oauth_server.go:121-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/oauth_server.go:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (15 lines × 2) internal/cmd/anthropic_login.go:27 — internal/cmd/anthropic_login.go:27-41 | internal/cmd/openai_login.go:41-55 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (15 lines × 2) internal/runtime/executor/claude_executor_request.go:1078 — internal/runtime/executor/claude_executor_request.go:1078-1092 | internal/runtime/executor/claude_executor_request.go:1315-1329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1078` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/runtime/executor/codex_websockets_session.go:587 — internal/runtime/executor/codex_websockets_session.go:587-601 | internal/runtime/executor/xai_websockets_executor.go:1282-1296 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:587` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/runtime/executor/codex_websockets_session.go:678 — internal/runtime/executor/codex_websockets_session.go:678-692 | internal/runtime/executor/xai_websockets_executor.go:1369-1383 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (15 lines × 2) internal/runtime/executor/codex_websockets_session.go:759 — internal/runtime/executor/codex_websockets_session.go:759-773 | internal/runtime/executor/xai_websockets_executor.go:1548-1562 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:759` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/translator/claude/openai/chat-completions/claude_openai_request.go:106 — internal/translator/claude/openai/chat-completions/claude_openai_request.go:106-121 | internal/translator/claude/openai/responses/claude_openai-responses_request.go:96-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/claude/openai/chat-completions/claude_openai_request.go:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/translator/openai/claude/openai_claude_response.go:297 — internal/translator/openai/claude/openai_claude_response.go:297-314 | internal/translator/openai/claude/openai_claude_response.go:372-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/openai/claude/openai_claude_response.go:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) sdk/auth/claude.go:121 — sdk/auth/claude.go:121-135 | sdk/auth/codex.go:124-138 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/auth/claude.go:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (15 lines × 2) sdk/cliproxy/auth/conductor_execution.go:331 — sdk/cliproxy/auth/conductor_execution.go:331-345 | sdk/cliproxy/auth/conductor_execution.go:458-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/auth/conductor_execution.go:331` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) sdk/cliproxy/auth/conductor_selection.go:675 — sdk/cliproxy/auth/conductor_selection.go:675-689 | sdk/cliproxy/auth/conductor_selection.go:735-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/auth/conductor_selection.go:675` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) sdk/cliproxy/usage/accounting.go:96 — sdk/cliproxy/usage/accounting.go:96-110 | sdk/cliproxy/usage/accounting.go:200-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/usage/accounting.go:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) internal/api/handlers/management/config_lists.go:288 — internal/api/handlers/management/config_lists.go:288-302 | internal/api/handlers/management/config_lists.go:462-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/config_lists.go:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×13
  • Duplicated block (14 lines × 2) internal/auth/claude/oauth_server.go:73 — internal/auth/claude/oauth_server.go:73-86 | internal/auth/codex/oauth_server.go:70-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 2) internal/auth/claude/token.go:83 — internal/auth/claude/token.go:83-97 | internal/auth/codex/token.go:64-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/token.go:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 2) internal/homeplugins/sync.go:596 — internal/homeplugins/sync.go:596-609 | internal/pluginstore/install.go:478-491 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/homeplugins/sync.go:596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/runtime/executor/claude_executor_request.go:1455 — internal/runtime/executor/claude_executor_request.go:1455-1469 | internal/runtime/executor/claude_executor_request.go:1635-1648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1455` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/runtime/executor/codex_websockets_session.go:470 — internal/runtime/executor/codex_websockets_session.go:470-483 | internal/runtime/executor/xai_websockets_executor.go:1101-1114 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:470` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/runtime/executor/codex_websockets_session.go:532 — internal/runtime/executor/codex_websockets_session.go:532-545 | internal/runtime/executor/xai_websockets_executor.go:1227-1240 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/store/gitstore.go:1394 — internal/store/gitstore.go:1394-1407 | internal/store/gitstore.go:1420-1433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:1394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/thinking/provider/codex/apply.go:48 — internal/thinking/provider/codex/apply.go:48-61 | internal/thinking/provider/openai/apply.go:45-58 — `internal/thinking/provider/codex/apply.go` and `internal/thinking/provider/openai/apply.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 42 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/codex/apply.go:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:141 — internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:141-154 | internal/translator/gemini/openai/chat-completions/gemini_openai_request.go:127-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) sdk/api/handlers/openai/openai_handlers.go:306 — sdk/api/handlers/openai/openai_handlers.go:306-319 | sdk/api/handlers/openai/openai_handlers.go:401-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_handlers.go:306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) sdk/cliproxy/service_models.go:743 — sdk/cliproxy/service_models.go:743-756 | internal/config/config_normalization.go:264-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/service_models.go:743` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/cmd/antigravity_login.go:18 — internal/cmd/antigravity_login.go:18-31 | internal/cmd/xai_login.go:18-31 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (14 lines × 2) internal/runtime/executor/antigravity_executor_execute.go:93 — internal/runtime/executor/antigravity_executor_execute.go:93-106 | internal/runtime/executor/antigravity_executor_execute.go:318-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_executor_execute.go:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×11
  • Duplicated block (16 lines × 2) internal/runtime/executor/claude_executor_request.go:1001 — internal/runtime/executor/claude_executor_request.go:1001-1016 | internal/runtime/executor/claude_executor_request.go:1255-1270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1001` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/runtime/executor/helps/usage_helpers.go:780 — internal/runtime/executor/helps/usage_helpers.go:780-795 | internal/runtime/executor/helps/usage_helpers.go:823-838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/helps/usage_helpers.go:780` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) internal/translator/antigravity/gemini/antigravity_gemini_request.go:385 — internal/translator/antigravity/gemini/antigravity_gemini_request.go:385-400 | internal/translator/antigravity/openai/responses/antigravity_openai-responses_request.go:95-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/gemini/antigravity_gemini_request.go:385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) sdk/api/handlers/claude/code_handlers.go:71 — sdk/api/handlers/claude/code_handlers.go:71-87 | sdk/api/handlers/claude/code_handlers.go:103-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) sdk/api/handlers/openai/openai_responses_websocket.go:438 — sdk/api/handlers/openai/openai_responses_websocket.go:438-453 | sdk/api/handlers/openai/openai_responses_websocket_forward.go:110-125 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_responses_websocket.go:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:414 — sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:414-429 | sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:450-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_responses_websocket_toolcall_repair.go:414` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) sdk/cliproxy/auth/conductor_execution.go:385 — sdk/cliproxy/auth/conductor_execution.go:385-400 | sdk/cliproxy/auth/conductor_execution.go:520-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/auth/conductor_execution.go:385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/config/config_load.go:60 — internal/config/config_load.go:60-76 | internal/config/parse.go:20-35 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/config/config_load.go:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/config/config_load.go:138 — internal/config/config_load.go:138-157 | internal/config/parse.go:84-99 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/config/config_load.go:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/runtime/executor/antigravity_executor_execute.go:216 — internal/runtime/executor/antigravity_executor_execute.go:216-231 | internal/runtime/executor/antigravity_executor_execute.go:453-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_executor_execute.go:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/runtime/executor/antigravity_executor_execute.go:239 — internal/runtime/executor/antigravity_executor_execute.go:239-254 | internal/runtime/executor/antigravity_executor_execute.go:532-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/antigravity_executor_execute.go:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: cmd/server/main.go cmd/server/main.go — cmd/server/main.go changed 21 times in last 90 days, max complexity 137. 2 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/translator/antigravity/claude/antigravity_claude_request.go internal/translator/antigravity/claude/antigravity_claude_request.go — internal/translator/antigravity/claude/antigravity_claude_request.go changed 14 times in last 90 days, max complexity 195. 4 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/watcher/diff/config_diff.go internal/watcher/diff/config_diff.go — internal/watcher/diff/config_diff.go changed 17 times in last 90 days, max complexity 125. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: sdk/api/handlers/openai/openai_responses_websocket.go sdk/api/handlers/openai/openai_responses_websocket.go — sdk/api/handlers/openai/openai_responses_websocket.go changed 19 times in last 90 days, max complexity 106. 6 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/runtime/executor/xai_websockets_executor.go internal/runtime/executor/xai_websockets_executor.go — internal/runtime/executor/xai_websockets_executor.go changed 18 times in last 90 days, max complexity 107. 7 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/translator/gemini/openai/chat-completions/gemini_openai_request.go internal/translator/gemini/openai/chat-completions/gemini_openai_request.go — internal/translator/gemini/openai/chat-completions/gemini_openai_request.go changed 14 times in last 90 days, max complexity 126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go — internal/translator/antigravity/openai/chat-completions/antigravity_openai_request.go changed 13 times in last 90 days, max complexity 126. 2 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/translator/claude/openai/responses/claude_openai-responses_request.go internal/translator/claude/openai/responses/claude_openai-responses_request.go — internal/translator/claude/openai/responses/claude_openai-responses_request.go changed 14 times in last 90 days, max complexity 113. 3 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/translator/gemini/openai/responses/gemini_openai-responses_request.go internal/translator/gemini/openai/responses/gemini_openai-responses_request.go — internal/translator/gemini/openai/responses/gemini_openai-responses_request.go changed 12 times in last 90 days, max complexity 105. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/api/server.go internal/api/server.go — internal/api/server.go changed 48 times in last 90 days, max complexity 26. 7 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: Handler internal/api/handlers/management/handler.go:40 — TooManyMethods — 179 methods, declared across 19 files: management/config_lists.go (43), management/config_basic.go (29), management/handler.go (21), management/auth_files_crud.go (12), +15 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Host internal/pluginhost/host.go:55 — TooManyMethods — 170 methods, declared across 18 files: pluginhost/host.go (28), pluginhost/adapters_interceptors.go (17), pluginhost/auth_callbacks.go (16), pluginhost/auth_provider.go (16), +14 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Manager sdk/cliproxy/auth/conductor.go:104 — TooManyMethods — 166 methods, declared across 15 files: auth/conductor_selection.go (40), auth/conductor_home.go (32), auth/conductor_models.go (21), auth/conductor_cooldown.go (20), +11 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Service sdk/cliproxy/service.go:28 — TooManyMethods — 102 methods, declared across 11 files: cliproxy/service_auth.go (17), cliproxy/service_home.go (16), cliproxy/service_models.go (14), cliproxy/service_executors.go (13), +7 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Client internal/home/client.go:177 — TooManyMethods — 74 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OpenAIAPIHandler sdk/api/handlers/openai/openai_handlers.go:28 — TooManyMethods — 50 methods, declared across 4 files: openai/openai_images_handlers.go (20), openai/openai_videos_handlers.go (19), openai/openai_handlers.go (10), openai/codex_client_models.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Watcher internal/watcher/watcher.go:33 — TooManyMethods — 42 methods, declared across 5 files: watcher/clients.go (11), watcher/dispatcher.go (11), watcher/watcher.go (8), watcher/events.go (7), +1 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BaseAPIHandler sdk/api/handlers/handlers.go:277 — TooManyMethods — 42 methods, declared across 9 files: handlers/handlers_execution.go (11), handlers/handlers.go (6), handlers/handlers_interceptors.go (6), handlers/handlers_routing.go (6), +5 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Server internal/api/server.go:39 — TooManyMethods — 41 methods, declared across 8 files: api/server_routes.go (14), api/server_management.go (9), api/server_keepalive.go (4), api/server_middleware.go (4), +4 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Client internal/tui/client.go:15 — TooManyMethods — 34 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×7
  • Duplicated block (9 lines × 3) internal/auth/vertex/keyutil.go:151 — internal/auth/vertex/keyutil.go:151-159 | internal/auth/xai/token.go:88-96 | internal/logging/request_logger_body_source.go:44-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/vertex/keyutil.go:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) internal/runtime/executor/codex_executor_reasoning.go:380 — internal/runtime/executor/codex_executor_reasoning.go:380-388 | internal/runtime/executor/codex_executor_reasoning.go:519-527 | internal/runtime/executor/xai_reasoning_replay.go:142-150 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_reasoning.go:380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) internal/runtime/executor/gemini_executor.go:287 — internal/runtime/executor/gemini_executor.go:287-295 | internal/runtime/executor/gemini_executor.go:482-490 | internal/runtime/executor/gemini_vertex_executor.go:749-757 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) internal/store/gitstore.go:644 — internal/store/gitstore.go:644-652 | internal/store/objectstore.go:569-577 | sdk/auth/filestore.go:228-236 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) internal/translator/antigravity/interactions/interactions_antigravity_response.go:234 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:234-242 | internal/translator/codex/interactions/interactions_codex_response.go:295-303 | internal/translator/gemini/interactions/interactions_gemini_common.go:1136-1144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) internal/translator/codex/gemini/codex_gemini_request.go:180 — internal/translator/codex/gemini/codex_gemini_request.go:180-188 | internal/translator/codex/gemini/codex_gemini_request.go:253-261 | internal/translator/codex/openai/chat-completions/codex_openai_request.go:454-462 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/codex/gemini/codex_gemini_request.go:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) internal/translator/openai/claude/openai_claude_response.go:460 — internal/translator/openai/claude/openai_claude_response.go:460-468 | internal/translator/openai/claude/openai_claude_response.go:681-689 | internal/translator/openai/claude/openai_claude_response.go:738-746 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/openai/claude/openai_claude_response.go:460` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) internal/api/server_routes.go:131 — internal/api/server_routes.go:131-138 | internal/api/server_routes.go:145-152 | internal/api/server_routes.go:159-166 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/server_routes.go:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) internal/runtime/executor/gemini_executor.go:329 — internal/runtime/executor/gemini_executor.go:329-336 | internal/runtime/executor/kimi_executor.go:304-311 | internal/runtime/executor/openai_compat_executor.go:403-410 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_executor.go:329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 3) internal/runtime/executor/gemini_executor.go:339 — internal/runtime/executor/gemini_executor.go:339-346 | internal/runtime/executor/gemini_vertex_executor.go:661-668 | internal/runtime/executor/gemini_vertex_executor.go:807-814 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_executor.go:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) internal/translator/antigravity/claude/antigravity_claude_response.go:601 — internal/translator/antigravity/claude/antigravity_claude_response.go:601-608 | internal/translator/gemini/claude/gemini_claude_response.go:314-321 | internal/translator/openai/claude/openai_claude_response.go:643-650 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/claude/antigravity_claude_response.go:601` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) internal/translator/claude/openai/responses/claude_openai-responses_response.go:629 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:629-637 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:759-767 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:133-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/claude/openai/responses/claude_openai-responses_response.go:629` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) internal/translator/gemini/gemini/gemini_gemini_request.go:173 — internal/translator/gemini/gemini/gemini_gemini_request.go:173-180 | internal/translator/gemini/gemini/gemini_gemini_request.go:234-241 | internal/translator/gemini/gemini/gemini_gemini_request.go:272-279 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) internal/util/gemini_schema.go:130 — internal/util/gemini_schema.go:130-137 | internal/util/gemini_schema.go:165-172 | internal/util/gemini_schema.go:458-466 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/util/gemini_schema.go:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×7
  • Duplicated block (5 lines × 3) internal/runtime/executor/claude_executor_request.go:1376 — internal/runtime/executor/claude_executor_request.go:1376-1380 | internal/runtime/executor/claude_executor_request.go:1560-1564 | internal/runtime/executor/claude_executor_request.go:1610-1614 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/claude_executor_request.go:1376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/runtime/executor/gemini_vertex_executor.go:365 — internal/runtime/executor/gemini_vertex_executor.go:365-369 | internal/runtime/executor/gemini_vertex_executor.go:604-608 | internal/runtime/executor/gemini_vertex_executor.go:877-881 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_vertex_executor.go:365` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/thinking/provider/antigravity/apply.go:72 — internal/thinking/provider/antigravity/apply.go:72-77 | internal/thinking/provider/gemini/apply.go:96-101 | internal/thinking/provider/interactions/apply.go:27-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/antigravity/apply.go:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/translator/antigravity/interactions/interactions_antigravity_response.go:436 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:436-440 | internal/translator/codex/interactions/interactions_codex_response.go:522-526 | internal/translator/gemini/interactions/interactions_gemini_common.go:1108-1112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/antigravity/interactions/interactions_antigravity_response.go:436` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) internal/translator/claude/openai/responses/claude_openai-responses_response.go:453 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:453-457 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:211-215 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:508-512 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 3) internal/translator/claude/openai/responses/claude_openai-responses_response.go:510 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:510-514 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:619-624 | internal/translator/gemini/openai/responses/gemini_openai-responses_response.go:677-682 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) internal/translator/claude/openai/responses/claude_openai-responses_response.go:694 — internal/translator/claude/openai/responses/claude_openai-responses_response.go:694-698 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:183-187 | internal/translator/openai/openai/responses/openai_openai-responses_response.go:863-867 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×4
  • Duplicated block (19 lines × 2) internal/auth/claude/oauth_server.go:201 — internal/auth/claude/oauth_server.go:201-219 | internal/auth/codex/oauth_server.go:198-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/oauth_server.go:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) internal/runtime/executor/codex_executor_reasoning.go:541 — internal/runtime/executor/codex_executor_reasoning.go:541-559 | internal/runtime/executor/xai_reasoning_replay.go:167-185 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_executor_reasoning.go:541` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) internal/runtime/executor/codex_websockets_session.go:555 — internal/runtime/executor/codex_websockets_session.go:555-573 | internal/runtime/executor/xai_websockets_executor.go:1250-1268 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_session.go:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) sdk/api/handlers/openai/openai_images_handlers.go:269 — sdk/api/handlers/openai/openai_images_handlers.go:269-287 | sdk/api/handlers/openai/openai_videos_handlers.go:437-455 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_images_handlers.go:269` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) internal/api/handlers/management/logs.go:782 — internal/api/handlers/management/logs.go:782-798 | internal/api/handlers/management/logs.go:802-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/logs.go:782` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) internal/thinking/provider/codex/apply.go:102 — internal/thinking/provider/codex/apply.go:102-118 | internal/thinking/provider/openai/apply.go:99-115 — `internal/thinking/provider/codex/apply.go` and `internal/thinking/provider/openai/apply.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 42 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/thinking/provider/codex/apply.go:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) sdk/api/handlers/openai/openai_images_handlers.go:598 — sdk/api/handlers/openai/openai_images_handlers.go:598-614 | sdk/api/handlers/openai/openai_images_handlers.go:885-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_images_handlers.go:598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) sdk/cliproxy/auth/conductor_selection.go:321 — sdk/cliproxy/auth/conductor_selection.go:321-337 | sdk/cliproxy/auth/selector.go:285-301 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/cliproxy/auth/conductor_selection.go:321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×4
  • Duplicated block (12 lines × 3) internal/runtime/executor/gemini_vertex_executor.go:372 — internal/runtime/executor/gemini_vertex_executor.go:372-383 | internal/runtime/executor/gemini_vertex_executor.go:611-622 | internal/runtime/executor/gemini_vertex_executor.go:884-895 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_vertex_executor.go:372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) internal/runtime/executor/gemini_vertex_executor.go:493 — internal/runtime/executor/gemini_vertex_executor.go:493-504 | internal/runtime/executor/gemini_vertex_executor.go:753-764 | internal/runtime/executor/gemini_vertex_executor.go:971-982 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) internal/translator/claude/gemini/claude_gemini_request.go:50 — internal/translator/claude/gemini/claude_gemini_request.go:50-61 | internal/translator/claude/openai/chat-completions/claude_openai_request.go:49-60 | internal/translator/claude/openai/responses/claude_openai-responses_request.go:39-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/claude/gemini/claude_gemini_request.go:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) sdk/api/handlers/openai/openai_handlers.go:104 — sdk/api/handlers/openai/openai_handlers.go:104-117 | sdk/api/handlers/openai/openai_handlers.go:159-172 | sdk/api/handlers/openai/openai_responses_handlers.go:428-439 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) internal/runtime/executor/gemini_executor.go:624 — internal/runtime/executor/gemini_executor.go:624-630 | internal/runtime/executor/gemini_vertex_executor.go:857-863 | internal/runtime/executor/gemini_vertex_executor.go:948-954 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 3) internal/runtime/executor/openai_compat_executor.go:121 — internal/runtime/executor/openai_compat_executor.go:121-127 | internal/runtime/executor/antigravity_executor_execute.go:73-79 | internal/runtime/executor/antigravity_executor_execute.go:297-303 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 3) internal/translator/claude/gemini/claude_gemini_request.go:157 — internal/translator/claude/gemini/claude_gemini_request.go:157-163 | internal/translator/claude/openai/chat-completions/claude_openai_request.go:89-95 | internal/translator/claude/openai/responses/claude_openai-responses_request.go:79-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) internal/api/handlers/management/config_lists.go:1593 — internal/api/handlers/management/config_lists.go:1593-1599 | internal/api/handlers/management/config_lists.go:1619-1625 | internal/api/handlers/management/config_lists.go:1645-1651 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) internal/store/gitstore.go:1863 — internal/store/gitstore.go:1863-1880 | sdk/auth/filestore.go:510-527 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:1863` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) sdk/api/handlers/claude/code_handlers.go:252 — sdk/api/handlers/claude/code_handlers.go:252-269 | sdk/api/handlers/gemini/gemini_handlers.go:205-223 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/claude/code_handlers.go:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (18 lines × 2) sdk/api/handlers/openai/openai_images_handlers.go:1193 — sdk/api/handlers/openai/openai_images_handlers.go:1193-1210 | sdk/api/handlers/openai/openai_images_handlers.go:1321-1338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/api/handlers/openai/openai_images_handlers.go:1193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D1 · Cyclomatic Complexity · Applier.Apply (cyclomatic 16) · ×2
  • Applier.Apply (cyclomatic 16) internal/thinking/provider/codex/apply.go:44 — Applier.Apply has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Applier.Apply (cyclomatic 16) internal/thinking/provider/openai/apply.go:41 — Applier.Apply has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Applier.Apply (cognitive 16) · ×2
  • Applier.Apply (cognitive 16) internal/thinking/provider/codex/apply.go:44 — Applier.Apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Applier.Apply (cognitive 16) internal/thinking/provider/openai/apply.go:41 — Applier.Apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · Medium · ×2
  • Medium: math-random-used internal/runtime/executor/antigravity_executor_credits.go:9 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used sdk/cliproxy/auth/conductor_selection.go:6 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: auth_files.go ↔ oauth_sessions.go internal/api/handlers/management/auth_files.go — `internal/api/handlers/management/auth_files.go` and `internal/api/handlers/management/oauth_sessions.go` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: config_diff.go ↔ config.go internal/watcher/diff/config_diff.go — `internal/watcher/diff/config_diff.go` and `internal/watcher/synthesizer/config.go` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
D38 · OSV Dependency Vulnerabilities · Medium vulnerability · ×2
  • Medium vulnerability: GO-2026-5841 go.mod — github.com/klauspost/compress 1.17.4 (github.com/klauspost/compress/s2): GO-2026-5841 — upgrade to 1.18.7
  • Medium vulnerability: GO-2026-5932 go.mod — golang.org/x/crypto 0.54.0 (golang.org/x/crypto/openpgp, golang.org/x/crypto/openpgp/packet, golang.org/x/crypto/openpgp/armor, +4 more): GO-2026-5932 — no fixed version has been published yet. Track the advisory, and remove or replace golang.org/x/crypto if the exposure is not acceptable until one lands. Before doing either, check whether any affected package above is actually linked here: `go list -deps ./... | grep -F -e golang.org/x/crypto/openpgp` lists it whether your own code imports it or a dependency pulls it in — a module can be in the build list for one sub-package while the vulnerable one is never reached, in which case there is nothing to remove and tracking the advisory is the whole action.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) internal/auth/claude/errors.go:132 — internal/auth/claude/errors.go:132-151 | internal/auth/codex/errors.go:136-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/auth/claude/errors.go:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) internal/translator/antigravity/interactions/interactions_antigravity_response.go:383 — internal/translator/antigravity/interactions/interactions_antigravity_response.go:383-402 | internal/translator/gemini/interactions/interactions_gemini_common.go:309-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) internal/runtime/executor/codex_websockets_executor.go:128 — internal/runtime/executor/codex_websockets_executor.go:128-143 | internal/runtime/executor/xai_websockets_executor.go:1671-1686 | sdk/cliproxy/auth/selector.go:202-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/codex_websockets_executor.go:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 3) internal/translator/codex/claude/codex_claude_request.go:546 — internal/translator/codex/claude/codex_claude_request.go:546-561 | internal/translator/codex/gemini/codex_gemini_request.go:566-581 | internal/translator/codex/openai/chat-completions/codex_openai_request.go:688-703 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/codex/claude/codex_claude_request.go:546` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) internal/pluginhost/adapters_interceptors.go:339 — internal/pluginhost/adapters_interceptors.go:339-351 | sdk/api/handlers/handlers_interceptors.go:357-369 | sdk/cliproxy/auth/conductor_execution.go:261-273 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pluginhost/adapters_interceptors.go:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 3) internal/translator/codex/claude/codex_claude_request.go:501 — internal/translator/codex/claude/codex_claude_request.go:501-513 | internal/translator/codex/gemini/codex_gemini_request.go:521-533 | internal/translator/codex/openai/chat-completions/codex_openai_request.go:640-653 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/codex/claude/codex_claude_request.go:501` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) internal/watcher/synthesizer/config.go:91 — internal/watcher/synthesizer/config.go:91-101 | internal/watcher/synthesizer/config.go:148-158 | internal/watcher/synthesizer/config.go:218-228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/watcher/synthesizer/config.go:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) internal/api/handlers/management/config_lists.go:229 — internal/api/handlers/management/config_lists.go:229-239 | internal/api/handlers/management/config_lists.go:403-413 | internal/api/handlers/management/config_lists.go:906-916 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/handlers/management/config_lists.go:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×2
  • Duplicated block (9 lines × 5) internal/runtime/executor/gemini_executor.go:101 — internal/runtime/executor/gemini_executor.go:101-109 | internal/runtime/executor/gemini_vertex_executor.go:225-233 | internal/runtime/executor/kimi_executor.go:73-81 | internal/runtime/executor/openai_compat_executor.go:77-85 | internal/runtime/executor/xai_executor.go:100-108 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 5) internal/runtime/executor/gemini_executor.go:222 — internal/runtime/executor/gemini_executor.go:222-230 | internal/runtime/executor/gemini_vertex_executor.go:414-422 | internal/runtime/executor/gemini_vertex_executor.go:539-547 | internal/runtime/executor/kimi_executor.go:185-193 | internal/runtime/executor/openai_compat_executor.go:195-203 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runtime/executor/gemini_executor.go:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) internal/store/gitstore.go:412 — internal/store/gitstore.go:412-420 | internal/store/objectstore.go:195-203 | internal/store/postgresstore.go:246-254 | sdk/auth/filestore.go:117-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/store/gitstore.go:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) sdk/cliproxy/auth/conductor_selection.go:1037 — sdk/cliproxy/auth/conductor_selection.go:1037-1045 | sdk/cliproxy/auth/conductor_selection.go:1256-1264 | sdk/cliproxy/auth/conductor_selection.go:1360-1368 | sdk/cliproxy/auth/conductor_selection.go:1443-1451 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) internal/cache/antigravity_reasoning_replay_cache.go:635 — internal/cache/antigravity_reasoning_replay_cache.go:635-641 | internal/cache/codex_reasoning_replay_cache.go:474-480 | internal/cache/kimi_thinking_replay_cache.go:404-410 | internal/cache/xai_reasoning_replay_cache.go:395-401 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cache/antigravity_reasoning_replay_cache.go:635` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) internal/translator/claude/openai/chat-completions/claude_openai_request.go:242 — internal/translator/claude/openai/chat-completions/claude_openai_request.go:242-248 | internal/translator/openai/claude/openai_claude_response.go:456-462 | internal/translator/openai/claude/openai_claude_response.go:677-683 | internal/translator/openai/claude/openai_claude_response.go:734-740 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/translator/claude/openai/chat-...

    Downloadable artifacts

    Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.