Public report of Gentleman-Programming/gentle-ai, published 17 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 00:02 UTC · Survey ID cd_21d85df967224cbab969d423e6b12977

Gentleman-Programming/gentle-ai

Measured 17 November 2026, 00:01 UTC, at code version 1ab243c

First survey, so nothing to compare with yet
CAI score 60.4out of 100 Adequate
CriticalWeakAdequateStrongExemplary

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 188,307 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 3.7 person-years · Weakest lens: Code Health, 44.2

Findings by how serious they are

13 critical 2113 serious 147 minor

17 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 00:01 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

68of 68 dimensions measured by tools.
2256of 2273 findings point to an exact file and line, so you can open each one in the code. The other 17 concern the repository as a whole, such as missing documentation.
68dimensions across 6 lenses, read from 188,307 lines of product code in 2 projects.
Chapters

Executive summary

Gentleman-Programming/gentle-ai falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 60.4 out of 100 and is rated Adequate, and all 13 of its critical findings are security problems.

Code Health, at 44.2, is the weakest lens and counts most in the score. The best first step is turning on missing-value checks, worth about 4.3 points. Adding type checking comes next, worth about 4.2 points. Raising Code Health to 70 would lift the score to about 71.3.

Six places in the code run text as code, which an attacker could use. Three known security holes in the packages the code depends on can be used by attackers, and two secrets can leak from the build pipeline. Replacing text run as code with direct calls, updating the vulnerable packages and limiting each secret to its own step would close these risks. Pinning each tool to an exact version would fix the pipeline tool referenced by a changeable name, and fixing the weaknesses the scanner points to would deal with the security weakness in the code.

The product code is 188,307 lines, about €540,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 44.2 · counts for 46%Security and Compliance 66.0 · counts for 25%Production Readiness 67.7 · counts for 14%Maturity 95.1 · counts for 8%Architecture 96.7 · counts for 4%Performance 97.1 · counts for 2%

If Code Health rose from 44.2 to 70, the lowest score rated Strong, the score would rise from 60.4 to about 71.3.

Code composition: what the lines of code are
Product code 38%Tests 62%
Rebuild cost: about €540,000 · Estimate
Cost to rebuild€180,000 to €900,000, for 2,993 to 9,496 hours of work, about 3.7 person-years for 2 to 8 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 60. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 188,307 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
The findings name the configuration each number was taken from and, for the assertions, the files that hold them.
Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Raises the score by about 4.3 points · Medium effort · Nullable reference types
2
Resolve the 1 finding(s) in Type Safety.
Raises the score by about 4.2 points · Medium effort · Type Safety
3
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.
Raises the score by about 0.6 points · Low effort · Static Analysis (SAST)

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Files that change often carry extra risk · Combined risk
29 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (146 files) · Code Coverage (116 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: model.go, user_install_flow_unix.go and shell_experience.go
What to do: Add tests to these files and have a second person review every change to them, starting with model.go, user_install_flow_unix.go and shell_experience.go.
Where the investment is most exposed · Value at risk
This code would cost about €540,000 to build again, about 3.7 person-years of work. Its weakest lens is Code Health, at 44.2 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Of all the actions in this report, it raises the score most for the work it takes: about 4.3 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 15% on every change. The history of the code shows how much it changes: about 467,062 lines over the last 90 days, which is about 1,894,196 lines a year. At that pace, the extra work comes to an estimated 320.2 to 1921.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

102 modules, with 219 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 62 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 com/gentleman-programming/gentle-ai/v4/internal/backup2 com/gentleman-programming/gentle-ai/v4/internal/components/filemerge3 com/gentleman-programming/gentle-ai/v4/internal/components/mutationjournal4 com/gentleman-programming/gentle-ai/v4/internal/model5 com/gentleman-programming/gentle-ai/v4/internal/system6 com/gentleman-programming/gentle-ai/v4/internal/agents/capabilitymanifest7 com/gentleman-programming/gentle-ai/v4/internal/installcmd8 com/gentleman-programming/gentle-ai/v4/internal/opencode9 com/gentleman-programming/gentle-ai/v4/internal/planner10 com/gentleman-programming/gentle-ai/v4/internal/reviewtransaction11 com/gentleman-programming/gentle-ai/v4/internal/state12 com/gentleman-programming/gentle-ai/v4/internal/update13 com/gentleman-programming/gentle-ai/v4/internal/agents14 com/gentleman-programming/gentle-ai/v4/internal/agents/antigravity15 com/gentleman-programming/gentle-ai/v4/internal/agents/claude16 com/gentleman-programming/gentle-ai/v4/internal/agents/codex17 com/gentleman-programming/gentle-ai/v4/internal/agents/conductor18 com/gentleman-programming/gentle-ai/v4/internal/agents/copilotcli19 com/gentleman-programming/gentle-ai/v4/internal/agents/cursor20 com/gentleman-programming/gentle-ai/v4/internal/agents/gemini21 com/gentleman-programming/gentle-ai/v4/internal/agents/hermes22 com/gentleman-programming/gentle-ai/v4/internal/agents/kilocode23 com/gentleman-programming/gentle-ai/v4/internal/agents/kimi24 com/gentleman-programming/gentle-ai/v4/internal/agents/kiro25 com/gentleman-programming/gentle-ai/v4/internal/agents/openclaw26 com/gentleman-programming/gentle-ai/v4/internal/agents/opencode27 com/gentleman-programming/gentle-ai/v4/internal/agents/pi28 com/gentleman-programming/gentle-ai/v4/internal/agents/qwen29 com/gentleman-programming/gentle-ai/v4/internal/agents/trae30 com/gentleman-programming/gentle-ai/v4/internal/agents/vscode31 com/gentleman-programming/gentle-ai/v4/internal/agents/windsurf32 com/gentleman-programming/gentle-ai/v4/internal/components/agentguidance33 com/gentleman-programming/gentle-ai/v4/internal/components/engram34 com/gentleman-programming/gentle-ai/v4/internal/update/upgrade35 com/gentleman-programming/gentle-ai/v4/internal/components/communitytool36 com/gentleman-programming/gentle-ai/v4/internal/components/uninstall37 com/gentleman-programming/gentle-ai/v4/internal/cli38 com/gentleman-programming/gentle-ai/v4/internal/tui/screens39 com/gentleman-programming/gentle-ai/v4/internal/tui40 com/gentleman-programming/gentle-ai/v4/internal/app
1 com/gentleman-programming/gentle-ai/v4/internal/backup
2 com/gentleman-programming/gentle-ai/v4/internal/components/filemerge
3 com/gentleman-programming/gentle-ai/v4/internal/components/mutationjournal
4 com/gentleman-programming/gentle-ai/v4/internal/model
5 com/gentleman-programming/gentle-ai/v4/internal/system
6 com/gentleman-programming/gentle-ai/v4/internal/agents/capabilitymanifest2
7 com/gentleman-programming/gentle-ai/v4/internal/installcmd53
8 com/gentleman-programming/gentle-ai/v4/internal/opencode11
9 com/gentleman-programming/gentle-ai/v4/internal/planner161
10 com/gentleman-programming/gentle-ai/v4/internal/reviewtransaction1
11 com/gentleman-programming/gentle-ai/v4/internal/state8
12 com/gentleman-programming/gentle-ai/v4/internal/update1
13 com/gentleman-programming/gentle-ai/v4/internal/agents10161
14 com/gentleman-programming/gentle-ai/v4/internal/agents/antigravity6111
15 com/gentleman-programming/gentle-ai/v4/internal/agents/claude151111
16 com/gentleman-programming/gentle-ai/v4/internal/agents/codex5111
17 com/gentleman-programming/gentle-ai/v4/internal/agents/conductor5111
18 com/gentleman-programming/gentle-ai/v4/internal/agents/copilotcli4111
19 com/gentleman-programming/gentle-ai/v4/internal/agents/cursor5111
20 com/gentleman-programming/gentle-ai/v4/internal/agents/gemini4111
21 com/gentleman-programming/gentle-ai/v4/internal/agents/hermes5111
22 com/gentleman-programming/gentle-ai/v4/internal/agents/kilocode41111
23 com/gentleman-programming/gentle-ai/v4/internal/agents/kimi41111
24 com/gentleman-programming/gentle-ai/v4/internal/agents/kiro6111
25 com/gentleman-programming/gentle-ai/v4/internal/agents/openclaw5111
26 com/gentleman-programming/gentle-ai/v4/internal/agents/opencode41111
27 com/gentleman-programming/gentle-ai/v4/internal/agents/pi14111
28 com/gentleman-programming/gentle-ai/v4/internal/agents/qwen4111
29 com/gentleman-programming/gentle-ai/v4/internal/agents/trae5111
30 com/gentleman-programming/gentle-ai/v4/internal/agents/vscode5111
31 com/gentleman-programming/gentle-ai/v4/internal/agents/windsurf5111
32 com/gentleman-programming/gentle-ai/v4/internal/components/agentguidance122
33 com/gentleman-programming/gentle-ai/v4/internal/components/engram1321
34 com/gentleman-programming/gentle-ai/v4/internal/update/upgrade1161
35 com/gentleman-programming/gentle-ai/v4/internal/components/communitytool731
36 com/gentleman-programming/gentle-ai/v4/internal/components/uninstall21131
37 com/gentleman-programming/gentle-ai/v4/internal/cli4360788190414141
38 com/gentleman-programming/gentle-ai/v4/internal/tui/screens12515231121
39 com/gentleman-programming/gentle-ai/v4/internal/tui120233836472213
40 com/gentleman-programming/gentle-ai/v4/internal/app11221141117
Uses a module listed above itPart of a loopThe module itself
1 com/gentleman-programming/gentle-ai/v4/internal/backup2 com/gentleman-programming/gentle-ai/v4/internal/components/filemerge3 com/gentleman-programming/gentle-ai/v4/internal/components/mutationjournal4 com/gentleman-programming/gentle-ai/v4/internal/model5 com/gentleman-programming/gentle-ai/v4/internal/system6 com/gentleman-programming/gentle-ai/v4/internal/agents/capabilitymanifest7 com/gentleman-programming/gentle-ai/v4/internal/installcmd8 com/gentleman-programming/gentle-ai/v4/internal/opencode9 com/gentleman-programming/gentle-ai/v4/internal/planner10 com/gentleman-programming/gentle-ai/v4/internal/reviewtransaction11 com/gentleman-programming/gentle-ai/v4/internal/state12 com/gentleman-programming/gentle-ai/v4/internal/update13 com/gentleman-programming/gentle-ai/v4/internal/agents14 com/gentleman-programming/gentle-ai/v4/internal/agents/antigravity15 com/gentleman-programming/gentle-ai/v4/internal/agents/claude16 com/gentleman-programming/gentle-ai/v4/internal/agents/codex17 com/gentleman-programming/gentle-ai/v4/internal/agents/conductor18 com/gentleman-programming/gentle-ai/v4/internal/agents/copilotcli19 com/gentleman-programming/gentle-ai/v4/internal/agents/cursor20 com/gentleman-programming/gentle-ai/v4/internal/agents/gemini21 com/gentleman-programming/gentle-ai/v4/internal/agents/hermes22 com/gentleman-programming/gentle-ai/v4/internal/agents/kilocode23 com/gentleman-programming/gentle-ai/v4/internal/agents/kimi24 com/gentleman-programming/gentle-ai/v4/internal/agents/kiro25 com/gentleman-programming/gentle-ai/v4/internal/agents/openclaw26 com/gentleman-programming/gentle-ai/v4/internal/agents/opencode27 com/gentleman-programming/gentle-ai/v4/internal/agents/pi28 com/gentleman-programming/gentle-ai/v4/internal/agents/qwen29 com/gentleman-programming/gentle-ai/v4/internal/agents/trae30 com/gentleman-programming/gentle-ai/v4/internal/agents/vscode31 com/gentleman-programming/gentle-ai/v4/internal/agents/windsurf32 com/gentleman-programming/gentle-ai/v4/internal/components/agentguidance33 com/gentleman-programming/gentle-ai/v4/internal/components/engram34 com/gentleman-programming/gentle-ai/v4/internal/update/upgrade35 com/gentleman-programming/gentle-ai/v4/internal/components/communitytool36 com/gentleman-programming/gentle-ai/v4/internal/components/uninstall37 com/gentleman-programming/gentle-ai/v4/internal/cli38 com/gentleman-programming/gentle-ai/v4/internal/tui/screens39 com/gentleman-programming/gentle-ai/v4/internal/tui40 com/gentleman-programming/gentle-ai/v4/internal/appcom/gentleman-programming/gentle-ai/v4/internal/backup1com/gentleman-programming/gentle-ai/v4/internal/components/filemerge2com/gentleman-programming/gentle-ai/v4/internal/components/mutationjournal3com/gentleman-programming/gentle-ai/v4/internal/model4com/gentleman-programming/gentle-ai/v4/internal/system5com/gentleman-programming/gentle-ai/v4/internal/agents/capabilitymanifest6com/gentleman-programming/gentle-ai/v4/internal/installcmd7com/gentleman-programming/gentle-ai/v4/internal/opencode8com/gentleman-programming/gentle-ai/v4/internal/planner9com/gentleman-programming/gentle-ai/v4/internal/reviewtransaction10com/gentleman-programming/gentle-ai/v4/internal/state11com/gentleman-programming/gentle-ai/v4/internal/update12com/gentleman-programming/gentle-ai/v4/internal/agents13com/gentleman-programming/gentle-ai/v4/internal/agents/antigravity14com/gentleman-programming/gentle-ai/v4/internal/agents/claude15com/gentleman-programming/gentle-ai/v4/internal/agents/codex16com/gentleman-programming/gentle-ai/v4/internal/agents/conductor17com/gentleman-programming/gentle-ai/v4/internal/agents/copilotcli18com/gentleman-programming/gentle-ai/v4/internal/agents/cursor19com/gentleman-programming/gentle-ai/v4/internal/agents/gemini20com/gentleman-programming/gentle-ai/v4/internal/agents/hermes21com/gentleman-programming/gentle-ai/v4/internal/agents/kilocode22com/gentleman-programming/gentle-ai/v4/internal/agents/kimi23com/gentleman-programming/gentle-ai/v4/internal/agents/kiro24com/gentleman-programming/gentle-ai/v4/internal/agents/openclaw25com/gentleman-programming/gentle-ai/v4/internal/agents/opencode26com/gentleman-programming/gentle-ai/v4/internal/agents/pi27com/gentleman-programming/gentle-ai/v4/internal/agents/qwen28com/gentleman-programming/gentle-ai/v4/internal/agents/trae29com/gentleman-programming/gentle-ai/v4/internal/agents/vscode30com/gentleman-programming/gentle-ai/v4/internal/agents/windsurf31com/gentleman-programming/gentle-ai/v4/internal/components/agentguidance32com/gentleman-programming/gentle-ai/v4/internal/components/engram33com/gentleman-programming/gentle-ai/v4/internal/update/upgrade34com/gentleman-programming/gentle-ai/v4/internal/components/communitytool35com/gentleman-programming/gentle-ai/v4/internal/components/uninstall36com/gentleman-programming/gentle-ai/v4/internal/cli37com/gentleman-programming/gentle-ai/v4/internal/tui/screens38com/gentleman-programming/gentle-ai/v4/internal/tui39com/gentleman-programming/gentle-ai/v4/internal/app402531116118110161611115111151115111411151114111511141111411116111511141111141114111511151115111122132111617312113143607881904141411251523112112023383647221311221141117+62 more modules (most-connected shown)

At a glance — Code Health · 44.2 · Weak · gated by D1, D2, R1, X5 ·

At a glance — Architecture · 96.7 · Exemplary ·

At a glance — Maturity · 95.1 · Exemplary ·

At a glance — Readiness · 67.7 · Adequate ·

At a glance — Security · 66.0 · Checked 5 of 11 · gated by D29, D36 ·

At a glance — Performance · 97.1 · Exemplary ·

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
A05:2025 — Injection57High / Critical
A03:2025 — Software Supply Chain Failures13High / Critical

Roadmap

Top priorities: The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`); Resolve the 1 finding(s) in Type Safety; Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.

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

Do thisHelpsEffortDimension
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).+4.3 ptsMediumNullable reference types
Resolve the 1 finding(s) in Type Safety.+4.2 ptsMediumType Safety
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.+0.6 ptsLowStatic Analysis (SAST)
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.+1.6 ptsMediumCode Duplication
Bring the 37 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with cli.runReviewStatus (cyclomatic 284), Model.confirmSelection (cyclomatic 230), ReviewNextTransition.Validate (cyclomatic 167).+1.6 ptsHighCyclomatic Complexity
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+1.4 ptsMediumDR & Backup
Bring the 55 bodies over 60 down to 60 or less in Cognitive Complexity — start with cli.runReviewStatus (cognitive 684), Model.confirmSelection (cognitive 358), Model.handleKeyPress (cognitive 238).+1.3 ptsHighCognitive Complexity
Resolve the 27 finding(s) in Cyclomatic Complexity.+1.3 ptsMediumCyclomatic Complexity

File quality

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

FileScoreBandWorst signal
REDACTED0.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
internal/tui/model.go5.0MixedCyclomatic Complexity: Model.confirmSelection (cyclomatic 230)
internal/cli/run.go5.0MixedCyclomatic Complexity: componentApplyStep.Run (cyclomatic 86)
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: High CVE: REDACTED
internal/shellinstaller/user_install_flow_unix.go5.5MixedCyclomatic Complexity: shellinstaller.userRunInstall (cyclomatic 112)
bench/axis_damaged_store.go5.5MixedCode Duplication: Edited copy of a member (26 corresponding lines)
internal/releasepolicy/policy.go5.5MixedCyclomatic Complexity: releasepolicy.validateArtifacts (cyclomatic 65)
internal/reviewtransaction/bundle.go5.5MixedCyclomatic Complexity: reviewtransaction.validateChainBundle (cyclomatic 42)
internal/tui/shell_install.go5.5MixedCyclomatic Complexity: Model.updateShellInstall (cyclomatic 38)
bench/journeys_issue_3065.go5.5MixedCode Duplication: Edited copies of one member (3 members, 14+ corresponding lines)
internal/reviewtransaction/gate.go5.6MixedCyclomatic Complexity: reviewtransaction.validateGateRequest (cyclomatic 27)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 13

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 2113

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 147

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 17

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey 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. All 68 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, the weighted average across measured dimensions.

Every figure here is one of two 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. 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.

What we checked — 68 dimensions across the health lenses
D1D2D3D4D5D6D7D8D10D11D12D13D14D15D16D17D19D20D21D22D23D24D27D28D29D30D31D34D35D36D43D44AX10AX2AX3AX4AX6M1M2M3M4P1P2P3P4P5P6P7PF1PF3R1R10R2R3R4R5R6R7R9X19X2X26X27X28X3X30X4X5

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, 2256 of 2273 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 or a scanner, 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
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ 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

Every finding is locatable in findings.md. Run 01a1e6cf-37b9-732b-8a7f-aa0dbe19c989.

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.

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 43 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,313 test source file(s) (.py, .go) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its Go module dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (172310 LoC, 923 module-visible types across 95 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `internal/tui/screens/review.go` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in internal/planner/resolver.go, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via ToolchainServer (.). `go` is not on PATH — this repository boots from its toolchain's own run entry point (package main in cmd/gentle-telemetry starts an HTTP listener), so the tier cannot start it without that toolchain No runtime accessibility evidence was produced for this scan. This is a statement about THIS RUN's environment, not about the application: nothing here says the app is inaccessible, only that it was never rendered.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Go, Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Go, Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 62 further occurrence(s) are not listed individually; the score already reflects all 102.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 324 further occurrence(s) are not listed individually; the score already reflects all 364.

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

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do 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 — an in-process token-stream comparison over sliding windows, with type-aware normalization — so 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.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • 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").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • 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.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • 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").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

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: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

479 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was cli.runReviewStatus at 284. A further 21 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 ReviewTransitionSubmission.validateCorrectionPlan at 27 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: internal/shellinstaller/user_transport_tls.go (shellinstaller.gentleShellStableResponseMatches at 22), internal/reviewtransaction/rar_windows_owner_trust.go (reviewtransaction.rarWindowsOwnerOnlyMismatch at 21), internal/agents/factory.go (agents.NewAdapter at 19), internal/reviewtransaction/prepr.go (BaseAdvanceCompatibility.valid at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

cli.runReviewStatus (cyclomatic 284)internal/cli/review_facade.go:799
Model.confirmSelection (cyclomatic 230)internal/tui/model.go:2100
ReviewNextTransition.Validate (cyclomatic 167)internal/cli/review_status_contract.go:1239
ReviewTargetStatusResult.validateWithCompactAuthority (cyclomatic 145)internal/cli/review_status_contract.go:363
Model.handleKeyPress (cyclomatic 124)internal/tui/model.go:1672

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

What to do

  1. Bring the 37 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with cli.runReviewStatus (cyclomatic 284), Model.confirmSelection (cyclomatic 230), ReviewNextTransition.Validate (cyclomatic 167). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 37 together lifts Cyclomatic Complexity from 2.0 to about 3.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

584 method(s) exceeded the cognitive complexity threshold of 15; the worst was cli.runReviewStatus at 684.

cli.runReviewStatus (cognitive 684)internal/cli/review_facade.go:799
Model.confirmSelection (cognitive 358)internal/tui/model.go:2100
Model.handleKeyPress (cognitive 238)internal/tui/model.go:1672
ReviewNextTransition.Validate (cognitive 235)internal/cli/review_status_contract.go:1239
componentApplyStep.Run (cognitive 220)internal/cli/run.go:3343

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

What to do

  1. Bring the 55 bodies over 60 down to 60 or less in Cognitive Complexity — start with cli.runReviewStatus (cognitive 684), Model.confirmSelection (cognitive 358), Model.handleKeyPress (cognitive 238). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 55 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.7 / 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: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Prevented

101 god class(es) detected.

FileTooLong: tui/model.go · ×41internal/tui/model.go
FunctionTooLong: cli.runReviewStatus · ×27internal/cli/review_facade.go:799
MethodTooLong: Model.confirmSelection · ×21internal/tui/model.go:2100
ClassTooLong: Model · ×6internal/tui/model.go:649
TooManyFields: Model · ×4internal/tui/model.go:649

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

What to do

  1. Resolve the 41 FileTooLong finding(s) in God Classes — start with REDACTED (2), model.go, run.go. — One of this dimension's main actionable groups (41 warning-level).
  2. Resolve the 27 FunctionTooLong finding(s) in God Classes — start with review_facade.go (3), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (27 warning-level).
  3. Resolve the 21 MethodTooLong finding(s) in God Classes — start with model.go (6), service.go (3), run.go (2). — One of this dimension's main actionable groups (21 warning-level).

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

D4 · Code Duplication7.3 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.3 / 10 · rule-coverage 100% · ceiling Verified

321 duplicated block group(s) detected. 6.9 % of the production lines (12,910 of 188,307) are in a reported copy. A further 215 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 89 of the 536 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (6 lines × 2) · ×34REDACTED:503
Duplicated block (5 lines × 2) · ×29internal/cli/doctor_tool_probe_unix.go:19
Duplicated block (10 lines × 2) · ×27internal/agents/capabilitymanifest/manifest.go:163
Duplicated block (8 lines × 2) · ×27internal/cli/review_last_event_closure.go:103
Duplicated block (7 lines × 2) · ×26internal/cli/review_capture_unachievable.go:71

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

What to do

  1. Resolve the 34 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), REDACTED (2), app.go (2). — One of this dimension's main actionable groups (34 warning-level).
  2. Resolve the 29 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with review_facade.go (2), journeys_reviewed_superset.go (2), doctor_tool_probe_unix.go. — One of this dimension's main actionable groups (29 warning-level).
  3. Resolve the 27 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with app.go (2), user_main_source_unix.go (2), manifest.go. — One of this dimension's main actionable groups (27 warning-level).

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

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (npm+Go), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

1 of 155 classes have LCOM4 above 3.

Low cohesion: runtimeState (LCOM4 4)internal/cli/run.go:808

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with run.go. — One of this dimension's main actionable groups (1 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D8 · Code Coverage9.6 / 10Stronggated by 122 serious findings✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 66.7% — 122 file(s) below 50%. Measured from the Go suite (github.com/gentleman-programming/gentle-ai/v4: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/gentleman-programming/gentle-ai/bench: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it. 5 line(s) in 2 file(s) were executed in some runs and not in others, so they are not counted.

Low coverage: cmd/gentle-telemetry/main.go · ×122cmd/gentle-telemetry/main.go:1
Tests reach code only in some runs: internal/reviewtransaction/compact_reviewer_capture.go · ×2internal/reviewtransaction/compact_reviewer_capture.go:520

What to do

  1. Resolve the 122 Low coverage finding(s) in Code Coverage — start with main.go (6), shell_install.go (2), opencode.go (2). — One of this dimension's main actionable groups (122 warning-level).
  2. Resolve the 2 Tests reach code only in some runs finding(s) in Code Coverage — start with compact_reviewer_capture.go, model.go. — One of this dimension's main actionable groups (2 recommendation-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 43 tests. Measured on the JavaScript/TypeScript suite only — at least 1,313 test source file(s) (.py, .go) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). Go (2 modules): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.8 9.1 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.1 / 10 · rule-coverage 93% · ceiling Verified

5 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 15 of 15 direct requirement(s) were graded against proxy.golang.org (0 not served there, 1 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Outdated: github.com/BurntSushi/toml · ×5

✓ On the Gold path — maintain.

Detailed fixes: d12_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: Documented → Verified → Prevented · 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.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 41 required Go module(s) use a banned license. Licences were read per module version from the licence files pkg.go.dev detects (via api.deps.dev), over every module this repository's REDACTED requires, direct and indirect, at the version the build uses. Go records no test-only scope at module level, so modules only this repository's own tests import are included. 1 of them carry no licence file that matches a known SPDX licence; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Go module dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.9 / 10Strong✓ 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: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: internal/cli/review_facade.go (66×284=18744); internal/tui/model.go (57×230=13110); internal/cli/run.go (97×86=8342) Repeated repair below the complexity floor: internal/components/permissions/inject.go (10 of 11 changes were fixes); internal/agents/pi/adapter.go (9 of 17 changes were fixes); internal/cli/review_narration.go (9 of 15 changes were fixes)

Hotspot: internal/cli/review_facade.go · ×121internal/cli/review_facade.go:799
Repeated repair: internal/components/permissions/inject.go · ×43internal/components/permissions/inject.go:132

What to do

  1. Resolve the 121 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (3), shell_install.go (3), restore.go (2). — One of this dimension's main actionable groups (121 warning-level).
  2. Resolve the 43 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (4), adapter.go (4), runtime.go (2). — One of this dimension's main actionable groups (43 warning-level).

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

D16 · Bus Factor6.6 / 10Adequate✓ 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: Documented → Verified → Prevented · effective 6.6 / 10 · rule-coverage 100% · ceiling Documented

188 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is internal/reviewtransaction/transaction.go. Counted over 563 of the 805 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 188307 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 77 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 8 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D21 · Naming Consistency9.5 / 10Exemplary✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

3 naming inconsistencies among 571 declarations measured against a convention their peers follow.

`isInPATH` spells `PATH` where 579 names in the project spell it `Path`internal/cli/run.go:747
`codeGraphPnpmGlobalBin` spells `Pnpm` where 25 names in the project spell it `PNPM`internal/components/communitytool/tool.go:90
`defaultPnpmGlobalBin` spells `Pnpm` where 25 names in the project spell it `PNPM`internal/components/communitytool/tool.go:627

✓ On the Gold path — maintain.

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

D22 · Internal API Consistency0.0 / 10Critical✓ Tool-verified

What it measures: Whether the internal API surface is consistent and coherent.

Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Verified

1 API inconsistencies among 5 exposed members measured against a convention their peers follow.

`scripts.ReadUserAssets` returns a map (`map[K]V`) where its 4 siblings return a slice (`[]T`)scripts/user_helpers.go:27

What to do

  1. Resolve the 1 `scripts.ReadUserAssets` returns a map (`map[K]V`) where its 4 siblings… finding(s) in Internal API Consistency — start with user_helpers.go. — One of this dimension's main actionable groups (1 warning-level).

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

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

No domain types leak across context boundaries (2 contexts). Contexts: model, opencode.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value8.4 8.1 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 8.1 / 10 · rule-coverage 96% · ceiling Documented

6 of 365 judged comments only repeat the code they sit on (1.6 %). 17 comment(s) in another language or script were not judged.

redundant comment · ×6internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:233
doc comments repeat the namesinternal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:512

What to do

  1. Resolve the 6 redundant comment finding(s) in Comment Value — start with background-agents.ts (6). — One of this dimension's main actionable groups (6 recommendation-level).

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

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 % of calls cross a namespace and 0 % go through an interface, but 60 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.5 / 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: Documented → Verified → Prevented · effective 0.5 / 10 · rule-coverage 100% · ceiling Documented

72 finding(s): 0 critical, 10 high, 16 medium, 46 low. 1 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 12 file(s) — `deploy/telemetry/gentle-telemetry-backup.test.sh` (lines 71–73), `deploy/telemetry/install.sh` (lines 148–150), `e2e/lib.sh` (line 246, line 341), `e2e/shell-windows-crosscheck-guest.sh` (lines 4–81), `internal/assets/opencode/plugins-v2/opencode-review-transport.ts`, … (+7 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. No action in Static Analysis (SAST) — all 1 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (1 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities8.0 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 1 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 563 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is internal/agents/kilocode/adapter.go. Counted over 563 of the 805 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned files with no living knowledge
Orphaned fileinternal/agents/kilocode/adapter.go:1

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Stronggated by 9 serious findings✓ 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. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: adapter.go↔dependency_tree.go 90%; shell_experience_config.go↔shell_experience.go 80%; factory.go↔config_scan.go 80%

Change coupling: adapter.go ↔ dependency_tree.go · ×8internal/agents/pi/adapter.go:1
Change-coupling hub: factory.go → validate.go, setup.go, config_scan.gointernal/agents/factory.go

What to do

  1. Resolve the 8 Change coupling finding(s) in Change Coupling — start with shell_experience_advice.go (2), compact_gate.go (2), adapter.go. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with factory.go. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ 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: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.8 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation9.7 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `Adapter` declares 22 methods: `Agent`, `Tier`, `Detect`, `InstallCommand`, `GlobalConfigDir`, `SystemPromptDir`, `SystemPromptFile`, `SkillsDir`, `SettingsPath`, `SystemPromptStrategy`, `MCPStrategy`, `MCPConfigPath`, `SupportsOutputStyles`, `OutputStyleDir`, `SupportsSlashCommands`, `CommandsDir`, `SupportsSubAgents`, `SubAgentsDir`, `EmbeddedSubAgentsDir`, `SupportsSkills`, `SupportsSystemPrompt`, `SupportsMCP`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — internal/agents/interface.go:16

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
M1 · Documentation (README)10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

M2 · Architecture documentation10.0 / 10Exemplary✓ 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.

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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.

P2 · Observability8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • `internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts:78
  • `internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:98
  • `internal/assets/opencode/plugins/model-variants.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/assets/opencode/plugins/model-variants.ts:28
  • `internal/assets/opencode/plugins/model-variants.ts` reports through `console.*` at line 64 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/assets/opencode/plugins/model-variants.ts:64
  • `internal/assets/opencode/plugins/model-variants.ts` reports through `console.*` at line 74 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/assets/opencode/plugins/model-variants.ts:74
  • `internal/assets/opencode/plugins/skill-registry.ts` reports through `console.*` at line 154 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/assets/opencode/plugins/skill-registry.ts:154
  • `internal/assets/opencode/plugins/skill-registry.ts` reports through `console.*` at line 165 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/assets/opencode/plugins/skill-registry.ts:165
  • `internal/assets/opencode/plugins/skill-registry.ts` reports through `console.*` at line 172 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — internal/assets/opencode/plugins/skill-registry.ts:172

What to do

  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
P3 · Security & performance tooling5.0 / 10Adequate✓ 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 was searched, so you can tell an absence from a miss: the 12 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:4

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.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ 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 automation exists and the service already exposes health probe endpoints (healthz/livez/readyz or a container healthcheck), but no manifest in this repository wires them into readiness/liveness probes, a rolling-update strategy, lifecycle hooks or a migration job — a bad release is harder to detect and reverse. If that wiring lives in a separate ops/Helm repository, document the pointer here so release safety is evidenced. — REDACTED:554

What to do

  • Wire the existing health endpoints into readiness/liveness probes and a rolling-update (or blue/green) strategy in the deployment manifests — or document where that wiring lives — so a bad release is caught and rolled back automatically.
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
  • Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety2.1 / 10Critical✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

  • 8 typed · 31 plain JS — the untyped files are e2e/complete-generated-lock-sri.test.mjs, e2e/frozen-global-materialization.test.mjs, e2e/frozen-user-lock-acquisition.test.mjs, e2e/normalize-private-optional-platform-closure.test.mjs, e2e/shared-recovery.test.mjs, e2e/shared-settings-durability.test.mjs (+25 more).
R10 · Code Duplication4.9 / 10Weak✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • scripts/provision-gentle-shell-private-global.mjs:57 · scripts/provision-gentle-shell-windows.mjs:47 — the two spans are one implementation copied and then locally edited — 484 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/provision-gentle-shell-private-global.mjs:57
  • internal/assets/opencode/plugins-v2/opencode-review-transport.ts:89 · internal/assets/opencode/plugins/opencode-review-transport.ts:190 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:89
  • internal/assets/opencode/plugins-v2/opencode-review-transport.ts:140 · internal/assets/opencode/plugins/opencode-review-transport.ts:235 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:140
  • internal/assets/opencode/plugins-v2/telemetry-runtime.ts:60 · internal/assets/opencode/plugins/telemetry-runtime.ts:50 — the two spans are one implementation copied and then locally edited — 101 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — internal/assets/opencode/plugins-v2/telemetry-runtime.ts:60
  • scripts/provision-gentle-shell-private-global.mjs:249 · scripts/provision-gentle-shell-windows.mjs:219 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/provision-gentle-shell-private-global.mjs:249
  • scripts/provision-gentle-shell-private-global.mjs:944 · scripts/provision-gentle-shell-private-global.mjs:1007 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/provision-gentle-shell-private-global.mjs:944
  • scripts/provision-gentle-shell-private-global.mjs:489 · scripts/provision-gentle-shell-private-global.mjs:666 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/provision-gentle-shell-private-global.mjs:489
  • internal/assets/opencode/plugins-v2/opencode-review-transport.ts:218 · internal/assets/opencode/plugins-v2/opencode-review-transport.ts:241 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:218
  • scripts/normalize-private-optional-platform-closure.mjs:8 · scripts/provision-gentle-shell-private-global.mjs:479 — the two spans are one implementation copied and then locally edited — 89 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/normalize-private-optional-platform-closure.mjs:8
  • scripts/provision-gentle-shell-private-global.mjs:380 · scripts/provision-gentle-shell-private-global.mjs:447 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/provision-gentle-shell-private-global.mjs:380
  • scripts/provision-gentle-shell-private-global.mjs:527 · scripts/provision-gentle-shell-windows.mjs:324 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/provision-gentle-shell-private-global.mjs:527
  • scripts/provision-gentle-shell-private-global.mjs:936 · scripts/provision-gentle-shell-private-global.mjs:968 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/provision-gentle-shell-private-global.mjs:936

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity5.5 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • run has cyclomatic complexity 38 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins-v2/telemetry-runtime.ts:26
  • normalize has cyclomatic complexity 27 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/normalize-private-optional-platform-closure.mjs:24
  • nativeState has cyclomatic complexity 25 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:689
  • readReviewedList has cyclomatic complexity 23 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:112
  • reviewedSuppliers has cyclomatic complexity 22 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-windows.mjs:96
  • event has cyclomatic complexity 20 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins/telemetry-runtime.ts:23
  • (anonymous) has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:241
  • (anonymous) has cyclomatic complexity 18 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:118
  • assertCanonicalPackages has cyclomatic complexity 18 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:361
  • fixture has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — e2e/frozen-user-lock-acquisition.test.mjs:38
  • compare has cyclomatic complexity 17 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:956
  • rootAuthorities has cyclomatic complexity 17 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-windows.mjs:146
  • fixture has cyclomatic complexity 16 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — e2e/frozen-global-materialization.test.mjs:26
  • graphFastPath has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:634
  • packages has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-windows.mjs:453
  • (anonymous) has cyclomatic complexity 15 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:276
  • sourceMembers has cyclomatic complexity 15 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:921
  • mainOverlayComposition has cyclomatic complexity 14 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-windows.mjs:408
  • restore has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:297
  • (anonymous) has cyclomatic complexity 13 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins/opencode-review-transport.ts:219
  • refreshVariantsCache has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins/model-variants.ts:34
  • decodeReviewSessionID has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins/opencode-review-transport.ts:13
  • completeLock has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/complete-generated-lock-sri.mjs:34
  • tool.execute.after has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins/opencode-review-transport.ts:361
  • (anonymous) has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:218
  • graphStampsEqual has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-private-global.mjs:614
  • npmCommand has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/provision-gentle-shell-windows.mjs:252
R3 · Large Files10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

R4 · Test Coverage10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

R5 · Dependency Freshness10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.7 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 21 application, 0 tooling and 33 test entry point(s) detected in this repo. Nothing this repository declares compiles or type-checks these files, so a wrong deletion here would raise no compile error — gate removals on `pnpm test`, which loads the modules, and note that it only covers what it exercises. An undetected custom entry would make these reachable.
  • no import path from any entry point (21 application, 0 tooling, 33 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — scripts/crosslane/pirelay.mts, scripts/crosslane/harness.mts
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×2) — e2e/frozen-global-materialization.test.mjs:23, scripts/provision-gentle-shell-windows.mjs:210

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X19 · Unrestored process-global state4.8 / 10Weak✓ Tool-verified

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

  • `configureShellExperience` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GENTLE_AI_RECONFIGURE_TARGET` environment variable (set at line 257, cleared at line 259) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic. — internal/tui/shell_experience.go:134
  • `launchShellInstall` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GENTLE_AI_MAIN_FALLBACK` environment variable (set at line 132, cleared at line 134) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic. — internal/tui/shell_install.go:130
  • `finishShellInstallSelection` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GENTLE_AI_RECONFIGURE_TARGET` environment variable (set at line 915, cleared at line 917) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic. — internal/tui/shell_install.go:908

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional. In Python the same holds for `os.chdir`, `os.environ` and `sys.stdout`: pass `cwd=`/`env=` to `subprocess`, or use `contextlib.chdir`/`redirect_stdout`, rather than moving the global by hand. In Go the same holds for `os.Chdir` and `os.Setenv`: give the child `exec.Cmd.Dir`/`Env`, or `defer` the restore.
X2 · Cancellation propagation9.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 20/24 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `fetchLatestEngramVersionRequest` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:271
  • `fetchLatestEngramVersionWithAssets` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:368
  • `downloadAndExtractTarGz` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:717
  • `downloadAndExtractZip` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:767

What to do

  • Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard7.6 / 10Strong✓ Tool-verified

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

  • `lineStart` is the result of a search that answers -1 when nothing is found, and `content[lineStart:start]` uses it as a bound with no test of `lineStart` in between. When the search misses, the bound is -1 and the access panics with `slice bounds out of range`. Test `lineStart < 0` (or use `strings.Cut`) before using it. — REDACTED:1076
  • `floorMatch` holds what `FindStringSubmatch` returns, and `floorMatch[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(floorMatch)` (or nil) first, as the other call site does. — internal/components/engram/protocol.go:105
  • `floorMatch` holds what `FindStringSubmatch` returns, and `floorMatch[2]` takes element 2 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(floorMatch)` (or nil) first, as the other call site does. — internal/components/engram/protocol.go:106
  • `floorMatch` holds what `FindStringSubmatch` returns, and `floorMatch[3]` takes element 3 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(floorMatch)` (or nil) first, as the other call site does. — internal/components/engram/protocol.go:107

What to do

  • Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
X3 · Exception handling6.7 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `n, _ := strconv.Atoi(parts[i])` writes the call's error to `_` and then uses `n` as if the call succeeded. When `strconv.Atoi` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — internal/update/check.go:373, internal/system/deps.go:222
  • `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×24) — internal/update/detect.go:70, internal/update/homebrew.go:30, internal/update/module_path.go:145, …
  • `if err := detectCtx.Err(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/update/detect.go:83
  • `if err := cmd.Start(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/update/detect.go:86
  • `home, _ := os.UserHomeDir()` writes the call's error to `_` and then uses `home` as if the call succeeded. When `os.UserHomeDir` fails, `home` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `home` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/tui/model.go:170
  • `workspaceDir, _ := osGetwdFn()` writes the call's error to `_` and then uses `workspaceDir` as if the call succeeded. When `osGetwdFn` fails, `workspaceDir` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `workspaceDir` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/tui/model.go:3348
  • `major, _ := opencode.DetectRuntimeMajor(context.Background())` writes the call's error to `_` and then uses `major` as if the call succeeded. When `opencode.DetectRuntimeMajor` fails, `major` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `major` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/tui/opencode_presentation.go:14
  • `if err := os.Setenv(shellinstaller.RootRiskEnv, shellinstaller.RootRiskBinding); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/tui/shell_install.go:111
  • `if err := json.Unmarshal(raw, &f); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/telemetrycollector/metrics.go:151
  • `out, _ := json.Marshal(token)` writes the call's error to `_` and then uses `out` as if the call succeeded. When `json.Marshal` fails, `out` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `out` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/telemetry/runtime.go:96
  • `if _, err = rand.Read(id[:]); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/telemetry/runtime_send.go:60
  • `root, _ := resolveCodexHome(homeDir)` writes the call's error to `_` and then uses `root` as if the call succeeded. When `resolveCodexHome` fails, `root` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `root` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/system/codex_paths.go:15
  • `entries, _ := os.ReadDir(filepath.Join(homeDir, ".vscode", "extensions"))` writes the call's error to `_` and then uses `entries` as if the call succeeded. When `os.ReadDir` fails, `entries` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `entries` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/system/config_scan.go:101
  • `if _, err := exec.LookPath(binary); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/system/deps.go:149
  • `osReleaseContent, _ := osReleaseContent(runtime.GOOS)` writes the call's error to `_` and then uses `osReleaseContent` as if the call succeeded. When `osReleaseContent` fails, `osReleaseContent` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `osReleaseContent` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/system/detect.go:97
  • `if err := json.Unmarshal(line, &e); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/state/manifest.go:235

What to do

  • Discarded error (assigned to `_`, then its result used)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

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 Health44.2Weak — gated by D1, D2, R1, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture96.7ExemplarySolid.
Maturity95.1ExemplarySolid.
Readiness67.7AdequateAcceptable, with room to improve.
Security66.0Checked 5 of 11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance97.1ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 33 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • 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.
Not included — 54 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.
  • AX1 Captive dependencies — 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
  • 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • 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.
  • AXR1 Runtime accessibility — `go` is not on PATH — this repository boots from its toolchain's own run entry point (package main in cmd/gentle-telemetry starts an HTTP listener), so the tier cannot start it without that toolchain No runtime accessibility evidence was produced for this scan. This is a statement about THIS RUN's environment, not about the application: nothing here says the app is inaccessible, only that it was never rendered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • 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.
  • 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.
  • D25 ADR Conformance — None of 1 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.
  • 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.
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 11 strongly-typed id(s); 3 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (4 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 lens looks for (4 Go aggregate(s) recording domain events (own events-slice append / raise-record))
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • 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, and the automatic-re-run check to any GitHub-Actions workflow, 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'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 685 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
  • 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 — X1 reached only 4% of this repository's production lines — go (182,015 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 4% of this repository's production lines — go (182,015 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 4% of this repository's production lines — go (182,015 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 4% of this repository's production lines — go (182,015 lines), python (1,335 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — X25 reached only 4% of this repository's production lines — go (182,015 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X29 Per-element action decided by a fixed element — X29 reached only 4% of this repository's production lines — go (182,015 lines), python (1,335 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

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.

Critical — 13 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 2113 finding(s)
D8 · Code Coverage · Low coverage · ×122
  • Low coverage: cmd/gentle-telemetry/main.go cmd/gentle-telemetry/main.go:1 — 11.3% line coverage (23/203).
  • Low coverage: internal/agentbuilder/engine.go internal/agentbuilder/engine.go:1 — 44.8% line coverage (26/58).
  • Low coverage: internal/agents/kiro/errors.go internal/agents/kiro/errors.go:1 — 0.0% line coverage (0/2).
  • Low coverage: internal/app/bench_model_picker.go internal/app/bench_model_picker.go:1 — 0.0% line coverage (0/2).
  • Low coverage: internal/cli/shell_install.go internal/cli/shell_install.go:1 — 46.4% line coverage (128/276).
  • Low coverage: internal/cli/shell_install_platform_other.go internal/cli/shell_install_platform_other.go:1 — 32.3% line coverage (10/31).
  • Low coverage: internal/providercontractbundlecmd/main.go internal/providercontractbundlecmd/main.go:1 — 0.0% line coverage (0/33).
  • Low coverage: internal/releasepolicy/policy.go internal/releasepolicy/policy.go:1 — 6.7% line coverage (28/415).
  • Low coverage: internal/releasepolicycmd/main.go internal/releasepolicycmd/main.go:1 — 0.0% line coverage (0/9).
  • Low coverage: internal/reviewtransaction/bundle.go internal/reviewtransaction/bundle.go:1 — 34.0% line coverage (91/268).
  • Low coverage: internal/reviewtransaction/gate.go internal/reviewtransaction/gate.go:1 — 13.1% line coverage (41/312).
  • Low coverage: internal/reviewtransaction/receipt.go internal/reviewtransaction/receipt.go:1 — 44.6% line coverage (82/184).
  • Low coverage: internal/reviewtransaction/verification_convergence.go internal/reviewtransaction/verification_convergence.go:1 — 49.1% line coverage (28/57).
  • Low coverage: internal/shellinstaller/user_install_flow_unix.go internal/shellinstaller/user_install_flow_unix.go:1 — 39.8% line coverage (434/1091).
  • Low coverage: REDACTED REDACTED:1 — 41.5% line coverage (170/410).
  • Low coverage: internal/shellinstaller/user_main_bindings_unix.go internal/shellinstaller/user_main_bindings_unix.go:1 — 30.0% line coverage (18/60).
  • Low coverage: internal/shellinstaller/user_main_source_cache_unix.go internal/shellinstaller/user_main_source_cache_unix.go:1 — 39.3% line coverage (42/107).
  • Low coverage: internal/shellinstaller/user_native_bootstrap_unix.go internal/shellinstaller/user_native_bootstrap_unix.go:1 — 14.0% line coverage (7/50).
  • Low coverage: internal/shellinstaller/user_native_child_linux.go internal/shellinstaller/user_native_child_linux.go:1 — 40.0% line coverage (38/95).
  • Low coverage: internal/shellinstaller/user_native_control_linux.go internal/shellinstaller/user_native_control_linux.go:1 — 21.4% line coverage (6/28).
  • Low coverage: internal/shellinstaller/user_native_coordinate_linux.go internal/shellinstaller/user_native_coordinate_linux.go:1 — 21.8% line coverage (29/133).
  • Low coverage: internal/shellinstaller/user_native_install_linux.go internal/shellinstaller/user_native_install_linux.go:1 — 6.8% line coverage (4/59).
  • Low coverage: internal/shellinstaller/user_native_operation_linux.go internal/shellinstaller/user_native_operation_linux.go:1 — 45.3% line coverage (24/53).
  • Low coverage: internal/shellinstaller/user_native_owner_linux.go internal/shellinstaller/user_native_owner_linux.go:1 — 6.7% line coverage (3/45).
  • Low coverage: internal/shellinstaller/user_native_runtime_unix.go internal/shellinstaller/user_native_runtime_unix.go:1 — 39.1% line coverage (45/115).
  • + 97 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×121
  • Hotspot: internal/cli/review_facade.go internal/cli/review_facade.go:799 — internal/cli/review_facade.go changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 284 in cli.runReviewStatus at line 799. 51 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_facade.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/tui/model.go internal/tui/model.go:2100 — internal/tui/model.go changed 57 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 230 in Model.confirmSelection at line 2100. 24 of those changes were fix/bug commits, and the other 33 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/tui/model.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/run.go internal/cli/run.go:3343 — internal/cli/run.go changed 97 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in componentApplyStep.Run at line 3343. 72 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/run.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/shellinstaller/user_install_flow_unix.go internal/shellinstaller/user_install_flow_unix.go:218 — internal/shellinstaller/user_install_flow_unix.go changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in shellinstaller.userRunInstall at line 218. 21 of those changes were fix/bug commits, and the other 33 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/shellinstaller/user_install_flow_unix.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/review_status_contract.go internal/cli/review_status_contract.go:1239 — internal/cli/review_status_contract.go changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 167 in ReviewNextTransition.Validate at line 1239. 25 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_status_contract.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:712 — REDACTED changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in cli.syncBackupTargetsScoped at line 712. 45 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/components/uninstall/service.go internal/components/uninstall/service.go:431 — internal/components/uninstall/service.go changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in Service.buildPlan at line 431. 33 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/uninstall/service.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/tui/shell_experience.go internal/tui/shell_experience.go:134 — internal/tui/shell_experience.go changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in Model.configureShellExperience at line 134. 18 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/tui/shell_experience.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/review_operation_contract.go internal/cli/review_operation_contract.go:1429 — internal/cli/review_operation_contract.go changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in ReviewIntegrationFailure.Validate at line 1429. 16 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_operation_contract.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/app/app.go internal/app/app.go:91 — internal/app/app.go changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in app.RunArgs at line 91. 15 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, make sure the area it touches is under test, 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. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/app/app.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/review_next_transition.go internal/cli/review_next_transition.go:223 — internal/cli/review_next_transition.go changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in cli.resolveReviewNextTransition at line 223. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_next_transition.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/components/persona/inject.go internal/components/persona/inject.go:125 — internal/components/persona/inject.go changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in persona.injectInternal at line 125. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/persona/inject.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/components/engram/inject.go internal/components/engram/inject.go:748 — internal/components/engram/inject.go changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in engram.injectWithOptions at line 748. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/engram/inject.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/reviewtransaction/compact_store.go internal/reviewtransaction/compact_store.go:1727 — internal/reviewtransaction/compact_store.go changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in reviewtransaction.validateCompactSuccessor at line 1727. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/reviewtransaction/compact_store.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/reviewtransaction/compact.go internal/reviewtransaction/compact.go:1188 — internal/reviewtransaction/compact.go changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in CompactState.CompactReviewView at line 1188. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/reviewtransaction/compact.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/tui/shell_install.go internal/tui/shell_install.go:810 — internal/tui/shell_install.go changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in Model.updateShellInstall at line 810. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/tui/shell_install.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:384 — REDACTED changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in shellinstaller.userWindowsInventory at line 384. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/reviewtransaction/target_status.go internal/reviewtransaction/target_status.go:429 — internal/reviewtransaction/target_status.go changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in reviewtransaction.assessTargetStatusSnapshot at line 429. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/reviewtransaction/target_status.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/review_start_contract.go internal/cli/review_start_contract.go:176 — internal/cli/review_start_contract.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in ReviewIntegrationStartResult.Validate at line 176. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_start_contract.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/cli/review_artifact.go internal/cli/review_artifact.go:143 — internal/cli/review_artifact.go changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in cli.RunReviewCaptureResult at line 143. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_artifact.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/reviewtransaction/snapshot.go internal/reviewtransaction/snapshot.go:149 — internal/reviewtransaction/snapshot.go changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in SnapshotBuilder.build at line 149. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/reviewtransaction/snapshot.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/update/upgrade/executor.go internal/update/upgrade/executor.go:203 — internal/update/upgrade/executor.go changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in upgrade.managedAgentBackupPaths at line 203. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/update/upgrade/executor.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/provision-gentle-shell-private-global.mjs scripts/provision-gentle-shell-private-global.mjs:112 — scripts/provision-gentle-shell-private-global.mjs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in provision-gentle-shell-private-global.readReviewedList at line 112. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- scripts/provision-gentle-shell-private-global.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:192 — REDACTED changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in shellinstaller.userServiceWithPlan at line 192. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/components/communitytool/tool.go internal/components/communitytool/tool.go:148 — internal/components/communitytool/tool.go changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in communitytool.InstallWithOptions at line 148. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/communitytool/tool.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 96 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×43
  • Repeated repair: internal/components/permissions/inject.go internal/components/permissions/inject.go:132 — internal/components/permissions/inject.go changed 11 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is permissions.InjectAtPath at line 132), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(permissions): anchor Claude secret deny rules to the home directory (#5867)”; “fix(permissions): preserve existing Claude deny rules”; “fix(permissions): keep a user deny-by-default when merging the OpenCode overlay (#5311)”; “fix(opencode): align OpenCode permissions with the Pi safety model (#5273)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/permissions/inject.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/agents/pi/adapter.go internal/agents/pi/adapter.go:704 — internal/agents/pi/adapter.go changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is pi.repairPiEngramPackages at line 704), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(pi): preserve Engram pins before package installation”; “fix(pi): prevent and repair duplicate Engram declarations”; “fix(filemerge): preserve exact JSON numbers in managed merges (#5240)”; “fix(pi): ensure mcp.json on sync and migrate mcp-adapter.json servers (#5132)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/agents/pi/adapter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/cli/review_narration.go internal/cli/review_narration.go:52 — internal/cli/review_narration.go changed 15 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is cli.buildReviewNarrationRegistry at line 52), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(review): use plain narration and refresh Linux references”; “fix(review): offer eligible manual release for unbuildable correction”; “fix(review): report an unbuildable correction request as correction_request_unavailable”; “fix(review): align managed-assets narration with the agentless continuation (#5540)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_narration.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/reviewerprovider/contract.go internal/reviewerprovider/contract.go:204 — internal/reviewerprovider/contract.go changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is reviewerprovider.ContractFor at line 204), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(review): ask the refuter to echo request_hash as refuter_request_hash (#5865)”; “fix(review): include frozen dependency lockfile patches”; “fix(review): stop promising the validator content it is not handed”; “fix(review): decide validator inconclusiveness from a typed inspection field”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/reviewerprovider/contract.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/assets/opencode/plugins/skill-registry.ts internal/assets/opencode/plugins/skill-registry.ts:45 — internal/assets/opencode/plugins/skill-registry.ts changed 8 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is skill-registry.isProjectRoot at line 45), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(skill-registry): render a byte-identical disk registry shared with Gentle Shell (#6059)”; “fix(opencode): keep ENOENT missing resource neutral”; “fix(opencode): make skill-registry ENOENT diagnostic runtime-neutral”; “fix(opencode): use console.warn for skip-refresh (main contract test)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/assets/opencode/plugins/skill-registry.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/theme/inject.go internal/components/theme/inject.go:157 — internal/components/theme/inject.go changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is theme.InjectVisualThemes at line 157), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(theme): keep the sync settings contract while skipping the gentleman overlay (#6005)”; “fix(settings): preserve native TOML and YAML configuration (#5243)”; “fix(opencode): scope settings refusals to OpenCode and port new tests”; “fix(opencode): keep settings comments and refuse theme symlinks”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/theme/inject.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/communitytool/codegraph_guidance.go internal/components/communitytool/codegraph_guidance.go:448 — internal/components/communitytool/codegraph_guidance.go changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is communitytool.stripKnownUpstreamCodeGraphLines at line 448), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(opencode): reconcile CodeGraph wiring for native OpenCode configs (#5628)”; “fix(guidance): clarify nested codegraph worktree placement (#4151)”; “fix(codegraph): sync before numbered CLI read instruction”; “fix(codegraph): require fresh index before CLI intelligence reads”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/communitytool/codegraph_guidance.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/cli/review_intended_untracked.go internal/cli/review_intended_untracked.go:86 — internal/cli/review_intended_untracked.go changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is cli.intendedUntrackedDeclarationShape at line 86), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(review): keep the target selector in the intended-untracked submission (#5872)”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”; “fix(review): preserve selected untracked correction scope (#4445)”; “fix(review): keep the untracked binding through correction and name an exit for interior anomalies”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_intended_untracked.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:358 — REDACTED changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is mcp.removeInertSettingsMCPServers at line 358), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex): validate CODEX_HOME before configuration mutations (#5526)”; “fix(mcp): migrate only exact released Context7 defaults”; “fix(mcp): preserve configured Context7 servers during sync”; “fix(opencode): keep new settings refusals off other agents”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/filemerge/writer.go internal/components/filemerge/writer.go:253 — internal/components/filemerge/writer.go changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is filemerge.replaceDurably at line 253), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(filemerge): skip chmod when the forced mode already matches”; “fix(filemerge): ignore TOML headers in multiline strings and report mode-only changes”; “fix(filemerge): never widen forced zero modes and repair launcher exec bits”; “fix(filemerge): stop rewrites from widening existing file permissions”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/filemerge/writer.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/update/upgrade/strategy.go internal/update/upgrade/strategy.go:64 — internal/update/upgrade/strategy.go changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is upgrade.runStrategy at line 64), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(upgrade): route source-build self-updates through Go”; “fix(update): pin cross-major beta upgrade to checked revision (#4979)”; “fix(update): derive go-install module major from the target version (#4687, slice 2/2) (#4926)”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/update/upgrade/strategy.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/cli/review_transport_capability.go internal/cli/review_transport_capability.go:155 — internal/cli/review_transport_capability.go changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is cli.reviewImmutableRuntimeCapabilityChecking at line 155), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(review): name the user-owned exit in transport refusal messages”; “fix(review): resolve OpenCode review eligibility once per process (#5289)”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”; “fix(review): type the unavailable inspection and unbind materialize from the relay variable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_transport_capability.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/opencodeplugin/plugin.go internal/components/opencodeplugin/plugin.go:157 — internal/components/opencodeplugin/plugin.go changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is opencodeplugin.installGentleLogo at line 157), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(filemerge): stop rewrites from widening existing file permissions”; “fix(opencode): compensate the source when its own write lands with an error”; “fix(opencode): compensate tui.json too when registration lands with an error”; “fix(opencode): roll back the Gentle Logo source when TUI registration fails”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/opencodeplugin/plugin.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/agents/kimi/adapter.go internal/agents/kimi/adapter.go:399 — internal/agents/kimi/adapter.go changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Adapter.BootstrapTemplate at line 399), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kimi): declare rendered agents hub writes”; “fix(kimi): preserve current agents instructions”; “fix(kimi): expand current agents hub modules”; “fix(kimi): tighten current layout contracts”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/agents/kimi/adapter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/agents/antigravity/adapter.go internal/agents/antigravity/adapter.go:77 — internal/agents/antigravity/adapter.go changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is Adapter.Detect at line 77), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(antigravity): list both variant roots in doctor config dirs”; “fix(antigravity): load Gentle AI guidance through agy rules instead of GEMINI.md”; “fix(antigravity): target the agy 1.4 shared config root”; “fix(antigravity): accept legacy and variant roots in doctor config check”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/agents/antigravity/adapter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/gga/config.go internal/components/gga/config.go:140 — internal/components/gga/config.go changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is gga.Inject at line 140), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(restore): admit redirected APPDATA gga config dir as a restore root (#6027)”; “fix(gga): preserve unmapped configs and surface TUI notices”; “fix(gga): preserve configured providers during install and sync”; “fix(gga): generate compatible test exclusion patterns”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/gga/config.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/communitytool/codegraph_contract.go internal/components/communitytool/codegraph_contract.go:123 — internal/components/communitytool/codegraph_contract.go changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is communitytool.hasCodeGraphToolWiring at line 123), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(opencode): reconcile CodeGraph wiring for native OpenCode configs (#5628)”; “fix(agent): complete Conductor review contracts”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”; “fix(sync): scope community tool injectors to selected agents”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/communitytool/codegraph_contract.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/components/skills/inject.go internal/components/skills/inject.go:75 — internal/components/skills/inject.go changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is skills.directoryAssets at line 75), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codex): validate CODEX_HOME before configuration mutations (#5526)”; “fix(skills): remove the legacy shared marker on Windows and uninstall”; “fix(install): restore non-SDD assets dropped by the SDD retirement”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/components/skills/inject.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: bench/journeys_issue3766.go bench/journeys_issue3766.go:81 — bench/journeys_issue3766.go changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is main.waitForReviewModeTTY at line 81), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): restore original Gentle Shell presentation”; “fix(bench): navigate RDD from the stable Welcome origin”; “fix(bench): seed the update cooldown in j121's sandbox so the Update Available modal cannot cover the exchange”; “fix(tui): align RDD copy with advisory policy”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- bench/journeys_issue3766.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/cli/review_provider_correction.go internal/cli/review_provider_correction.go:62 — internal/cli/review_provider_correction.go changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is cli.reviewProviderCorrectSubjectHashEcho at line 62), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(review): bound complete role prompts and corrective retries”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”; “fix(review): launch Windows batch shims with a rebuilt command line and correct a target-identity echo”; “fix(review): retry a malformed targeted validator result once with admission feedback and preserve the refused payloads (#4076)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/cli/review_provider_correction.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/shellinstaller/user_main_snapshot.go internal/shellinstaller/user_main_snapshot.go:79 — internal/shellinstaller/user_main_snapshot.go changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is shellinstaller.userMainSnapshotUsing at line 79), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(shell): resolve the Main ref as a bare SHA (#6149)”; “fix(shell): report the supervisor on the Main preview update check”; “fix(shell): name the refused Main publisher response instead of an opaque error”; “fix(shell): pin Main to a qualified commit”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/shellinstaller/user_main_snapshot.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/agents/claude/adapter.go internal/agents/claude/adapter.go:104 — internal/agents/claude/adapter.go changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is claude.mergeUserConfig at line 104), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp): migrate only exact released Context7 defaults”; “fix(mcp): preserve configured Context7 servers during sync”; “fix(filemerge): stop rewrites from widening existing file permissions”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/agents/claude/adapter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/system/path.go internal/system/path.go:44 — internal/system/path.go changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is system.AddToUserPathWithResult at line 44), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(system): match expanded Windows PATH entries”; “fix(system): preserve PATH rollback on notification failures”; “fix(system): preserve Windows user PATH registry kind”; “fix(opencode): report effective managed activation readiness (#5282)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/system/path.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/opencode/runtime.go internal/opencode/runtime.go:122 — internal/opencode/runtime.go changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is opencode.brokenManagedLauncherFallback at line 122), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(opencode): allow slow runtime version probes”; “fix(opencode): preserve stable launcher targets across upgrades”; “fix(review): resolve OpenCode review eligibility once per process (#5289)”; “fix(opencode): bound discovery shutdown against escaped descendants and preserve read errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/opencode/runtime.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: internal/tui/progress.go internal/tui/progress.go:45 — internal/tui/progress.go changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ProgressState.Mark at line 45), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): complete installer progress after rollback”; “fix!: move the Go module path to /v3 so v3.x is installable through go install (#4683)”; “fix(installer): wait for pipeline completion”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 03:19:15 -03:00' --until='2026-11-16 03:19:15 -03:00' --full-history --no-merges -- internal/tui/progress.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 18 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×41
  • FileTooLong: tui/model.go internal/tui/model.go — FileTooLong — 3294 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: Model (85 blocks, 223-4984). The bar is 500 significant lines; this is 2794 over it, 6.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: cli/run.go internal/cli/run.go — FileTooLong — 3030 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2530 over it, 6.06× the bar. 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: cli/review_facade.go internal/cli/review_facade.go — FileTooLong — 1936 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1436 over it, 3.87× the bar. 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: REDACTED REDACTED — FileTooLong — 1683 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1183 over it, 3.37× the bar. 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: reviewtransaction/compact.go internal/reviewtransaction/compact.go — FileTooLong — 1529 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1029 over it, 3.06× the bar. 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: uninstall/service.go internal/components/uninstall/service.go — FileTooLong — 1524 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1024 over it, 3.05× the bar. 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: reviewtransaction/compact_store.go internal/reviewtransaction/compact_store.go — FileTooLong — 1515 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1015 over it, 3.03× the bar. 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: reviewtransaction/snapshot.go internal/reviewtransaction/snapshot.go — FileTooLong — 1321 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 821 over it, 2.64× the bar. 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: cli/review_status_contract.go internal/cli/review_status_contract.go — FileTooLong — 1276 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 776 over it, 2.55× the bar. 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: reviewtransaction/transaction.go internal/reviewtransaction/transaction.go — FileTooLong — 1233 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: Transaction (29 blocks, 208-1657). The bar is 500 significant lines; this is 733 over it, 2.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: cli/review_operation_contract.go internal/cli/review_operation_contract.go — FileTooLong — 1027 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 527 over it, 2.05× the bar. 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: reviewtransaction/verification_contract.go internal/reviewtransaction/verification_contract.go — FileTooLong — 1019 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 519 over it, 2.04× the bar. 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: engram/inject.go internal/components/engram/inject.go — FileTooLong — 983 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 483 over it, 1.97× the bar. 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: shellinstaller/user_install_flow_unix.go internal/shellinstaller/user_install_flow_unix.go — FileTooLong — 921 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 421 over it, 1.84× the bar. 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: reviewtransaction/risk.go internal/reviewtransaction/risk.go — FileTooLong — 914 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 414 over it, 1.83× the bar. 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: cli/review_next_transition.go internal/cli/review_next_transition.go — FileTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 344 over it, 1.69× the bar. 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: reviewtransaction/authority_repair.go internal/reviewtransaction/authority_repair.go — FileTooLong — 796 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 296 over it, 1.59× the bar. 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: app/app.go internal/app/app.go — FileTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 274 over it, 1.55× the bar. 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: communitytool/pi_codegraph.go internal/components/communitytool/pi_codegraph.go — FileTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 261 over it, 1.52× the bar. 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: REDACTED REDACTED — FileTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 248 over it, 1.50× the bar. 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: reviewtransaction/repository_locator.go internal/reviewtransaction/repository_locator.go — FileTooLong — 711 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 211 over it, 1.42× the bar. 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: recoverytrace/rows.go internal/recoverytrace/rows.go — FileTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 175 over it, 1.35× the bar. 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: opencode/background_readiness.go internal/opencode/background_readiness.go — FileTooLong — 673 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 173 over it, 1.35× the bar. 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: reviewtransaction/compact_reviewer_capture.go internal/reviewtransaction/compact_reviewer_capture.go — FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: CompactStore (8 blocks, 286-985). The bar is 500 significant lines; this is 168 over it, 1.34× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: screens/model_picker.go internal/tui/screens/model_picker.go — FileTooLong — 667 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 167 over it, 1.33× the bar. 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.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×34
  • Duplicated block (6 lines × 2) REDACTED:503 — REDACTED:503-508 | internal/cli/compatibility_writer_unix.go:251-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:503` 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/cli/review_facade.go:3102 — internal/cli/review_facade.go:3102-3107 | internal/cli/review_facade.go:3123-3128 — 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 (6 lines × 2) internal/cli/run.go:4142 — internal/cli/run.go:4142-4147 | REDACTED:903-908 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cli/run.go:4139` calls `retiredSDDAssetBackupPaths` and `REDACTED:901` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) REDACTED:1698 — REDACTED:1698-1703 | internal/components/communitytool/codegraph_guidance.go:251-256 — 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 `REDACTED:1698` 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) internal/shellinstaller/user_shell_launcher_unix.go:83 — internal/shellinstaller/user_shell_launcher_unix.go:83-88 | internal/shellinstaller/user_shell_launcher_windows.go:54-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_shell_launcher_unix.go:83` 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/tui/screens/review_store_reset.go:65 — internal/tui/screens/review_store_reset.go:65-70 | internal/tui/screens/review_store_reset.go:79-84 — 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/tui/screens/review_store_reset.go:65` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) internal/shellinstaller/user_launch_windows.go:88 — internal/shellinstaller/user_launch_windows.go:88-93 | internal/shellinstaller/user_launch_windows.go:165-170 — 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/app/app.go:1255 — internal/app/app.go:1255-1260 | internal/cli/run.go:5185-5190 — 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/app/app.go:1262 — internal/app/app.go:1262-1267 | internal/cli/run.go:5192-5197 — 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/components/engram/inject.go:1229 — internal/components/engram/inject.go:1229-1234 | internal/components/persona/inject.go:556-561 — 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/providercontractbundlecmd/main.go:14 — internal/providercontractbundlecmd/main.go:14-19 | internal/releaseprovenancecmd/main.go:14-19 — 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/agents/pi/config_dir.go:38 — internal/agents/pi/config_dir.go:38-43 | internal/state/home.go:31-36 — 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/shellinstaller/user_install_scope_unix.go:230 — internal/shellinstaller/user_install_scope_unix.go:230-235 | internal/shellinstaller/user_install_scope_windows.go:140-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) internal/cli/review_next_transition.go:1094 — internal/cli/review_next_transition.go:1094-1099 | internal/cli/review_next_transition.go:1131-1140 — 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) REDACTED:545 — REDACTED:545-550 | REDACTED:928-936 — 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 `REDACTED:545` 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/reviewtransaction/compact.go:1106 — internal/reviewtransaction/compact.go:1106-1112 | internal/reviewtransaction/compact_recovered_evidence.go:170-175 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/compact.go:1106` 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/components/agentguidance/pi_cleanup.go:42 — internal/components/agentguidance/pi_cleanup.go:42-47 | internal/components/antigravityrules/publish.go:184-189 — 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/components/agentguidance/pi_cleanup.go:42` 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/shellinstaller/user_codegraph_executable_unix.go:71 — internal/shellinstaller/user_codegraph_executable_unix.go:71-76 | internal/shellinstaller/user_install_flow_unix.go:762-767 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_codegraph_executable_unix.go:71` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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) REDACTED:2645 — REDACTED:2645-2650 | REDACTED:2665-2670 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:2662` calls `renderSyncSkippedAgents` and `REDACTED:2642` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) internal/providercontractbundle/bundle.go:182 — internal/providercontractbundle/bundle.go:182-187 | internal/providercontractbundle/bundle.go:224-229 — 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/providercontractbundle/bundle.go:182` 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) REDACTED:91 — REDACTED:91-96 | REDACTED:127-132 — 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 `REDACTED: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 (6 lines × 2) internal/cli/review.go:192 — internal/cli/review.go:192-197 | internal/cli/review.go:475-480 — 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/cli/review.go:192` 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) REDACTED:525 — REDACTED:525-530 | REDACTED:554-559 — 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 `REDACTED:525` 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/tui/screens/backups.go:117 — internal/tui/screens/backups.go:117-122 | internal/tui/screens/backups.go:180-185 — 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/tui/screens/backups.go:117` 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/reviewtransaction/authority_repair.go:857 — internal/reviewtransaction/authority_repair.go:857-862 | internal/reviewtransaction/authority_repair.go:1018-1023 — 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/reviewtransaction/authority_repair.go:857` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
  • + 9 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×31
  • Swallowed exception (caught, then discarded) internal/update/detect.go:70 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/detect.go:83 — `if err := detectCtx.Err(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/detect.go:86 — `if err := cmd.Start(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/homebrew.go:30 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/module_path.go:145 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/homebrew.go:31 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/scoop.go:31 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/scoop.go:70 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/scoop.go:82 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/scoop.go:88 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/strategy.go:339 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/update/upgrade/strategy.go:492 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/model.go:132 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/model.go:242 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/model.go:3530 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/shell_experience.go:42 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/shell_experience.go:89 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/shell_install.go:111 — `if err := os.Setenv(shellinstaller.RootRiskEnv, shellinstaller.RootRiskBinding); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/shell_install.go:482 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/tui/screens/model_picker.go:527 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/telemetrycollector/handlers.go:107 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/telemetrycollector/metrics.go:151 — `if err := json.Unmarshal(raw, &f); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:30 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/telemetry/runtime_send.go:46 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/telemetry/runtime_send.go:60 — `if _, err = rand.Read(id[:]); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×29
  • Duplicated block (5 lines × 2) internal/cli/doctor_tool_probe_unix.go:19 — internal/cli/doctor_tool_probe_unix.go:19-23 | internal/components/engram/healthprobe_process_unix.go:14-18 — 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/cli/doctor_tool_probe_unix.go:19` 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/cli/review.go:694 — internal/cli/review.go:694-698 | internal/cli/review_facade.go:3061-3065 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/cli/review.go:699` calls `String`, `Var` and `internal/cli/review_facade.go:3066` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/components/agenthooks/codex_telemetry.go:84 — internal/components/agenthooks/codex_telemetry.go:84-88 | internal/components/legacyassets/claude_hook.go:72-76 — 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/components/agenthooks/codex_telemetry.go:84` 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/components/uninstall/service.go:1459 — internal/components/uninstall/service.go:1459-1463 | internal/components/uninstall/service.go:1518-1522 — 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/components/uninstall/service.go:1459` 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 (5 lines × 2) internal/reviewtransaction/risk.go:1270 — internal/reviewtransaction/risk.go:1270-1274 | internal/reviewtransaction/verification_contract.go:1279-1283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/risk.go:1270` 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/reviewtransaction/store_lock.go:356 — internal/reviewtransaction/store_lock.go:356-360 | internal/reviewtransaction/store_lock.go:377-381 — 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/reviewtransaction/store_lock.go:356` 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/shellinstaller/user_context7_stage_unix.go:66 — internal/shellinstaller/user_context7_stage_unix.go:66-70 | internal/shellinstaller/user_experience_stage_unix.go:79-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_context7_stage_unix.go:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) internal/tui/screens/agent_builder_generating.go:18 — internal/tui/screens/agent_builder_generating.go:18-22 | internal/tui/screens/agent_builder_installing.go:18-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) internal/cli/review_facade.go:3452 — internal/cli/review_facade.go:3452-3456 | internal/reviewtransaction/compact_reviewer_capture.go:196-200 — 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/reviewtransaction/compact.go:1143 — internal/reviewtransaction/compact.go:1143-1147 | internal/reviewtransaction/compact_recovered_evidence.go:189-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/compact.go:1143` 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/reviewtransaction/store.go:258 — internal/reviewtransaction/store.go:258-262 | internal/reviewtransaction/store.go:276-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/reviewtransaction/store.go:258` 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/cli/review_status_contract.go:1554 — internal/cli/review_status_contract.go:1554-1558 | internal/cli/review_status_contract.go:1619-1623 — 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/reviewtransaction/compact_store.go:1778 — internal/reviewtransaction/compact_store.go:1778-1782 | internal/reviewtransaction/compact_store.go:1795-1799 — 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/reviewtransaction/compact_store.go:1778` 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/tui/screens/uninstall.go:345 — internal/tui/screens/uninstall.go:345-349 | internal/tui/screens/uninstall.go:360-364 — 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/tui/screens/uninstall.go:345` 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/cli/review_facade.go:2312 — internal/cli/review_facade.go:2312-2316 | internal/cli/review_reclaim.go:33-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/review_facade.go:2312` 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/reviewtransaction/verification_contract.go:451 — internal/reviewtransaction/verification_contract.go:451-455 | internal/reviewtransaction/verification_contract.go:546-550 — 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/reviewtransaction/verification_contract.go:451` 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) REDACTED:272 — REDACTED:272-276 | internal/shellinstaller/user_root_service_linux.go:103-107 — before extracting anything, compare `REDACTED` and `internal/shellinstaller/user_root_service_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:272` 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) bench/journeys_correction_unavailable.go:96 — bench/journeys_correction_unavailable.go:96-100 | bench/journeys_intended_untracked.go:464-469 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_correction_unavailable.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.
  • Duplicated block (5 lines × 2) bench/journeys_issue3766.go:53 — bench/journeys_issue3766.go:53-57 | bench/journeys_issue3766.go:62-66 — 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 `bench/journeys_issue3766.go:53` 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) bench/journeys_issue_3557.go:88 — bench/journeys_issue_3557.go:88-92 | bench/journeys_issue_3561.go:102-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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 (5 lines × 2) bench/journeys_reviewed_superset.go:224 — bench/journeys_reviewed_superset.go:224-228 | bench/journeys_reviewed_superset.go:285-289 — 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 `bench/journeys_reviewed_superset.go:224` 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) bench/journeys_reviewed_superset.go:217 — bench/journeys_reviewed_superset.go:217-221 | bench/journeys_reviewed_superset.go:278-282 — 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 `bench/journeys_reviewed_superset.go:217` 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 (5 lines × 2) bench/journeys_staged_delivery.go:14 — bench/journeys_staged_delivery.go:14-18 | bench/journeys_staged_delivery.go:27-31 — 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 `bench/journeys_staged_delivery.go:14` 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) bench/journeys_issue3772.go:41 — bench/journeys_issue3772.go:41-45 | bench/journeys_issue3813.go:66-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_issue3772.go:41` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) bench/journeys_issue4395.go:38 — bench/journeys_issue4395.go:38-42 | bench/journeys_issue4395.go:56-60 — 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 `bench/journeys_issue4395.go:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • + 4 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×27
  • FunctionTooLong: cli.runReviewStatus internal/cli/review_facade.go:799 — FunctionTooLong — runReviewStatus runs 514 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 414 over it, 5.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.newReviewIntegrationFailure internal/cli/review_operation_contract.go:660 — FunctionTooLong — newReviewIntegrationFailure runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: shellinstaller.userRunInstall internal/shellinstaller/user_install_flow_unix.go:218 — FunctionTooLong — userRunInstall runs 250 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 150 over it, 2.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: persona.injectInternal internal/components/persona/inject.go:125 — FunctionTooLong — injectInternal runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.runReviewFacadeStart internal/cli/review_facade.go:2386 — FunctionTooLong — runReviewFacadeStart runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.RunReviewRecover internal/cli/review_facade.go:1880 — FunctionTooLong — RunReviewRecover runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: recoverytrace.reviewAuthorityRows internal/recoverytrace/rows.go:258 — FunctionTooLong — reviewAuthorityRows runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.RunReviewCaptureResult internal/cli/review_artifact.go:143 — FunctionTooLong — RunReviewCaptureResult runs 175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: engram.injectWithOptions internal/components/engram/inject.go:748 — FunctionTooLong — injectWithOptions runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: app.RunArgs internal/app/app.go:91 — FunctionTooLong — RunArgs runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.RunPreparedInstall internal/cli/run.go:207 — FunctionTooLong — RunPreparedInstall runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: reviewtransaction.AdmitArtifact internal/reviewtransaction/artifact_admission.go:404 — FunctionTooLong — AdmitArtifact runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: reviewtransaction.assessTargetStatusSnapshot internal/reviewtransaction/target_status.go:429 — FunctionTooLong — assessTargetStatusSnapshot runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.componentPathsWithWorkspaceScoped internal/cli/run.go:4341 — FunctionTooLong — componentPathsWithWorkspaceScoped runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.validateReviewTransitionExecution internal/cli/review_status_contract.go:1671 — FunctionTooLong — validateReviewTransitionExecution runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.RunSync REDACTED:2281 — FunctionTooLong — RunSync runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentguidance.RenderRouting internal/components/agentguidance/routing.go:100 — FunctionTooLong — RenderRouting runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.resolveReviewNextTransition internal/cli/review_next_transition.go:223 — FunctionTooLong — resolveReviewNextTransition runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.syncBackupTargetsScoped REDACTED:712 — FunctionTooLong — syncBackupTargetsScoped runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: reviewtransaction.validateSuccessor internal/reviewtransaction/store.go:474 — FunctionTooLong — validateSuccessor runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: communitytool.InstallWithOptions internal/components/communitytool/tool.go:148 — FunctionTooLong — InstallWithOptions runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.RunReviewAssess internal/cli/review_assess.go:269 — FunctionTooLong — RunReviewAssess runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.reviewCapabilitiesStaticSurface internal/cli/review_capabilities.go:212 — FunctionTooLong — reviewCapabilitiesStaticSurface runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: reviewtransaction.RecoverCompactAuthority internal/reviewtransaction/compact_store.go:319 — FunctionTooLong — RecoverCompactAuthority runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.runSyncWithSelectionScope REDACTED:2053 — FunctionTooLong — runSyncWithSelectionScope runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×27
  • Duplicated block (10 lines × 2) internal/agents/capabilitymanifest/manifest.go:163 — internal/agents/capabilitymanifest/manifest.go:163-172 | internal/agents/capabilitymanifest/manifest.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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) internal/backup/restore.go:277 — internal/backup/restore.go:277-286 | internal/backup/restore.go:401-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. 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/cli/review_stop_hook.go:375 — internal/cli/review_stop_hook.go:375-384 | internal/cli/review_stop_hook.go:407-416 — 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/cli/review_stop_hook.go:375` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/cli/run.go:4497 — internal/cli/run.go:4497-4506 | REDACTED:1082-1091 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:4497` 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/opencode/background_remove_unix.go:38 — internal/opencode/background_remove_unix.go:38-47 | internal/opencode/background_remove_windows.go:28-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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 (10 lines × 2) internal/reviewtransaction/authority_repair.go:511 — internal/reviewtransaction/authority_repair.go:511-520 | internal/reviewtransaction/legacy_alias_repair.go:195-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/authority_repair.go:511` 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/reviewtransaction/compact_abandon.go:256 — internal/reviewtransaction/compact_abandon.go:256-265 | internal/reviewtransaction/compact_reclaim.go:153-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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/shellinstaller/user_experience_stage_windows.go:41 — internal/shellinstaller/user_experience_stage_windows.go:41-50 | internal/shellinstaller/user_main_source_unix.go:29-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_experience_stage_windows.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. 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/shellinstaller/user_native_operation_linux.go:74 — internal/shellinstaller/user_native_operation_linux.go:74-83 | internal/shellinstaller/user_native_slice_linux.go:239-248 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_native_operation_linux.go:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/shellinstaller/user_reviewed_stage_unix.go:53 — internal/shellinstaller/user_reviewed_stage_unix.go:53-62 | internal/shellinstaller/user_shell_pins_unix.go:64-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_reviewed_stage_unix.go:53` 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/shellinstaller/user_shell_registry_unix.go:93 — internal/shellinstaller/user_shell_registry_unix.go:93-102 | internal/shellinstaller/user_shell_registry_unix.go:133-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 `internal/shellinstaller/user_shell_registry_unix.go:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/app/app.go:976 — internal/app/app.go:976-985 | REDACTED:2342-2351 — 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/app/app.go:976` 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/shellinstaller/user_main_source_unix.go:87 — internal/shellinstaller/user_main_source_unix.go:87-96 | internal/shellinstaller/user_source_archive.go:111-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_main_source_unix.go:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/app/app.go:752 — internal/app/app.go:752-761 | internal/cli/run.go:4686-4695 — 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 (10 lines × 2) internal/components/engram/inject.go:1289 — internal/components/engram/inject.go:1289-1298 | internal/components/persona/inject.go:950-959 — 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 (10 lines × 2) internal/reviewtransaction/rar_authority_repository.go:652 — internal/reviewtransaction/rar_authority_repository.go:652-661 | internal/reviewtransaction/rar_plan_authority.go:567-576 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) internal/cli/opencode_background.go:95 — internal/cli/opencode_background.go:95-104 | internal/cli/pi_background.go:115-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) internal/cli/review_inspect_candidate.go:44 — internal/cli/review_inspect_candidate.go:44-53 | internal/cli/review_lens_context.go:172-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) internal/shellinstaller/user_engram_shared_windows.go:82 — internal/shellinstaller/user_engram_shared_windows.go:82-91 | internal/shellinstaller/user_system_git_windows.go:103-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) internal/shellinstaller/user_main_source_unix.go:19 — internal/shellinstaller/user_main_source_unix.go:19-28 | internal/shellinstaller/user_main_source_unix.go:101-110 — 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 (10 lines × 2) internal/shellinstaller/user_agent_state.go:168 — internal/shellinstaller/user_agent_state.go:168-177 | internal/shellinstaller/user_agent_state.go:181-190 — 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/shellinstaller/user_agent_state.go:168` 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/components/engram/antigravity_uninstall.go:80 — internal/components/engram/antigravity_uninstall.go:80-89 | internal/components/engram/inject.go:1540-1549 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/components/engram/antigravity_uninstall.go:80` 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/shellinstaller/user_install_cleanup_unix.go:123 — internal/shellinstaller/user_install_cleanup_unix.go:123-132 | internal/shellinstaller/user_install_cleanup_windows.go:101-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_install_cleanup_unix.go:123` 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/cli/telemetry.go:219 — internal/cli/telemetry.go:219-228 | internal/cli/telemetry.go:403-412 — 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/cli/telemetry.go:219` 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) bench/journeys_issue_3557.go:27 — bench/journeys_issue_3557.go:27-36 | bench/journeys_issue_3561.go:34-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_issue_3557.go:27` 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×27
  • Duplicated block (8 lines × 2) internal/cli/review_last_event_closure.go:103 — internal/cli/review_last_event_closure.go:103-110 | internal/cli/review_provider_roles.go:764-771 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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 (8 lines × 2) internal/cli/uninstall.go:58 — internal/cli/uninstall.go:58-65 | internal/cli/uninstall.go:70-77 — 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/components/communitytool/pi_codegraph.go:1065 — internal/components/communitytool/pi_codegraph.go:1065-1072 | internal/components/mutationjournal/journal.go:179-186 — 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/components/communitytool/pi_codegraph.go:1065` 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/components/skills/inject.go:93 — internal/components/skills/inject.go:93-100 | internal/update/upgrade/executor.go:415-422 — 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/components/skills/inject.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.
  • Duplicated block (8 lines × 2) internal/components/skills/inject.go:159 — internal/components/skills/inject.go:159-166 | internal/components/skills/support.go:192-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/components/skills/inject.go:159` 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/components/uninstall/opencode_agents.go:38 — internal/components/uninstall/opencode_agents.go:38-45 | internal/components/uninstall/opencode_agents.go:153-160 — 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/components/uninstall/opencode_agents.go:38` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/reviewtransaction/authority_repair.go:568 — internal/reviewtransaction/authority_repair.go:568-575 | internal/reviewtransaction/bundle.go:326-333 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/authority_repair.go:568` 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/reviewtransaction/compact_reviewer_capture.go:405 — internal/reviewtransaction/compact_reviewer_capture.go:405-412 | internal/reviewtransaction/compact_reviewer_capture.go:532-539 — 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/shellinstaller/user_agent_preimage_unix.go:101 — internal/shellinstaller/user_agent_preimage_unix.go:101-108 | REDACTED:155-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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 (8 lines × 2) internal/shellinstaller/user_main_source_cache_unix.go:92 — internal/shellinstaller/user_main_source_cache_unix.go:92-99 | internal/shellinstaller/user_main_source_unix.go:115-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) internal/state/manifest.go:110 — internal/state/manifest.go:110-117 | internal/telemetry/state.go:203-210 — 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 (8 lines × 2) internal/system/deps.go:219 — internal/system/deps.go:219-226 | internal/update/check.go:370-377 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) internal/tui/screens/backups.go:124 — internal/tui/screens/backups.go:124-131 | internal/tui/screens/backups.go:187-194 — 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/tui/screens/codex_model_picker.go:648 — internal/tui/screens/codex_model_picker.go:648-655 | internal/tui/screens/codex_model_picker.go:670-677 — 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/tui/screens/codex_model_picker.go:648` 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/update/upgrade/strategy.go:577 — internal/update/upgrade/strategy.go:577-584 | internal/update/upgrade/strategy.go:656-663 — 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/update/upgrade/strategy.go:577` 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/shellinstaller/user_install_scope_unix.go:60 — internal/shellinstaller/user_install_scope_unix.go:60-67 | internal/shellinstaller/user_install_scope_windows.go:40-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_install_scope_unix.go:60` 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/cli/uninstall.go:221 — internal/cli/uninstall.go:221-228 | internal/components/communitytool/tool.go:595-602 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `title` in one and `homeDir` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) internal/components/legacyassets/opencode_settings.go:434 — internal/components/legacyassets/opencode_settings.go:434-441 | REDACTED:366-373 — 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. Check import visibility before settling on that home: `internal/components/legacyassets/opencode_settings.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (8 lines × 2) internal/shellinstaller/user_channel_overlay_unix.go:82 — internal/shellinstaller/user_channel_overlay_unix.go:82-89 | internal/shellinstaller/user_channel_overlay_windows.go:45-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `error` to `r *userUnixOverlayRollback) push(undo func()` in one and `r *userWindowsOverlayRollback) push(undo func()` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) internal/shellinstaller/user_agent_state.go:93 — internal/shellinstaller/user_agent_state.go:93-100 | internal/shellinstaller/user_install_scope_unix.go:73-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_agent_state.go:93` 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/cli/run.go:393 — internal/cli/run.go:393-400 | REDACTED:2214-2221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:393` 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/components/legacyassets/claude_hook.go:43 — internal/components/legacyassets/claude_hook.go:43-50 | internal/components/legacyassets/opencode_settings.go:312-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/components/legacyassets/claude_hook.go:43` 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/cli/run.go:343 — internal/cli/run.go:343-350 | REDACTED:2196-2203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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 (8 lines × 2) bench/journeys_reviewed_superset.go:244 — bench/journeys_reviewed_superset.go:244-251 | bench/runner.go:175-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_reviewed_superset.go:244` 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) bench/journeys_issue_3557.go:100 — bench/journeys_issue_3557.go:100-107 | bench/journeys_issue_3561.go:114-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_issue_3557.go:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×26
  • Duplicated block (7 lines × 2) internal/cli/review_capture_unachievable.go:71 — internal/cli/review_capture_unachievable.go:71-77 | internal/cli/review_correction_plan_capture.go:37-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/cli/review_status_contract.go:1317 — internal/cli/review_status_contract.go:1317-1323 | internal/cli/review_status_contract.go:1422-1428 — 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/cli/review_status_contract.go:1317` 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/cli/run.go:4087 — internal/cli/run.go:4087-4093 | REDACTED:727-733 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:4087` 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/cli/run.go:4225 — internal/cli/run.go:4225-4231 | REDACTED:910-916 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:4225` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:917` calls `pathUnderHomeOnly` and `internal/cli/run.go:4232` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) internal/reviewtransaction/authority_repair.go:462 — internal/reviewtransaction/authority_repair.go:462-468 | internal/reviewtransaction/authority_repair.go:470-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. 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/reviewtransaction/compact_abandon.go:243 — internal/reviewtransaction/compact_abandon.go:243-249 | internal/reviewtransaction/compact_reclaim.go:143-149 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/compact_abandon.go:243` 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/reviewtransaction/rar_path_safety_unix.go:152 — internal/reviewtransaction/rar_path_safety_unix.go:152-158 | REDACTED:292-298 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/reviewtransaction/target_status.go:613 — internal/reviewtransaction/target_status.go:613-619 | internal/reviewtransaction/target_status.go:627-633 — 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) REDACTED:75 — REDACTED:75-81 | REDACTED:90-96 — 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 `REDACTED:75` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/shellinstaller/user_shell_registry_windows.go:250 — internal/shellinstaller/user_shell_registry_windows.go:250-256 | internal/shellinstaller/user_shell_registry_windows.go:269-275 — 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/shellinstaller/user_shell_registry_windows.go:250` 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/tui/screens/claude_model_picker.go:498 — internal/tui/screens/claude_model_picker.go:498-504 | internal/tui/screens/claude_model_picker.go:523-529 — 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/tui/screens/claude_model_picker.go:498` 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/cli/review_status_contract.go:1552 — internal/cli/review_status_contract.go:1552-1558 | internal/cli/review_status_contract.go:1580-1586 — 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/cli/review_status_contract.go:1552` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) internal/cli/run.go:4172 — internal/cli/run.go:4172-4178 | REDACTED:838-844 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/reviewtransaction/compact_reviewer_capture.go:575 — internal/reviewtransaction/compact_reviewer_capture.go:575-581 | internal/reviewtransaction/compact_reviewer_capture.go:708-714 — 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/reviewtransaction/compact_reviewer_capture.go:575` 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/tui/screens/codex_model_picker.go:503 — internal/tui/screens/codex_model_picker.go:503-509 | internal/tui/screens/model_picker.go:478-484 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/cli/review_status_contract.go:1200 — internal/cli/review_status_contract.go:1200-1206 | internal/reviewtransaction/verification_contract.go:1416-1422 — 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/reviewtransaction/compact_abandon.go:350 — internal/reviewtransaction/compact_abandon.go:350-356 | internal/reviewtransaction/legacy_alias_repair.go:264-270 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/compact_abandon.go:350` 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 (7 lines × 2) internal/cli/uninstall.go:161 — internal/cli/uninstall.go:161-167 | internal/cli/uninstall_opencode_plugin.go:153-159 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/uninstall.go:161` 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 (7 lines × 2) internal/cli/review_artifact.go:257 — internal/cli/review_artifact.go:257-263 | internal/cli/review_capture_unachievable.go:112-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/reviewtransaction/compact_abandon.go:284 — internal/reviewtransaction/compact_abandon.go:284-290 | internal/reviewtransaction/legacy_alias_repair.go:146-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/opencode/background_remove_unix.go:136 — internal/opencode/background_remove_unix.go:136-142 | internal/opencode/background_remove_unix.go:153-159 — 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/opencode/background_remove_unix.go:136` 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/shellinstaller/user_artifacts_windows.go:76 — internal/shellinstaller/user_artifacts_windows.go:76-82 | internal/shellinstaller/user_main_source_unix.go:138-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_artifacts_windows.go:76` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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) REDACTED:575 — REDACTED:575-581 | internal/cli/compatibility_writer_unix.go:161-167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) bench/journeys_capture_evidence_v5.go:98 — bench/journeys_capture_evidence_v5.go:98-104 | bench/journeys_wave1.go:320-326 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) bench/journeys_intended_untracked.go:312 — bench/journeys_intended_untracked.go:312-318 | bench/journeys_staged_delivery.go:95-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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.
  • + 1 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×21
  • MethodTooLong: Model.confirmSelection internal/tui/model.go:2100 — MethodTooLong — confirmSelection runs 630 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 530 over it, 6.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Model.handleKeyPress internal/tui/model.go:1672 — MethodTooLong — handleKeyPress runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Model.Update internal/tui/model.go:1068 — MethodTooLong — Update runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: componentApplyStep.Run internal/cli/run.go:3343 — MethodTooLong — Run runs 216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ReviewNextTransition.Validate internal/cli/review_status_contract.go:1239 — MethodTooLong — Validate runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ReviewTargetStatusResult.validateWithCompactAuthority internal/cli/review_status_contract.go:363 — MethodTooLong — validateWithCompactAuthority runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Service.buildPlan internal/components/uninstall/service.go:431 — MethodTooLong — buildPlan runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Model.View internal/tui/model.go:1509 — MethodTooLong — View runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Model.configureShellExperience internal/tui/shell_experience.go:134 — MethodTooLong — configureShellExperience runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: componentSyncStep.Run REDACTED:1468 — MethodTooLong — Run runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Model.goBack internal/tui/model.go:3685 — MethodTooLong — goBack runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CompactState.CompactReviewView internal/reviewtransaction/compact.go:1188 — MethodTooLong — CompactReviewView runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Service.componentOperations internal/components/uninstall/service.go:1147 — MethodTooLong — componentOperations runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Model.optionCount internal/tui/model.go:3979 — MethodTooLong — optionCount runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CompactState.Validate internal/reviewtransaction/compact.go:834 — MethodTooLong — Validate runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Service.executePlan internal/components/uninstall/service.go:659 — MethodTooLong — executePlan runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: syncRuntime.stagePlan REDACTED:515 — MethodTooLong — stagePlan runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ReviewIntegrationStartResult.Validate internal/cli/review_start_contract.go:176 — MethodTooLong — Validate runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: installRuntime.stagePlan internal/cli/run.go:929 — MethodTooLong — stagePlan runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Store.append internal/reviewtransaction/store.go:178 — MethodTooLong — append runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CompactStore.CaptureAdmittedReviewerResult internal/reviewtransaction/compact_reviewer_capture.go:346 — MethodTooLong — CaptureAdmittedReviewerResult runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×20
  • Duplicated block (11 lines × 2) REDACTED:85 — REDACTED:85-95 | REDACTED:59-69 — 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 `REDACTED:85` 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/cli/review_intended_untracked.go:175 — internal/cli/review_intended_untracked.go:175-185 | internal/reviewtransaction/store.go:874-884 — 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/cli/review_intended_untracked.go:175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/reviewtransaction/store.go:873` calls `sliceIsSubset` and `internal/cli/review_intended_untracked.go:174` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) internal/cli/review_store_reset.go:211 — internal/cli/review_store_reset.go:211-221 | internal/tui/screens/review_store_reset.go:228-238 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) internal/components/agenthooks/skill_registry.go:35 — internal/components/agenthooks/skill_registry.go:35-45 | internal/components/uninstall/service.go:1754-1764 — 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/components/agenthooks/skill_registry.go:35` 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) REDACTED:724 — REDACTED:724-734 | internal/update/upgrade/download.go:323-333 — 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 `REDACTED:724` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (11 lines × 2) REDACTED:202 — REDACTED:202-212 | REDACTED:235-245 — 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 `REDACTED:202` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/reviewtransaction/rar_path_safety.go:465 — internal/reviewtransaction/rar_path_safety.go:465-475 | internal/reviewtransaction/store_lock.go:194-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) internal/reviewtransaction/rar_path_safety.go:481 — internal/reviewtransaction/rar_path_safety.go:481-491 | internal/reviewtransaction/store_lock.go:213-223 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/rar_path_safety.go:481` 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/shellinstaller/user_artifacts_windows.go:42 — internal/shellinstaller/user_artifacts_windows.go:42-52 | internal/shellinstaller/user_main_source_unix.go:111-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_artifacts_windows.go:42` 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/shellinstaller/user_install_flow_unix.go:963 — internal/shellinstaller/user_install_flow_unix.go:963-973 | internal/shellinstaller/user_install_flow_unix.go:999-1009 — 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/shellinstaller/user_install_flow_unix.go:963` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) REDACTED:196 — REDACTED:196-206 | internal/shellinstaller/user_root_service_linux.go:40-50 — before extracting anything, compare `REDACTED` and `internal/shellinstaller/user_root_service_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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/tui/screens/codex_model_picker.go:671 — internal/tui/screens/codex_model_picker.go:671-681 | internal/tui/screens/codex_model_picker.go:698-708 — 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/tui/screens/codex_model_picker.go:671` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) internal/cli/shell_install_model_other.go:134 — internal/cli/shell_install_model_other.go:134-144 | internal/cli/shell_install_model_windows.go:108-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/shell_install_model_other.go:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) internal/cli/review_artifact.go:130 — internal/cli/review_artifact.go:130-140 | internal/reviewtransaction/store.go:27-37 — 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 (11 lines × 2) internal/tui/model.go:79 — internal/tui/model.go:79-91 | internal/tui/screens/sanitize.go:15-25 — 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 (11 lines × 2) internal/state/manifest.go:94 — internal/state/manifest.go:94-104 | internal/state/state.go:233-243 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) internal/shellinstaller/user_install_cleanup_unix.go:40 — internal/shellinstaller/user_install_cleanup_unix.go:40-50 | internal/shellinstaller/user_install_cleanup_windows.go:40-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_install_cleanup_unix.go:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) bench/journeys_edge.go:43 — bench/journeys_edge.go:43-53 | bench/runner.go:549-559 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) bench/journeys_issue_3065.go:132 — bench/journeys_issue_3065.go:132-142 | bench/journeys_wave1.go:358-368 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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 (11 lines × 2) REDACTED:113 — REDACTED:113-123 | scripts/crosslane/host.go:80-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:113` 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 (9 lines × 2) · ×20
  • Duplicated block (9 lines × 2) internal/app/app.go:1196 — internal/app/app.go:1196-1204 | internal/cli/run.go:5175-5183 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) REDACTED:251 — REDACTED:251-259 | internal/cli/compatibility_writer_unix.go:62-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:251` 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/cli/review_facade.go:1928 — internal/cli/review_facade.go:1928-1936 | internal/cli/review_facade.go:2315-2323 — 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/cli/run.go:2553 — internal/cli/run.go:2553-2561 | internal/cli/run.go:2604-2612 — 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/cli/run.go:2553` 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/components/agenthooks/codex_telemetry.go:72 — internal/components/agenthooks/codex_telemetry.go:72-80 | internal/components/agenthooks/skill_registry.go:154-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/components/agenthooks/codex_telemetry.go:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/agents/codex/runtime_version.go:174 — internal/agents/codex/runtime_version.go:174-182 | internal/opencode/background.go:193-201 — 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 (9 lines × 2) internal/cli/review_store_reset.go:185 — internal/cli/review_store_reset.go:185-193 | internal/tui/screens/review_store_reset.go:215-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.
  • Duplicated block (9 lines × 2) internal/components/uninstall/retired_sdd.go:143 — internal/components/uninstall/retired_sdd.go:143-151 | internal/update/upgrade/executor.go:348-356 — 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 (9 lines × 2) internal/cli/opencode_background.go:122 — internal/cli/opencode_background.go:122-130 | internal/cli/pi_background.go:142-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) internal/cli/review_consent_contract.go:129 — internal/cli/review_consent_contract.go:129-137 | internal/cli/review_mode.go:1042-1050 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) internal/agents/kiro/adapter.go:165 — internal/agents/kiro/adapter.go:165-175 | internal/agents/windsurf/adapter.go:112-120 — 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/agents/kiro/adapter.go:165` 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) REDACTED:276 — REDACTED:276-284 | REDACTED:376-384 — 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/cli/review.go:466 — internal/cli/review.go:466-474 | internal/cli/review.go:565-573 — 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/cli/review.go:466` 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/agentbuilder/installer.go:35 — internal/agentbuilder/installer.go:35-43 | internal/agentbuilder/installer.go:48-56 — 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/agentbuilder/installer.go:35` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) internal/reviewtransaction/snapshot.go:175 — internal/reviewtransaction/snapshot.go:175-183 | internal/reviewtransaction/snapshot.go:230-238 — 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/reviewtransaction/snapshot.go:175` 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/reviewtransaction/snapshot.go:175 — internal/reviewtransaction/snapshot.go:175-183 | internal/reviewtransaction/snapshot.go:190-198 — 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/reviewtransaction/snapshot.go:175` 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) bench/journeys_frozen_lineage_resume.go:212 — bench/journeys_frozen_lineage_resume.go:212-220 | bench/journeys_frozen_lineage_resume.go:294-302 — 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 (9 lines × 2) bench/journeys_issue_3065.go:147 — bench/journeys_issue_3065.go:147-155 | bench/journeys_wave1.go:378-386 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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) bench/journeys_edge.go:313 — bench/journeys_edge.go:313-323 | bench/journeys_edge.go:352-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. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_edge.go:313` 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) bench/journeys_lens_context_budget.go:32 — bench/journeys_lens_context_budget.go:32-40 | bench/journeys_provider_capture.go:99-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_lens_context_budget.go:32` 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 · Edited copy of a member (11 corresponding lines) · ×18
  • Edited copy of a member (11 corresponding lines) REDACTED:71 — REDACTED:71-81 | REDACTED:86-96 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/shellinstaller/user_runtime_primitives_unix.go:36 — internal/shellinstaller/user_runtime_primitives_unix.go:36-46 | internal/shellinstaller/user_runtime_primitives_unix.go:72-82 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/cli/uninstall.go:57 — internal/cli/uninstall.go:57-67 | internal/cli/uninstall.go:69-79 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/opencode/background_profile.go:114 — internal/opencode/background_profile.go:114-124 | internal/opencode/background_profile.go:129-139 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/shellinstaller/user_selection_other.go:35 — internal/shellinstaller/user_selection_other.go:35-45 | internal/shellinstaller/user_selection_windows.go:32-42 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/reviewtransaction/compact_recovered_evidence.go:79 — internal/reviewtransaction/compact_recovered_evidence.go:79-89 | internal/reviewtransaction/compact_result_reopen.go:269-279 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/reviewtransaction/rdd_mode.go:830 — internal/reviewtransaction/rdd_mode.go:830-840 | internal/reviewtransaction/rdd_mode.go:858-874 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/system/path.go:186 — internal/system/path.go:186-196 | internal/system/path.go:202-212 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/providercontractbundle/bundle.go:296 — internal/providercontractbundle/bundle.go:296-306 | internal/releasepolicy/policy.go:66-76 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/components/skills/inject.go:63 — internal/components/skills/inject.go:63-73 | internal/components/skills/support.go:82-92 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/components/uninstall/service.go:2320 — internal/components/uninstall/service.go:2320-2333 | internal/components/uninstall/service.go:2335-2345 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/reviewtransaction/repository_locator.go:336 — internal/reviewtransaction/repository_locator.go:336-346 | internal/reviewtransaction/repository_locator.go:667-677 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/cli/dryrun.go:50 — internal/cli/dryrun.go:50-60 | internal/tui/screens/review.go:76-87 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/telemetry/runtime_opencode.go:169 — internal/telemetry/runtime_opencode.go:169-180 | internal/telemetry/runtime_claude.go:89-99 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/opencode/background_readiness.go:1002 — internal/opencode/background_readiness.go:1002-1012 | internal/shellinstaller/user_engram_shared_windows.go:70-80 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) REDACTED:701 — REDACTED:701-713 | internal/pathidentity/identity.go:65-75 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/cli/review_provider_roles.go:894 — internal/cli/review_provider_roles.go:894-904 | internal/cli/review_status_contract.go:1953-1963 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) REDACTED:427 — REDACTED:427-437 | REDACTED:439-449 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×13
  • Edited copy of a member (8 corresponding lines) REDACTED:574 — REDACTED:574-581 | internal/cli/compatibility_writer_unix.go:160-167 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/components/filemerge/section.go:10 — internal/components/filemerge/section.go:10-20 | scripts/gen-sdd-agent-digests/assets.go:155-162 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/reviewtransaction/compact.go:217 — internal/reviewtransaction/compact.go:217-224 | internal/reviewtransaction/compact.go:237-244 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/reviewtransaction/artifact_subject.go:54 — internal/reviewtransaction/artifact_subject.go:54-64 | internal/reviewtransaction/classified_authority_replay.go:90-97 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/reviewtransaction/snapshot.go:1678 — internal/reviewtransaction/snapshot.go:1678-1685 | internal/reviewtransaction/store.go:824-831 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/cli/run.go:4731 — internal/cli/run.go:4731-4743 | internal/components/opencoderuntimeplugins/lifecycle.go:100-107 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/tui/model.go:3623 — internal/tui/model.go:3623-3633 | internal/app/selfupdate.go:193-200 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/tui/model.go:4458 — internal/tui/model.go:4458-4465 | internal/tui/screens/agents.go:12-19 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/components/legacyassets/sdd_agents.go:124 — internal/components/legacyassets/sdd_agents.go:124-134 | internal/tui/screens/model_picker.go:264-271 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/components/uninstall/service.go:1094 — internal/components/uninstall/service.go:1094-1101 | internal/opencode/background.go:463-473 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/components/engram/setup.go:42 — internal/components/engram/setup.go:42-49 | internal/components/engram/verify.go:32-39 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/tui/model.go:3612 — internal/tui/model.go:3612-3619 | internal/tui/screens/upgrade.go:226-236 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) bench/journeys_issue2879.go:84 — bench/journeys_issue2879.go:84-91 | bench/journeys_issue2995.go:241-251 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×12
  • Edited copy of a member (10 corresponding lines) internal/components/antigravityrules/publish.go:117 — internal/components/antigravityrules/publish.go:117-127 | internal/components/geminimodules/modules.go:226-235 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/components/communitytool/pi_codegraph.go:810 — internal/components/communitytool/pi_codegraph.go:810-819 | internal/components/communitytool/tool.go:373-383 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/reviewtransaction/compact_reclaim.go:326 — internal/reviewtransaction/compact_reclaim.go:326-335 | internal/reviewtransaction/compact_reclaim.go:368-377 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/shellinstaller/user_install_scope_unix.go:90 — internal/shellinstaller/user_install_scope_unix.go:90-99 | internal/shellinstaller/user_install_scope_windows.go:65-74 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/tui/model.go:3418 — internal/tui/model.go:3418-3427 | internal/tui/model.go:3446-3457 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/components/engram/setup.go:18 — internal/components/engram/setup.go:18-49 | internal/components/engram/verify.go:30-39 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/reviewtransaction/bundle.go:108 — internal/reviewtransaction/bundle.go:108-117 | internal/reviewtransaction/store.go:890-899 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/releasepolicy/policy.go:168 — internal/releasepolicy/policy.go:168-177 | internal/components/opencodedefault/ownership.go:203-212 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/run.go:3249 — internal/cli/run.go:3249-3259 | REDACTED:1034-1043 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/providercontractbundle/bundle.go:857 — internal/providercontractbundle/bundle.go:857-866 | internal/releasepolicy/policy.go:471-480 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) internal/cli/run.go:3332 — internal/cli/run.go:3332-3341 | internal/opencode/background.go:450-459 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) bench/journeys.go:423 — bench/journeys.go:423-432 | bench/journeys_capture_evidence_v5.go:111-120 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×11
  • Duplicated block (12 lines × 2) REDACTED:305 — REDACTED:305-316 | REDACTED:329-340 — 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 `REDACTED:305` 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/components/telemetryruntime/codex.go:72 — internal/components/telemetryruntime/codex.go:72-83 | internal/components/telemetryruntime/codex.go:92-103 — 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. 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/components/uninstall/opencode_agents.go:17 — internal/components/uninstall/opencode_agents.go:17-28 | internal/components/uninstall/opencode_agents.go:52-63 — 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 (12 lines × 2) internal/reviewtransaction/store.go:937 — internal/reviewtransaction/store.go:937-948 | internal/shellinstaller/user_launch_pin_cache_unix.go:121-132 — 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 (12 lines × 2) internal/telemetry/runtime.go:435 — internal/telemetry/runtime.go:435-446 | internal/telemetry/runtime_opencode.go:282-293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/telemetry/runtime.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.
  • Duplicated block (12 lines × 2) internal/reviewtransaction/authority_repair.go:257 — internal/reviewtransaction/authority_repair.go:257-268 | internal/reviewtransaction/authority_repair.go:324-335 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/reviewtransaction/authority_repair.go:269` calls `probeAuthorityRepairLock`, `Join` and `internal/reviewtransaction/authority_repair.go:336` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) internal/cli/review_facade.go:2415 — internal/cli/review_facade.go:2415-2426 | internal/cli/review_facade.go:3067-3078 — 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/cli/review_facade.go:2415` 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/app/app.go:454 — internal/app/app.go:454-465 | internal/app/app.go:504-515 — 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/app/app.go:454` 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) bench/axis_damaged_store.go:931 — bench/axis_damaged_store.go:931-942 | bench/axis_damaged_store.go:974-985 — 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 `bench/axis_damaged_store.go:931` 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 (12 lines × 2) bench/journeys_frozen_lineage_resume.go:162 — bench/journeys_frozen_lineage_resume.go:162-173 | bench/journeys_lens_context_budget.go:38-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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) bench/axis_damaged_store.go:581 — bench/axis_damaged_store.go:581-592 | bench/axis_damaged_store.go:617-628 — 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.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×10
  • Edited copy of a member (7 corresponding lines) internal/reviewtransaction/publish_immutable_darwin.go:19 — internal/reviewtransaction/publish_immutable_darwin.go:19-25 | internal/reviewtransaction/publish_immutable_linux.go:31-37 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/reviewtransaction/gate.go:500 — internal/reviewtransaction/gate.go:500-509 | internal/reviewtransaction/gate.go:511-517 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/reviewtransaction/gate.go:628 — internal/reviewtransaction/gate.go:628-634 | internal/reviewtransaction/snapshot.go:1460-1466 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/cli/review_capabilities.go:470 — internal/cli/review_capabilities.go:470-476 | internal/reviewtransaction/receipt.go:453-459 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/agents/pi/config_dir.go:28 — internal/agents/pi/config_dir.go:28-34 | internal/components/engram/caller_binary.go:16-22 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) bench/main.go:386 — bench/main.go:386-392 | internal/agentbuilder/registry.go:42-48 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/shellinstaller/user_system_git_windows.go:25 — internal/shellinstaller/user_system_git_windows.go:25-31 | internal/shellinstaller/user_system_go_windows.go:90-96 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) REDACTED:271 — REDACTED:271-277 | scripts/crosslane/host.go:119-125 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) REDACTED:143 — REDACTED:143-150 | scripts/crosslane/host.go:109-115 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) bench/axis_damaged_store.go:305 — bench/axis_damaged_store.go:305-311 | bench/axis_damaged_store_closure.go:331-337 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×10
  • Duplicated block (7 lines × 3) internal/cli/review_artifact.go:601 — internal/cli/review_artifact.go:601-607 | internal/reviewtransaction/compact_reviewer_capture.go:243-249 | internal/reviewtransaction/rar_authority_repository.go:707-713 — 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/cli/review_artifact.go:601` 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 × 3) internal/shellinstaller/user_artifacts_windows.go:46 — internal/shellinstaller/user_artifacts_windows.go:46-52 | internal/shellinstaller/user_main_source_cache_unix.go:92-98 | internal/shellinstaller/user_main_source_unix.go:115-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, 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 (7 lines × 3) internal/tui/screens/backups.go:87 — internal/tui/screens/backups.go:87-93 | internal/tui/screens/backups.go:148-154 | internal/tui/screens/backups.go:210-216 — 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 (7 lines × 3) internal/recoverytrace/generate.go:142 — internal/recoverytrace/generate.go:142-148 | internal/reviewtransaction/rar_authority_repository.go:691-697 | internal/state/state.go:367-373 — 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/cli/uninstall.go:205 — internal/cli/uninstall.go:205-211 | internal/tui/screens/uninstall.go:459-465 | internal/tui/screens/uninstall.go:476-482 — 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 (7 lines × 3) internal/shellinstaller/user_shell_pins_unix.go:22 — internal/shellinstaller/user_shell_pins_unix.go:22-28 | internal/shellinstaller/user_shell_pins_unix.go:82-88 | internal/shellinstaller/user_shell_pins_windows.go:72-78 — 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 (7 lines × 3) internal/tui/screens/shell_manage.go:18 — internal/tui/screens/shell_manage.go:18-24 | internal/tui/screens/shell_manage.go:84-90 | internal/tui/screens/shell_update.go:11-17 — 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/tui/screens/shell_manage.go:18` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/tui/screens/shell_update.go:19` calls `Render` and `internal/tui/screens/shell_manage.go:26` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) internal/opencode/background_remove_unix.go:116 — internal/opencode/background_remove_unix.go:116-122 | internal/opencode/background_remove_unix.go:136-142 | internal/opencode/background_remove_unix.go:153-159 — 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/opencode/background_remove_unix.go:116` 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 × 3) bench/axis_compatibility.go:177 — bench/axis_compatibility.go:177-183 | bench/journeys_finding_id_prefix.go:107-113 | bench/journeys_issue3587.go:49-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/axis_compatibility.go:177` 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 × 3) bench/journeys_intended_untracked.go:263 — bench/journeys_intended_untracked.go:263-269 | bench/journeys_local_gate_advance.go:86-92 | bench/journeys_reviewed_superset.go:124-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, 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.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×9
  • Edited copy of a member (16 corresponding lines) internal/agents/trae/adapter.go:136 — internal/agents/trae/adapter.go:136-151 | internal/agents/vscode/adapter.go:127-142 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/tui/screens/opencode_background.go:17 — internal/tui/screens/opencode_background.go:17-32 | internal/tui/screens/pi_background.go:17-32 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/cli/review.go:404 — internal/cli/review.go:404-419 | internal/components/uninstall/service.go:346-369 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/cli/review_capabilities.go:398 — internal/cli/review_capabilities.go:398-413 | internal/components/filemerge/writer.go:359-380 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) REDACTED:144 — REDACTED:144-159 | internal/components/persona/inject.go:563-580 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/agents/pi/adapter.go:559 — internal/agents/pi/adapter.go:559-576 | internal/agents/pi/adapter.go:580-595 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) internal/tui/screens/common.go:26 — internal/tui/screens/common.go:26-41 | internal/tui/screens/common.go:43-58 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) bench/journeys_intended_untracked.go:309 — bench/journeys_intended_untracked.go:309-324 | bench/journeys_staged_delivery.go:92-107 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) bench/axis_damaged_store.go:1441 — bench/axis_damaged_store.go:1441-1456 | bench/axis_damaged_store.go:1495-1510 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×9
  • Edited copy of a member (13 corresponding lines) internal/shellinstaller/user_system_git_windows.go:37 — internal/shellinstaller/user_system_git_windows.go:37-49 | internal/shellinstaller/user_system_go_windows.go:104-119 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/components/communitytool/pi_codegraph.go:1051 — internal/components/communitytool/pi_codegraph.go:1051-1063 | internal/components/mutationjournal/journal.go:154-173 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/app/app.go:1155 — internal/app/app.go:1155-1167 | internal/cli/run.go:5132-5144 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/review_artifact.go:128 — internal/cli/review_artifact.go:128-140 | internal/reviewtransaction/store.go:21-37 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/review_consent_contract.go:139 — internal/cli/review_consent_contract.go:139-151 | internal/cli/review_mode.go:1052-1067 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/components/opencodeplugin/plugin.go:332 — internal/components/opencodeplugin/plugin.go:332-344 | internal/releasepolicy/policy.go:487-501 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/cli/validate.go:335 — internal/cli/validate.go:335-347 | internal/components/skills/presets.go:40-52 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) internal/components/agentguidance/orchestrator_module_install.go:230 — internal/components/agentguidance/orchestrator_module_install.go:230-242 | REDACTED:174-186 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) bench/journeys_issue3766.go:81 — bench/journeys_issue3766.go:81-93 | bench/journeys_issue3776.go:38-51 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×9
  • Duplicated block (16 lines × 2) internal/app/app.go:913 — internal/app/app.go:913-928 | internal/cli/run.go:479-494 — 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 (16 lines × 2) internal/backup/restore.go:357 — internal/backup/restore.go:357-372 | internal/backup/restore.go:467-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/backup/restore.go:357` 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 (16 lines × 2) internal/cli/doctor.go:453 — internal/cli/doctor.go:453-468 | internal/opencode/background_readiness.go:1026-1041 — 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/cli/doctor.go:453` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/cli/review_artifact.go:227 — internal/cli/review_artifact.go:227-242 | internal/cli/review_capture_unachievable.go:92-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) internal/components/engram/inject.go:980 — internal/components/engram/inject.go:980-995 | internal/components/engram/inject.go:1018-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.
  • Duplicated block (16 lines × 2) internal/components/uninstall/service.go:1605 — internal/components/uninstall/service.go:1605-1620 | internal/components/uninstall/service.go:1650-1665 — 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/components/uninstall/service.go:1605` 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) internal/shellinstaller/user_launch_windows.go:69 — internal/shellinstaller/user_launch_windows.go:69-84 | internal/shellinstaller/user_launch_windows.go:149-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/shellinstaller/user_launch_windows.go:85` calls `userWindowsInventory` and `internal/shellinstaller/user_launch_windows.go:165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) internal/update/homebrew.go:47 — internal/update/homebrew.go:47-62 | internal/update/upgrade/homebrew.go:48-63 — before extracting anything, compare `internal/update/homebrew.go` and `internal/update/upgrade/homebrew.go` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) bench/journeys_issue_3065.go:166 — bench/journeys_issue_3065.go:166-181 | bench/journeys_wave1.go:459-476 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_wave1.go:459` 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.
X3 · Exception handling · Discarded error (assigned to `_`, then its result used) · ×9
  • Discarded error (assigned to `_`, then its result used) internal/update/check.go:373 — `n, _ := strconv.Atoi(parts[i])` writes the call's error to `_` and then uses `n` as if the call succeeded. When `strconv.Atoi` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/tui/model.go:170 — `home, _ := os.UserHomeDir()` writes the call's error to `_` and then uses `home` as if the call succeeded. When `os.UserHomeDir` fails, `home` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `home` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/tui/model.go:3348 — `workspaceDir, _ := osGetwdFn()` writes the call's error to `_` and then uses `workspaceDir` as if the call succeeded. When `osGetwdFn` fails, `workspaceDir` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `workspaceDir` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/tui/opencode_presentation.go:14 — `major, _ := opencode.DetectRuntimeMajor(context.Background())` writes the call's error to `_` and then uses `major` as if the call succeeded. When `opencode.DetectRuntimeMajor` fails, `major` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `major` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/telemetry/runtime.go:96 — `out, _ := json.Marshal(token)` writes the call's error to `_` and then uses `out` as if the call succeeded. When `json.Marshal` fails, `out` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `out` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/system/codex_paths.go:15 — `root, _ := resolveCodexHome(homeDir)` writes the call's error to `_` and then uses `root` as if the call succeeded. When `resolveCodexHome` fails, `root` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `root` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/system/config_scan.go:101 — `entries, _ := os.ReadDir(filepath.Join(homeDir, ".vscode", "extensions"))` writes the call's error to `_` and then uses `entries` as if the call succeeded. When `os.ReadDir` fails, `entries` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `entries` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/system/deps.go:222 — `n, _ := strconv.Atoi(parts[i])` writes the call's error to `_` and then uses `n` as if the call succeeded. When `strconv.Atoi` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/system/detect.go:97 — `osReleaseContent, _ := osReleaseContent(runtime.GOOS)` writes the call's error to `_` and then uses `osReleaseContent` as if the call succeeded. When `osReleaseContent` fails, `osReleaseContent` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `osReleaseContent` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: adapter.go ↔ dependency_tree.go internal/agents/pi/adapter.go:1 — `internal/agents/pi/adapter.go` and `internal/tui/screens/dependency_tree.go` change together 90% of the time (18 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `7972a443` fix(pi): prevent and repair duplicate Engram declarations; `c4de51f2` feat(pi): retire pi-mcp-adapter in favor of Pi built-in MCP (#5121); `8b72e249` chore(pi): retire rpiv-ask-user-question now that gentle-pi ships ask… — run `git show` on any of them.
  • Change coupling: shell_experience_config.go ↔ shell_experience.go internal/tui/screens/shell_experience_config.go:1 — `internal/tui/screens/shell_experience_config.go` and `internal/tui/shell_experience.go` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `01b1a031` feat(shell): remove GGA from the Gentle Shell installer; `d246b249` feat(tui): put uninstall last and label pending manage actions; `a54f9be2` fix(shell): keep the TUI install path reachable — run `git show` on any of them.
  • Change coupling: shell_experience_advice.go ↔ shell_experience.go internal/tui/screens/shell_experience_advice.go:1 — `internal/tui/screens/shell_experience_advice.go` and `internal/tui/shell_experience.go` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `01b1a031` feat(shell): remove GGA from the Gentle Shell installer; `9b3c4e91` fix(shell): enable CodeGraph by default on Windows; `3a074aca` refactor(shell): remove the test-only completion preview — run `git show` on any of them.
  • Change coupling: compact_gate.go ↔ prepr.go internal/reviewtransaction/compact_gate.go:1 — `internal/reviewtransaction/compact_gate.go` and `internal/reviewtransaction/prepr.go` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `822b290b` fix(review): admit companion test paths in a bounded correction; `3d9fa076` fix(review): preserve receipts across local parent merges; `76593278` fix(review): bind pre-pr candidates to merge-base — run `git show` on any of them.
  • Change coupling: validate.go ↔ config_scan.go internal/cli/validate.go:1 — `internal/cli/validate.go` and `internal/system/config_scan.go` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c5282d1c` feat(registration): wire hermes into factory, catalog, config scan, c…; `dcbba08e` feat(agent): add Trae IDE as first-class agent (#532); `9c541e2d` feat(agent): add pi support — run `git show` on any of them.
  • Change coupling: types.go ↔ config_scan.go internal/model/types.go:1 — `internal/model/types.go` and `internal/system/config_scan.go` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `855ea658` feat(agent): add Conductor workspace orchestrator support; `dcbba08e` feat(agent): add Trae IDE as first-class agent (#532); `9c541e2d` feat(agent): add pi support — run `git show` on any of them.
  • Change coupling: compact_gate.go ↔ gate.go internal/reviewtransaction/compact_gate.go:1 — `internal/reviewtransaction/compact_gate.go` and `internal/reviewtransaction/gate.go` change together 52% of the time (14 of the 27 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `fe263c32` fix(review): preserve advertised remote failures; `3d9fa076` fix(review): preserve receipts across local parent merges; `76593278` fix(review): bind pre-pr candidates to merge-base — run `git show` on any of them.
  • Change coupling: shell_experience_advice.go ↔ shell_install.go internal/tui/screens/shell_experience_advice.go:1 — `internal/tui/screens/shell_experience_advice.go` and `internal/tui/shell_install.go` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `01b1a031` feat(shell): remove GGA from the Gentle Shell installer; `3a074aca` refactor(shell): remove the test-only completion preview; `d51357f7` feat(shell): preview the completion rose from Manage — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×8
  • Edited copy of a member (21 corresponding lines) internal/components/communitytool/pi_codegraph.go:1064 — internal/components/communitytool/pi_codegraph.go:1064-1084 | internal/components/mutationjournal/journal.go:178-205 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/shellinstaller/user_agent_tools_unix.go:50 — internal/shellinstaller/user_agent_tools_unix.go:50-73 | internal/shellinstaller/user_install_flow_unix.go:852-872 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/tui/screens/backups.go:83 — internal/tui/screens/backups.go:83-103 | internal/tui/screens/backups.go:144-166 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/components/legacyassets/sdd_assets.go:239 — internal/components/legacyassets/sdd_assets.go:239-263 | internal/components/uninstall/service.go:1412-1432 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/reviewtransaction/artifact_subject.go:142 — internal/reviewtransaction/artifact_subject.go:142-162 | internal/reviewtransaction/artifact_subject.go:164-185 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) internal/cli/validate.go:178 — internal/cli/validate.go:178-198 | internal/cli/validate.go:200-220 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) bench/journeys_wave1.go:919 — bench/journeys_wave1.go:919-939 | bench/journeys_wave1.go:1017-1039 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) bench/journeys_issue_3043.go:11 — bench/journeys_issue_3043.go:11-31 | bench/journeys_provider_capture.go:39-68 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×8
  • Duplicated block (14 lines × 2) internal/app/app.go:986 — internal/app/app.go:986-999 | REDACTED:2357-2370 — 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/app/app.go:986` 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/cli/run.go:4249 — internal/cli/run.go:4249-4262 | REDACTED:942-955 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:4249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cli/run.go:4248` calls `Contains` and `REDACTED:941` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) internal/cli/run.go:4823 — internal/cli/run.go:4823-4836 | REDACTED:2774-2787 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/run.go:4823` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) internal/cli/validate.go:253 — internal/cli/validate.go:253-266 | internal/tui/model.go:4419-4432 — 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/cli/validate.go:253` 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) REDACTED:718 — REDACTED:718-731 | REDACTED:768-781 — 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. 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/components/opencodeagents/agents.go:185 — internal/components/opencodeagents/agents.go:185-198 | internal/components/opencodeagents/agents.go:244-257 — 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 (14 lines × 2) internal/components/uninstall/service.go:176 — internal/components/uninstall/service.go:176-189 | internal/components/uninstall/service.go:195-208 — 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 (14 lines × 2) internal/tui/screens/upgrade.go:133 — internal/tui/screens/upgrade.go:133-146 | internal/tui/screens/upgrade_sync.go:132-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/screens/upgrade.go:133` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/tui/screens/upgrade.go:129` calls `WriteString`, `Render`, `String` and `internal/tui/screens/upgrade_sync.go:129` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×7
  • Edited copy of a member (15 corresponding lines) internal/cli/run.go:653 — internal/cli/run.go:653-670 | REDACTED:61-75 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/shellinstaller/user_native_operation_linux.go:69 — internal/shellinstaller/user_native_operation_linux.go:69-83 | internal/shellinstaller/user_native_slice_linux.go:234-248 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/releasepolicy/policy.go:78 — internal/releasepolicy/policy.go:78-95 | internal/reviewtransaction/repository_locator.go:1058-1072 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) REDACTED:396 — REDACTED:396-421 | internal/tui/model.go:4391-4405 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/system/deps.go:201 — internal/system/deps.go:201-215 | internal/update/check.go:351-365 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) internal/tui/model.go:272 — internal/tui/model.go:272-286 | internal/cli/run.go:5106-5120 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) bench/journeys_edge.go:596 — bench/journeys_edge.go:596-612 | bench/journeys_edge.go:633-647 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×7
  • Edited copy of a member (12 corresponding lines) internal/cli/doctor_tool_probe_unix.go:18 — internal/cli/doctor_tool_probe_unix.go:18-29 | internal/components/engram/healthprobe_process_unix.go:13-27 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/cli/review_store_reset.go:195 — internal/cli/review_store_reset.go:195-206 | internal/reviewtransaction/store_reset.go:286-299 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/cli/review_intended_untracked.go:171 — internal/cli/review_intended_untracked.go:171-185 | internal/reviewtransaction/store.go:873-884 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/reviewtransaction/classified_authority_replay.go:259 — internal/reviewtransaction/classified_authority_replay.go:259-273 | internal/shellinstaller/user_components.go:20-31 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/cli/review_assess.go:212 — internal/cli/review_assess.go:212-223 | internal/cli/review_escalation.go:49-60 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/reviewtransaction/compact.go:2047 — internal/reviewtransaction/compact.go:2047-2058 | internal/reviewtransaction/transaction.go:321-332 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) bench/axis_damaged_store.go:998 — bench/axis_damaged_store.go:998-1009 | bench/axis_damaged_store.go:1011-1027 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×7
  • Edited copy of a member (9 corresponding lines) internal/app/app.go:848 — internal/app/app.go:848-856 | internal/app/app.go:858-866 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:871 — REDACTED:871-879 | internal/update/upgrade/download.go:388-398 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) internal/system/deps.go:218 — internal/system/deps.go:218-226 | internal/update/check.go:369-377 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) bench/journeys_repository_context.go:201 — bench/journeys_repository_context.go:201-209 | bench/journeys_wave1.go:212-220 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) bench/journeys_wave1.go:716 — bench/journeys_wave1.go:716-724 | bench/journeys_wave1.go:741-749 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) bench/journeys.go:655 — bench/journeys.go:655-663 | bench/journeys_edge.go:88-99 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) scripts/crosslane/host.go:98 — scripts/crosslane/host.go:98-106 | REDACTED:131-139 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×7
  • Edited copy of a member (14 corresponding lines) internal/shellinstaller/user_install_flow_unix.go:1357 — internal/shellinstaller/user_install_flow_unix.go:1357-1370 | internal/shellinstaller/user_install_flow_unix.go:1374-1392 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/tui/screens/model_picker.go:569 — internal/tui/screens/model_picker.go:569-582 | internal/tui/screens/model_picker.go:601-617 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/recoverytrace/generate.go:365 — internal/recoverytrace/generate.go:365-378 | internal/recoverytrace/generate.go:401-414 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/components/filemerge/section.go:101 — internal/components/filemerge/section.go:101-118 | internal/components/agentguidance/orchestrator.go:506-519 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) bench/journeys_local_gate_advance.go:209 — bench/journeys_local_gate_advance.go:209-222 | bench/journeys_reviewed_superset.go:297-311 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) bench/journeys_issue_3065.go:58 — bench/journeys_issue_3065.go:58-71 | bench/journeys_wave1.go:1250-1264 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) REDACTED:462 — REDACTED:462-477 | scripts/crosslane/host.go:129-142 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×7
  • Duplicated block (15 lines × 2) internal/backup/restore.go:260 — internal/backup/restore.go:260-274 | internal/backup/restore.go:384-398 — 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/backup/restore.go:260` 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) REDACTED:1435 — REDACTED:1435-1449 | internal/tui/model.go:3430-3444 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) internal/components/communitytool/tool.go:213 — internal/components/communitytool/tool.go:213-227 | internal/components/communitytool/tool.go:321-335 — 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/components/communitytool/tool.go:213` 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 (15 lines × 2) internal/reviewtransaction/rar_plan_authority.go:424 — internal/reviewtransaction/rar_plan_authority.go:424-438 | internal/reviewtransaction/rar_plan_authority.go:492-506 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/reviewtransaction/rar_plan_authority.go:439` calls `publishPrivateRARImmutable`, `planObjectPath` and `internal/reviewtransaction/rar_plan_authority.go:507` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) internal/telemetrycollector/summary.go:138 — internal/telemetrycollector/summary.go:138-152 | internal/telemetrycollector/summary.go:172-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.
  • Duplicated block (15 lines × 2) internal/tui/screens/community_tool_result.go:52 — internal/tui/screens/community_tool_result.go:52-66 | internal/tui/screens/community_tools.go:120-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/screens/community_tool_result.go:52` 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 (15 lines × 2) bench/axis_damaged_store.go:779 — bench/axis_damaged_store.go:779-793 | bench/axis_damaged_store.go:1331-1345 — 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 `bench/axis_damaged_store.go:779` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
D3 · God Classes · ClassTooLong · ×6
  • ClassTooLong: Model internal/tui/model.go:649 — ClassTooLong — 2579 significant lines (blank, comment-only and punctuation-only lines excluded), 110 methods, 85 blocks, lines 223-4984. The bar is 400 significant lines; this is 2179 over it, 6.45× the bar. 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.
  • ClassTooLong: Transaction internal/reviewtransaction/transaction.go:208 — ClassTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods, 29 blocks, lines 208-1657. The bar is 400 significant lines; this is 349 over it, 1.87× the bar. 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.
  • ClassTooLong: SnapshotBuilder internal/reviewtransaction/snapshot.go:111 — ClassTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods, 29 blocks, lines 111-1534. The bar is 400 significant lines; this is 213 over it, 1.53× the bar. 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.
  • ClassTooLong: ReviewTargetStatusResult internal/cli/review_status_contract.go:66 — ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods, 11 blocks, lines 66-1185. The bar is 400 significant lines; this is 131 over it, 1.33× the bar. 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.
  • ClassTooLong: CompactState internal/reviewtransaction/compact.go:109 — ClassTooLong — 502 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods, 18 blocks, lines 109-2375. The bar is 400 significant lines; this is 102 over it, 1.26× the bar. 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.
  • ClassTooLong: Service internal/components/uninstall/service.go:76 — ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods, 13 blocks, lines 76-1314. The bar is 400 significant lines; this is 93 over it, 1.23× the bar. 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 · Edited copy of a member (18 corresponding lines) · ×6
  • Edited copy of a member (18 corresponding lines) internal/reviewtransaction/compact_store.go:2129 — internal/reviewtransaction/compact_store.go:2129-2146 | internal/reviewtransaction/snapshot.go:1739-1759 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/components/uninstall/service.go:175 — internal/components/uninstall/service.go:175-192 | internal/components/uninstall/service.go:194-211 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/agents/kiro/adapter.go:160 — internal/agents/kiro/adapter.go:160-180 | internal/agents/windsurf/adapter.go:108-125 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/cli/doctor.go:449 — internal/cli/doctor.go:449-468 | internal/opencode/background_readiness.go:1024-1041 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) internal/reviewtransaction/store_reset.go:431 — internal/reviewtransaction/store_reset.go:431-452 | internal/reviewtransaction/store_reset.go:968-985 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) bench/journeys_edge.go:41 — bench/journeys_edge.go:41-58 | bench/runner.go:151-168 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×5
  • Edited copy of a member (31 corresponding lines) internal/reviewtransaction/repository_locator.go:250 — internal/reviewtransaction/repository_locator.go:250-280 | internal/reviewtransaction/repository_locator.go:287-317 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) internal/telemetrycollector/summary.go:130 — internal/telemetrycollector/summary.go:130-160 | internal/telemetrycollector/summary.go:164-195 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) internal/components/telemetryruntime/managed.go:191 — internal/components/telemetryruntime/managed.go:191-221 | internal/shellinstaller/user_experience_private_unix.go:113-144 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) internal/app/app.go:1207 — internal/app/app.go:1207-1243 | internal/cli/restore.go:218-248 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) REDACTED:334 — REDACTED:334-370 | scripts/crosslane/host.go:259-289 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) internal/reviewtransaction/authority_repair.go:556 — internal/reviewtransaction/authority_repair.go:556-582 | internal/reviewtransaction/store.go:442-472 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) internal/tui/screens/agent_builder_generating.go:10 — internal/tui/screens/agent_builder_generating.go:10-36 | internal/tui/screens/agent_builder_installing.go:10-36 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) internal/cli/review_facade.go:2857 — internal/cli/review_facade.go:2857-2883 | internal/cli/review_start_preflight.go:65-92 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) internal/components/filemerge/writer.go:382 — internal/components/filemerge/writer.go:382-408 | internal/components/uninstall/cleaners.go:231-260 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) bench/axis_damaged_store_closure.go:347 — bench/axis_damaged_store_closure.go:347-376 | bench/axis_damaged_store_closure.go:383-409 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×5
  • Edited copy of a member (20 corresponding lines) internal/reviewtransaction/correction_scope.go:192 — internal/reviewtransaction/correction_scope.go:192-219 | internal/reviewtransaction/snapshot.go:1639-1658 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:524 — REDACTED:524-549 | REDACTED:553-572 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) internal/reviewtransaction/compact_reviewer_capture.go:158 — internal/reviewtransaction/compact_reviewer_capture.go:158-178 | internal/reviewtransaction/compact_reviewer_capture.go:238-257 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) internal/cli/review_transport_capability.go:274 — internal/cli/review_transport_capability.go:274-293 | internal/cli/review_transport_capability.go:331-350 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:347 — REDACTED:347-366 | REDACTED:368-390 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×5
  • Edited copy of a member (19 corresponding lines) REDACTED:502 — REDACTED:502-525 | internal/cli/compatibility_writer_unix.go:250-268 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/update/github.go:74 — internal/update/github.go:74-93 | internal/update/github.go:95-113 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/cli/review_operation_contract.go:631 — internal/cli/review_operation_contract.go:631-649 | internal/cli/review_operation_contract.go:1391-1410 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/model/claude_model.go:135 — internal/model/claude_model.go:135-153 | internal/model/claude_model.go:157-175 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/model/selection.go:3 — internal/model/selection.go:3-25 | internal/model/selection.go:91-109 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×5
  • Duplicated block (18 lines × 2) internal/app/app.go:1226 — internal/app/app.go:1226-1243 | internal/cli/restore.go:231-248 — 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/app/app.go:1226` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) internal/cli/shell_install.go:367 — internal/cli/shell_install.go:367-384 | internal/cli/shell_install.go:389-406 — 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/cli/shell_install.go:367` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) internal/components/agenthooks/claude.go:18 — internal/components/agenthooks/claude.go:18-35 | internal/components/agenthooks/skill_registry.go:94-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/components/agenthooks/claude.go:18` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/components/agenthooks/claude.go:17` calls `SettingsPath` and `internal/components/agenthooks/skill_registry.go:93` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) REDACTED:591 — REDACTED:591-608 | REDACTED:789-806 — 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 `REDACTED:789` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (18 lines × 2) bench/runner.go:254 — bench/runner.go:254-271 | bench/runner.go:561-578 — 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 `bench/runner.go:254` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
D3 · God Classes · TooManyFields · ×4
  • TooManyFields: Model internal/tui/model.go:649 — TooManyFields — 128 stored fields beside 110 methods. The bar is 30 stored fields; this is 98 over it, 4.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: CompactState internal/reviewtransaction/compact.go:109 — TooManyFields — 46 stored fields beside 21 methods. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Transaction internal/reviewtransaction/transaction.go:208 — TooManyFields — 38 stored fields beside 29 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ReviewTargetStatusResult internal/cli/review_status_contract.go:66 — TooManyFields — 33 stored fields beside 10 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/agents/conductor/adapter.go:54 — internal/agents/conductor/adapter.go:54-66 | internal/agents/cursor/adapter.go:40-54 | internal/agents/trae/adapter.go:51-61 | internal/agents/windsurf/adapter.go:49-59 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:554 — REDACTED:554-620 | REDACTED:622-673 | internal/components/uninstall/cleaners.go:267-333 | internal/components/uninstall/cleaners.go:335-386 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/tui/screens/model_picker.go:698 — internal/tui/screens/model_picker.go:698-736 | internal/tui/screens/model_picker.go:760-867 | internal/tui/screens/model_picker.go:869-912 | internal/tui/screens/model_picker.go:914-977 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) bench/journeys.go:390 — bench/journeys.go:390-421 | bench/journeys_frozen_lineage_resume.go:141-159 | bench/journeys_issue_3065.go:159-200 | bench/journeys_wave1.go:449-498 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×4
  • Edited copy of a member (25 corresponding lines) internal/cli/run.go:4238 — internal/cli/run.go:4238-4262 | REDACTED:931-955 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) internal/components/communitytool/pi_codegraph.go:1112 — internal/components/communitytool/pi_codegraph.go:1112-1136 | internal/components/mutationjournal/journal.go:254-281 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) internal/components/filemerge/toml.go:72 — internal/components/filemerge/toml.go:72-101 | internal/components/filemerge/toml.go:269-293 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) bench/axis_damaged_store.go:681 — bench/axis_damaged_store.go:681-708 | bench/axis_damaged_store_closure.go:254-278 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×4
  • Edited copy of a member (22 corresponding lines) internal/telemetrycollector/downloads.go:103 — internal/telemetrycollector/downloads.go:103-124 | internal/telemetrycollector/downloads.go:179-201 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/components/communitytool/pi_codegraph.go:1029 — internal/components/communitytool/pi_codegraph.go:1029-1050 | internal/components/mutationjournal/journal.go:59-80 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/shellinstaller/user_shell_registry_windows.go:499 — internal/shellinstaller/user_shell_registry_windows.go:499-520 | internal/shellinstaller/user_shell_update_unix.go:175-200 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) internal/shellinstaller/user_reviewed_stage_unix.go:45 — internal/shellinstaller/user_reviewed_stage_unix.go:45-66 | internal/shellinstaller/user_shell_pins_unix.go:55-77 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×4
  • Edited copy of a member (4 corresponding lines) internal/agents/pi/model_routing.go:194 — internal/agents/pi/model_routing.go:194-197 | internal/reviewtransaction/repository_locator.go:1116-1119 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) internal/cli/codegraph.go:188 — internal/cli/codegraph.go:188-191 | internal/components/telemetryruntime/claude.go:110-113 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) internal/reviewtransaction/store_lock_windows.go:35 — internal/reviewtransaction/store_lock_windows.go:35-38 | internal/telemetry/state_lock_windows.go:30-33 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) internal/shellinstaller/user_install_cleanup_unix.go:77 — internal/shellinstaller/user_install_cleanup_unix.go:77-80 | internal/shellinstaller/user_install_cleanup_windows.go:54-57 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×4
  • Duplicated block (20 lines × 2) internal/reviewtransaction/authority_disposition_execute.go:599 — internal/reviewtransaction/authority_disposition_execute.go:599-618 | internal/reviewtransaction/classified_authority_replay.go:396-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/authority_disposition_execute.go:599` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (20 lines × 2) internal/shellinstaller/user_shell_registry_windows.go:501 — internal/shellinstaller/user_shell_registry_windows.go:501-520 | internal/shellinstaller/user_shell_update_unix.go:181-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_shell_registry_windows.go:501` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (20 lines × 2) internal/tui/model.go:1896 — internal/tui/model.go:1896-1915 | internal/tui/model.go:1943-1962 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (20 lines × 2) internal/tui/model.go:1922 — internal/tui/model.go:1922-1941 | internal/tui/model.go:1964-1983 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×4
  • Duplicated block (19 lines × 2) internal/pathidentity/identity.go:84 — internal/pathidentity/identity.go:84-102 | internal/releasepolicy/policy.go:148-166 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) bench/axis_damaged_store_closure.go:348 — bench/axis_damaged_store_closure.go:348-366 | bench/axis_damaged_store_closure.go:384-402 — 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 (19 lines × 2) bench/journeys_correction_unavailable.go:75 — bench/journeys_correction_unavailable.go:75-94 | bench/journeys_intended_untracked.go:444-462 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (19 lines × 2) REDACTED:272 — REDACTED:272-290 | REDACTED:410-428 — 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) internal/cli/review_transport_capability.go:281 — internal/cli/review_transport_capability.go:281-293 | internal/cli/review_transport_capability.go:338-350 — 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/cli/review_transport_capability.go:281` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/components/engram/inject.go:990 — internal/components/engram/inject.go:990-1002 | internal/components/persona/inject.go:397-409 — 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/components/engram/inject.go:990` 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 (13 lines × 2) internal/reviewtransaction/bundle.go:294 — internal/reviewtransaction/bundle.go:294-306 | internal/reviewtransaction/rar_path_safety.go:329-341 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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. 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/tui/screens/uninstall.go:114 — internal/tui/screens/uninstall.go:114-126 | internal/tui/screens/uninstall.go:156-168 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×4
  • Duplicated block (6 lines × 3) internal/shellinstaller/user_experience_stage_windows.go:44 — internal/shellinstaller/user_experience_stage_windows.go:44-49 | internal/shellinstaller/user_main_custody_unix.go:33-38 | internal/shellinstaller/user_main_source_unix.go:32-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 3) internal/tui/screens/antigravity_model_picker.go:153 — internal/tui/screens/antigravity_model_picker.go:153-158 | internal/tui/screens/claude_model_picker.go:499-504 | internal/tui/screens/claude_model_picker.go:524-529 — 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/tui/screens/antigravity_model_picker.go:153` 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 × 3) internal/shellinstaller/user_agent_state.go:82 — internal/shellinstaller/user_agent_state.go:82-87 | internal/shellinstaller/user_install_scope_unix.go:62-67 | internal/shellinstaller/user_install_scope_windows.go:42-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_agent_state.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 (6 lines × 3) bench/journeys_issue_3557.go:87 — bench/journeys_issue_3557.go:87-92 | bench/journeys_issue_3561.go:95-100 | bench/journeys_issue_3561.go:101-106 — 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. 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.
R10 · Code Duplication · Duplicated block (5 lines × 2 locations) · ×4
  • Duplicated block (5 lines × 2 locations) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:218 — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:218 · internal/assets/opencode/plugins-v2/opencode-review-transport.ts:241 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (5 lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:380 — scripts/provision-gentle-shell-private-global.mjs:380 · scripts/provision-gentle-shell-private-global.mjs:447 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (5 lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:527 — scripts/provision-gentle-shell-private-global.mjs:527 · scripts/provision-gentle-shell-windows.mjs:324 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (5 lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:936 — scripts/provision-gentle-shell-private-global.mjs:936 · scripts/provision-gentle-shell-private-global.mjs:968 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X2 · Cancellation propagation · Function without context.Context · ×4
  • Function without context.Context: fetchLatestEngramVersionRequest REDACTED:271 — `fetchLatestEngramVersionRequest` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: fetchLatestEngramVersionWithAssets REDACTED:368 — `fetchLatestEngramVersionWithAssets` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: downloadAndExtractTarGz REDACTED:717 — `downloadAndExtractTarGz` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: downloadAndExtractZip REDACTED:767 — `downloadAndExtractZip` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
X28 · Index access outside its own emptiness guard · Index access outside its own emptiness guard · ×4
  • Index access outside its own emptiness guard REDACTED:1076 — `lineStart` is the result of a search that answers -1 when nothing is found, and `content[lineStart:start]` uses it as a bound with no test of `lineStart` in between. When the search misses, the bound is -1 and the access panics with `slice bounds out of range`. Test `lineStart < 0` (or use `strings.Cut`) before using it.
  • Index access outside its own emptiness guard internal/components/engram/protocol.go:105 — `floorMatch` holds what `FindStringSubmatch` returns, and `floorMatch[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(floorMatch)` (or nil) first, as the other call site does.
  • Index access outside its own emptiness guard internal/components/engram/protocol.go:106 — `floorMatch` holds what `FindStringSubmatch` returns, and `floorMatch[2]` takes element 2 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(floorMatch)` (or nil) first, as the other call site does.
  • Index access outside its own emptiness guard internal/components/engram/protocol.go:107 — `floorMatch` holds what `FindStringSubmatch` returns, and `floorMatch[3]` takes element 3 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(floorMatch)` (or nil) first, as the other call site does.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×3
  • Edited copy of a member (26 corresponding lines) internal/reviewtransaction/authority_disposition_execute.go:582 — internal/reviewtransaction/authority_disposition_execute.go:582-618 | internal/reviewtransaction/classified_authority_replay.go:390-415 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) internal/components/engram/antigravity_uninstall.go:77 — internal/components/engram/antigravity_uninstall.go:77-102 | internal/components/engram/inject.go:1537-1565 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) bench/axis_damaged_store.go:580 — bench/axis_damaged_store.go:580-605 | bench/axis_damaged_store.go:616-643 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×3
  • Edited copy of a member (17 corresponding lines) internal/reviewtransaction/snapshot.go:1619 — internal/reviewtransaction/snapshot.go:1619-1635 | internal/reviewtransaction/snapshot.go:1660-1676 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:294 — REDACTED:294-312 | REDACTED:321-337 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) bench/journeys_reviewed_superset.go:216 — bench/journeys_reviewed_superset.go:216-233 | bench/journeys_reviewed_superset.go:277-293 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 14+ corresponding lines) internal/components/gga/runtime.go:45 — internal/components/gga/runtime.go:45-58 | internal/components/gga/runtime.go:63-76 | internal/components/gga/runtime.go:80-93 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) bench/journeys_issue_3065.go:131 — bench/journeys_issue_3065.go:131-144 | bench/journeys_wave1.go:357-370 | bench/journeys_wave1.go:726-739 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) bench/axis_damaged_store.go:760 — bench/axis_damaged_store.go:760-773 | bench/axis_damaged_store.go:777-793 | bench/axis_damaged_store.go:1326-1345 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) internal/reviewtransaction/repository_locator.go:251 — internal/reviewtransaction/repository_locator.go:251-272 | internal/reviewtransaction/repository_locator.go:288-309 — 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 (22 lines × 2) internal/shellinstaller/user_channel_overlay_unix.go:308 — internal/shellinstaller/user_channel_overlay_unix.go:308-329 | internal/shellinstaller/user_channel_overlay_unix.go:367-388 — 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/shellinstaller/user_channel_overlay_unix.go:308` 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 (22 lines × 2) internal/shellinstaller/user_install_darwin.go:66 — internal/shellinstaller/user_install_darwin.go:66-87 | REDACTED:506-527 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_install_darwin.go:66` 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 (17 lines × 2) · ×3
  • Duplicated block (17 lines × 2) internal/app/app.go:1000 — internal/app/app.go:1000-1016 | REDACTED:2383-2399 — 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 (17 lines × 2) internal/reviewtransaction/authority_disposition_execute.go:501 — internal/reviewtransaction/authority_disposition_execute.go:501-517 | internal/reviewtransaction/compact_inspect.go:163-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/authority_disposition_execute.go:501` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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/tui/screens/shell_manage.go:63 — internal/tui/screens/shell_manage.go:63-79 | internal/tui/screens/shell_update.go:46-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/screens/shell_manage.go:63` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) internal/cli/review_stop_hook.go:359 — internal/cli/review_stop_hook.go:359-371 | internal/cli/review_stop_hook.go:390-401 — 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 (12–13 lines × 2) internal/cli/run.go:658 — internal/cli/run.go:658-670 | REDACTED:64-75 — 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/cli/run.go:658` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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–13 lines × 2) internal/components/agentguidance/inject.go:320 — internal/components/agentguidance/inject.go:320-332 | internal/components/agentguidance/inject.go:360-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. 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) · ×3
  • Duplicated block (11 lines × 3) internal/shellinstaller/user_install_darwin.go:77 — internal/shellinstaller/user_install_darwin.go:77-87 | REDACTED:460-470 | REDACTED:517-527 — 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. 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 × 3) internal/reviewtransaction/compact_result_reopen.go:281 — internal/reviewtransaction/compact_result_reopen.go:281-291 | internal/reviewtransaction/transaction.go:1717-1727 | internal/reviewtransaction/verification_contract.go:1366-1376 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (11 lines × 3) internal/tui/screens/claude_model_picker.go:186 — internal/tui/screens/claude_model_picker.go:186-196 | internal/tui/screens/codex_model_picker.go:169-179 | internal/tui/screens/kiro_model_picker.go:91-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) internal/components/uninstall/service.go:1603 — internal/components/uninstall/service.go:1603-1611 | internal/components/uninstall/service.go:1648-1656 | internal/components/uninstall/service.go:1679-1687 — 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/components/uninstall/service.go:1603` 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/reviewtransaction/verification_contract.go:1046 — internal/reviewtransaction/verification_contract.go:1046-1054 | internal/reviewtransaction/verification_contract.go:1071-1079 | internal/reviewtransaction/verification_contract.go:1198-1206 — 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/reviewtransaction/verification_contract.go:1046` 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) bench/journeys_lens_context_budget.go:31 — bench/journeys_lens_context_budget.go:31-39 | bench/journeys_provider_capture.go:98-106 | bench/journeys_repository_context.go:114-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys_lens_context_budget.go:31` 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×3
  • Duplicated block (7–8 lines × 2) internal/cli/review_assess.go:302 — internal/cli/review_assess.go:302-308 | internal/cli/review_facade.go:2408-2415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/review_assess.go:302` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cli/review_assess.go:299` calls `Bool` and `internal/cli/review_facade.go:2405` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7–8 lines × 2) internal/reviewtransaction/compact.go:1857 — internal/reviewtransaction/compact.go:1857-1863 | internal/reviewtransaction/compact_reviewer_capture.go:101-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/compact.go:1857` 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–8 lines × 2) internal/shellinstaller/user_install_cleanup_windows.go:32 — internal/shellinstaller/user_install_cleanup_windows.go:32-39 | internal/shellinstaller/user_install_cleanup_windows.go:94-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/shellinstaller/user_install_cleanup_windows.go:32` 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.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×3
  • Process-global state is restored only on the happy path internal/tui/shell_experience.go:134 — `configureShellExperience` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GENTLE_AI_RECONFIGURE_TARGET` environment variable (set at line 257, cleared at line 259) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic.
  • Process-global state is restored only on the happy path internal/tui/shell_install.go:130 — `launchShellInstall` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GENTLE_AI_MAIN_FALLBACK` environment variable (set at line 132, cleared at line 134) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic.
  • Process-global state is restored only on the happy path internal/tui/shell_install.go:908 — `finishShellInstallSelection` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GENTLE_AI_RECONFIGURE_TARGET` environment variable (set at line 915, cleared at line 917) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×2
  • TooManyMethods: Model internal/tui/model.go:649 — TooManyMethods — 110 methods, declared across 3 files: tui/model.go (84), tui/shell_install.go (22), tui/shell_experience.go (4). The bar is 30 methods; this is 80 over it, 3.67× the bar. 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: SnapshotBuilder internal/reviewtransaction/snapshot.go:111 — TooManyMethods — 40 methods, declared across 4 files: reviewtransaction/snapshot.go (28), reviewtransaction/risk.go (6), reviewtransaction/frozen_candidate_context.go (4), reviewtransaction/verification_contract.go (2). The bar is 30 methods; this is 10 over it, 1.33× the bar. 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/reviewtransaction/compact_reviewer_capture.go:504 — internal/reviewtransaction/compact_reviewer_capture.go:504-603 | internal/reviewtransaction/compact_reviewer_capture.go:627-727 | internal/reviewtransaction/compact_reviewer_capture.go:917-985 | internal/reviewtransaction/compact_unachievable_lens.go:39-118 | internal/reviewtransaction/compact_unachievable_lens.go:154-230 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/shellinstaller/user_codegraph_executable_unix.go:43 — internal/shellinstaller/user_codegraph_executable_unix.go:43-82 | internal/shellinstaller/user_codegraph_library_unix.go:195-264 | internal/shellinstaller/user_context7_stage_unix.go:18-81 | internal/shellinstaller/user_experience_private_unix.go:148-233 | internal/shellinstaller/user_experience_stage_unix.go:39-93 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) internal/reviewtransaction/authority_disposition_execute.go:467 — internal/reviewtransaction/authority_disposition_execute.go:467-517 | internal/reviewtransaction/compact_inspect.go:129-179 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (51 corresponding lines) internal/shellinstaller/user_install_cleanup_unix.go:89 — internal/shellinstaller/user_install_cleanup_unix.go:89-139 | internal/shellinstaller/user_install_cleanup_windows.go:67-117 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×2
  • Edited copy of a member (33 corresponding lines) internal/tui/screens/backups.go:107 — internal/tui/screens/backups.go:107-139 | internal/tui/screens/backups.go:170-202 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) internal/components/opencodeplugin/plugin.go:259 — internal/components/opencodeplugin/plugin.go:259-291 | internal/components/opencodeplugin/plugin.go:297-330 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) internal/cli/review_abandon.go:54 — internal/cli/review_abandon.go:54-93 | internal/cli/review_reclaim.go:18-52 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) internal/reviewtransaction/target_status.go:264 — internal/reviewtransaction/target_status.go:264-302 | internal/reviewtransaction/target_status.go:304-338 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) REDACTED:461 — REDACTED:461-492 | internal/cli/compatibility_writer_unix.go:217-248 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) internal/reviewtransaction/compact.go:447 — internal/reviewtransaction/compact.go:447-479 | internal/reviewtransaction/compact.go:499-530 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) internal/update/upgrade/download.go:202 — internal/update/upgrade/download.go:202-239 | internal/update/upgrade/download.go:252-280 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) internal/telemetry/runtime.go:430 — internal/telemetry/runtime.go:430-458 | internal/telemetry/runtime_opencode.go:271-305 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) internal/tui/screens/claude_model_picker.go:487 — internal/tui/screens/claude_model_picker.go:487-509 | internal/tui/screens/claude_model_picker.go:511-534 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) bench/journeys_local_gate_advance.go:78 — bench/journeys_local_gate_advance.go:78-100 | bench/journeys_reviewed_superset.go:116-138 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) REDACTED:162 — REDACTED:162-185 | REDACTED:394-418 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) bench/journeys_issue3772.go:32 — bench/journeys_issue3772.go:32-55 | bench/journeys_issue4377.go:66-89 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) internal/tui/model.go:3243 — internal/tui/model.go:3243-3258 | internal/tui/model.go:3270-3288 | internal/tui/model.go:3290-3304 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) internal/agents/discovery.go:61 — internal/agents/discovery.go:61-76 | REDACTED:1694-1710 | internal/telemetrycollector/rollup.go:83-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) internal/cli/review_artifact.go:600 — internal/cli/review_artifact.go:600-611 | internal/cli/review_operation_contract.go:1751-1762 | internal/reviewtransaction/rar_authority_repository.go:703-717 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) internal/state/manifest.go:108 — internal/state/manifest.go:108-120 | internal/state/state.go:336-347 | internal/telemetry/state.go:201-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) internal/agents/codex/adapter.go:74 — internal/agents/codex/adapter.go:74-80 | internal/agents/gemini/adapter.go:74-80 | internal/agents/qwen/adapter.go:78-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) internal/reviewtransaction/authority_disposition_execute.go:683 — internal/reviewtransaction/authority_disposition_execute.go:683-689 | internal/reviewtransaction/transaction.go:1690-1696 | internal/tui/screens/claude_model_picker.go:198-204 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) REDACTED:219 — REDACTED:219-250 | internal/shellinstaller/user_root_service_linux.go:63-94 — before extracting anything, compare `REDACTED` and `internal/shellinstaller/user_root_service_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (32 lines × 2) internal/reviewtransaction/authority_disposition_execute.go:468 — internal/reviewtransaction/authority_disposition_execute.go:468-499 | internal/reviewtransaction/compact_inspect.go:130-161 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/reviewtransaction/authority_disposition_execute.go:468` 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 (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) internal/cli/review_facade.go:2860 — internal/cli/review_facade.go:2860-2873 | internal/cli/review_facade.go:2919-2932 | internal/cli/review_start_preflight.go:68-81 — 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/cli/review_facade.go:2860` 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 (14 lines × 3) internal/reviewtransaction/rar_plan_authority.go:347 — internal/reviewtransaction/rar_plan_authority.go:347-360 | internal/reviewtransaction/rar_plan_authority.go:425-438 | internal/reviewtransaction/rar_plan_authority.go:493-506 — 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/reviewtransaction/rar_plan_authority.go:347` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/reviewtransaction/rar_plan_authority.go:439` calls `publishPrivateRARImmutable`, `planObjectPath` and `internal/reviewtransaction/rar_plan_authority.go:507` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×2
  • Duplicated block (13 lines × 5) internal/reviewtransaction/compact_reviewer_capture.go:509 — internal/reviewtransaction/compact_reviewer_capture.go:509-521 | internal/reviewtransaction/compact_reviewer_capture.go:653-665 | internal/reviewtransaction/compact_reviewer_capture.go:931-943 | internal/reviewtransaction/compact_unachievable_lens.go:55-67 | internal/reviewtransaction/compact_unachievable_lens.go:168-180 — there are 5 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 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/reviewtransaction/compact_reviewer_capture.go:509` 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 (13 lines × 5) internal/shellinstaller/user_codegraph_executable_unix.go:51 — internal/shellinstaller/user_codegraph_executable_unix.go:51-63 | internal/shellinstaller/user_codegraph_library_unix.go:204-216 | internal/shellinstaller/user_context7_stage_unix.go:39-51 | internal/shellinstaller/user_experience_private_unix.go:166-178 | internal/shellinstaller/user_experience_stage_unix.go:53-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/shellinstaller/user_codegraph_executable_unix.go:50` calls `Join` and `internal/shellinstaller/user_experience_private_unix.go:165` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×2
  • Duplicated block (12 lines × 3) internal/tui/screens/model_picker.go:721 — internal/tui/screens/model_picker.go:721-732 | internal/tui/screens/model_picker.go:897-908 | internal/tui/screens/model_picker.go:962-973 — 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/tui/screens/model_picker.go:721` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/tui/screens/model_picker.go:893` calls `Sprintf` and `internal/tui/screens/model_picker.go:717` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) internal/agents/claude/adapter.go:18 — internal/agents/claude/adapter.go:18-29 | internal/agents/kilocode/adapter.go:15-26 | internal/agents/opencode/adapter.go:21-32 — `internal/agents/claude/adapter.go` and `internal/agents/kilocode/adapter.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) bench/axis_damaged_store_closure.go:525 — bench/axis_damaged_store_closure.go:525-534 | internal/assets/managed_digest.go:47-58 — 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 `bench/axis_damaged_store_closure.go:525` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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. Check import visibility before settling on that home: `internal/assets/managed_digest.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (10–12 lines × 2) REDACTED:301 — REDACTED:301-312 | REDACTED:328-337 — 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 `REDACTED:301` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `homeDir` in one and `workspaceDir` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • Duplicated block (11 lines × 5) internal/components/engram/inject.go:1277 — internal/components/engram/inject.go:1277-1287 | REDACTED:476-486 | internal/components/permissions/inject.go:290-300 | internal/components/persona/inject.go:900-910 | internal/components/theme/inject.go:218-228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times.
  • Duplicated block (11 lines × 5) internal/reviewtransaction/bundle.go:299 — internal/reviewtransaction/bundle.go:299-309 | internal/reviewtransaction/rar_path_safety.go:334-344 | internal/reviewtransaction/store.go:941-951 | internal/shellinstaller/user_launch_pin_cache_unix.go:125-135 | internal/state/manifest.go:200-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/reviewtransaction/bundle.go:297` calls `Name`, `Remove` and `internal/reviewtransaction/store.go:940` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • Duplicated block (10 lines × 3) internal/cli/run.go:2381 — internal/cli/run.go:2381-2390 | internal/cli/run.go:2437-2446 | internal/cli/run.go:2510-2519 — 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/cli/run.go:2381` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 × 3) internal/reviewtransaction/candidate_decline.go:96 — internal/reviewtransaction/candidate_decline.go:96-105 | internal/reviewtransaction/rar_authority_repository.go:626-635 | internal/reviewtransaction/rdd_mode.go:1100-1109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) internal/tui/screens/model_picker.go:720 — internal/tui/screens/model_picker.go:720-727 | internal/tui/screens/model_picker.go:850-856 | internal/tui/screens/model_picker.go:896-903 | internal/tui/screens/model_picker.go:961-968 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/screens/model_picker.go:720` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/tui/screens/model_picker.go:893` calls `Sprintf` and `internal/tui/screens/model_picker.go:717` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) internal/agents/claude/adapter.go:74 — internal/agents/claude/adapter.go:74-81 | internal/agents/kilocode/adapter.go:71-78 | internal/agents/kimi/adapter.go:123-129 | internal/agents/opencode/adapter.go:77-84 — `internal/agents/claude/adapter.go` and `internal/agents/kilocode/adapter.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 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.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) bench/runner.go:858 — bench/runner.go:858-863 | bench/runner.go:865-870 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) bench/runner.go:190 — bench/runner.go:190-195 | REDACTED:405-411 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×2
  • Duplicated block (8 lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:249 — scripts/provision-gentle-shell-private-global.mjs:249 · scripts/provision-gentle-shell-windows.mjs:219 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:944 — scripts/provision-gentle-shell-private-global.mjs:944 · scripts/provision-gentle-shell-private-global.mjs:1007 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D1 · Cyclomatic Complexity · cli.runReviewStatus (cyclomatic 284) · ×1
  • cli.runReviewStatus (cyclomatic 284) internal/cli/review_facade.go:799 — cli.runReviewStatus has cyclomatic complexity 284 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Model.confirmSelection (cyclomatic 230) · ×1
  • Model.confirmSelection (cyclomatic 230) internal/tui/model.go:2100 — Model.confirmSelection has cyclomatic complexity 230 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewNextTransition.Validate (cyclomatic 167) · ×1
  • ReviewNextTransition.Validate (cyclomatic 167) internal/cli/review_status_contract.go:1239 — ReviewNextTransition.Validate has cyclomatic complexity 167 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateWithCompactAuthority (cyclomatic 145) · ×1
  • ReviewTargetStatusResult.validateWithCompactAuthority (cyclomatic 145) internal/cli/review_status_contract.go:363 — ReviewTargetStatusResult.validateWithCompactAuthority has cyclomatic complexity 145 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Model.handleKeyPress (cyclomatic 124) · ×1
  • Model.handleKeyPress (cyclomatic 124) internal/tui/model.go:1672 — Model.handleKeyPress has cyclomatic complexity 124 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.validateReviewTransitionExecution (cyclomatic 122) · ×1
  • cli.validateReviewTransitionExecution (cyclomatic 122) internal/cli/review_status_contract.go:1671 — cli.validateReviewTransitionExecution has cyclomatic complexity 122 (threshold 15). Of this number, 113 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cli.RunReviewRecover (cyclomatic 113) · ×1
  • cli.RunReviewRecover (cyclomatic 113) internal/cli/review_facade.go:1880 — cli.RunReviewRecover has cyclomatic complexity 113 (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.
D1 · Cyclomatic Complexity · shellinstaller.userRunInstall (cyclomatic 112) · ×1
  • shellinstaller.userRunInstall (cyclomatic 112) internal/shellinstaller/user_install_flow_unix.go:218 — shellinstaller.userRunInstall has cyclomatic complexity 112 (threshold 15). Of this number, 110 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateSuccessor (cyclomatic 109) · ×1
  • reviewtransaction.validateSuccessor (cyclomatic 109) internal/reviewtransaction/store.go:474 — reviewtransaction.validateSuccessor has cyclomatic complexity 109 (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.
D1 · Cyclomatic Complexity · persona.injectInternal (cyclomatic 106) · ×1
  • persona.injectInternal (cyclomatic 106) internal/components/persona/inject.go:125 — persona.injectInternal has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewIntegrationStartResult.Validate (cyclomatic 104) · ×1
  • ReviewIntegrationStartResult.Validate (cyclomatic 104) internal/cli/review_start_contract.go:176 — ReviewIntegrationStartResult.Validate has cyclomatic complexity 104 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactSuccessor (cyclomatic 100) · ×1
  • reviewtransaction.validateCompactSuccessor (cyclomatic 100) internal/reviewtransaction/compact_store.go:1727 — reviewtransaction.validateCompactSuccessor has cyclomatic complexity 100 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CompactState.CompactReviewView (cyclomatic 99) · ×1
  • CompactState.CompactReviewView (cyclomatic 99) internal/reviewtransaction/compact.go:1188 — CompactState.CompactReviewView has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewIntegrationFailure.Validate (cyclomatic 95) · ×1
  • ReviewIntegrationFailure.Validate (cyclomatic 95) internal/cli/review_operation_contract.go:1429 — ReviewIntegrationFailure.Validate has cyclomatic complexity 95 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactCorrection (cyclomatic 90) · ×1
  • reviewtransaction.validateCompactCorrection (cyclomatic 90) internal/reviewtransaction/compact.go:1629 — reviewtransaction.validateCompactCorrection has cyclomatic complexity 90 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Model.Update (cyclomatic 89) · ×1
  • Model.Update (cyclomatic 89) internal/tui/model.go:1068 — Model.Update has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · componentApplyStep.Run (cyclomatic 86) · ×1
  • componentApplyStep.Run (cyclomatic 86) internal/cli/run.go:3343 — componentApplyStep.Run has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactState.Validate (cyclomatic 84) · ×1
  • CompactState.Validate (cyclomatic 84) internal/reviewtransaction/compact.go:834 — CompactState.Validate has cyclomatic complexity 84 (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.
D1 · Cyclomatic Complexity · cli.RunReviewCaptureResult (cyclomatic 83) · ×1
  • cli.RunReviewCaptureResult (cyclomatic 83) internal/cli/review_artifact.go:143 — cli.RunReviewCaptureResult has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runReviewFacadeStart (cyclomatic 82) · ×1
  • cli.runReviewFacadeStart (cyclomatic 82) internal/cli/review_facade.go:2386 — cli.runReviewFacadeStart has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewRepairResult.Validate (cyclomatic 80) · ×1
  • ReviewRepairResult.Validate (cyclomatic 80) internal/cli/review_repair.go:112 — ReviewRepairResult.Validate has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateNextTransitionTargets (cyclomatic 76) · ×1
  • ReviewTargetStatusResult.validateNextTransitionTargets (cyclomatic 76) internal/cli/review_status_contract.go:802 — ReviewTargetStatusResult.validateNextTransitionTargets has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Transaction.validateFindingState (cyclomatic 76) · ×1
  • Transaction.validateFindingState (cyclomatic 76) internal/reviewtransaction/transaction.go:1508 — Transaction.validateFindingState has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.syncBackupTargetsScoped (cyclomatic 74) · ×1
  • cli.syncBackupTargetsScoped (cyclomatic 74) REDACTED:712 — cli.syncBackupTargetsScoped has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.assessTargetStatusSnapshot (cyclomatic 73) · ×1
  • reviewtransaction.assessTargetStatusSnapshot (cyclomatic 73) internal/reviewtransaction/target_status.go:429 — reviewtransaction.assessTargetStatusSnapshot has cyclomatic complexity 73 (threshold 15). Of this number, 72 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.RunArgs (cyclomatic 68) · ×1
  • app.RunArgs (cyclomatic 68) internal/app/app.go:91 — app.RunArgs has cyclomatic complexity 68 (threshold 15). Of this number, 67 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.resolveReviewNextTransition (cyclomatic 68) · ×1
  • cli.resolveReviewNextTransition (cyclomatic 68) internal/cli/review_next_transition.go:223 — cli.resolveReviewNextTransition has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.componentPathsWithWorkspaceScoped (cyclomatic 67) · ×1
  • cli.componentPathsWithWorkspaceScoped (cyclomatic 67) internal/cli/run.go:4341 — cli.componentPathsWithWorkspaceScoped has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Transaction.validate (cyclomatic 67) · ×1
  • Transaction.validate (cyclomatic 67) internal/reviewtransaction/transaction.go:969 — Transaction.validate has cyclomatic complexity 67 (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.
D1 · Cyclomatic Complexity · Model.View (cyclomatic 67) · ×1
  • Model.View (cyclomatic 67) internal/tui/model.go:1509 — Model.View has cyclomatic complexity 67 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateSubmissionDescriptors (cyclomatic 65) · ×1
  • ReviewTargetStatusResult.validateSubmissionDescriptors (cyclomatic 65) internal/cli/review_status_contract.go:578 — ReviewTargetStatusResult.validateSubmissionDescriptors has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Service.buildPlan (cyclomatic 65) · ×1
  • Service.buildPlan (cyclomatic 65) internal/components/uninstall/service.go:431 — Service.buildPlan has cyclomatic complexity 65 (threshold 15). Of this number, 63 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · releasepolicy.validateArtifacts (cyclomatic 65) · ×1
  • releasepolicy.validateArtifacts (cyclomatic 65) internal/releasepolicy/policy.go:303 — releasepolicy.validateArtifacts has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.newReviewIntegrationFailure (cyclomatic 63) · ×1
  • cli.newReviewIntegrationFailure (cyclomatic 63) internal/cli/review_operation_contract.go:660 — cli.newReviewIntegrationFailure has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Model.optionCount (cyclomatic 63) · ×1
  • Model.optionCount (cyclomatic 63) internal/tui/model.go:3979 — Model.optionCount has cyclomatic complexity 63 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · reviewtransaction.RecoverCompactAuthority (cyclomatic 61) · ×1
  • reviewtransaction.RecoverCompactAuthority (cyclomatic 61) internal/reviewtransaction/compact_store.go:319 — reviewtransaction.RecoverCompactAuthority has cyclomatic complexity 61 (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.
D1 · Cyclomatic Complexity · Model.configureShellExperience (cyclomatic 61) · ×1
  • Model.configureShellExperience (cyclomatic 61) internal/tui/shell_experience.go:134 — Model.configureShellExperience has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · engram.injectWithOptions (cyclomatic 60) · ×1
  • engram.injectWithOptions (cyclomatic 60) internal/components/engram/inject.go:748 — engram.injectWithOptions has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentRoutingGuidanceStep.Run (cyclomatic 58) · ×1
  • agentRoutingGuidanceStep.Run (cyclomatic 58) internal/cli/run.go:2046 — agentRoutingGuidanceStep.Run has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Model.goBack (cyclomatic 58) · ×1
  • Model.goBack (cyclomatic 58) internal/tui/model.go:3685 — Model.goBack has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.installBackupTargets (cyclomatic 57) · ×1
  • cli.installBackupTargets (cyclomatic 57) internal/cli/run.go:4066 — cli.installBackupTargets has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunSync (cyclomatic 55) · ×1
  • cli.RunSync (cyclomatic 55) REDACTED:2281 — cli.RunSync has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.validateReviewStartRiskReasons (cyclomatic 54) · ×1
  • cli.validateReviewStartRiskReasons (cyclomatic 54) internal/cli/review_start_contract.go:334 — cli.validateReviewStartRiskReasons has cyclomatic complexity 54 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.runReviewRepair (cyclomatic 53) · ×1
  • cli.runReviewRepair (cyclomatic 53) internal/cli/review_repair.go:259 — cli.runReviewRepair has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.AdmitArtifact (cyclomatic 53) · ×1
  • reviewtransaction.AdmitArtifact (cyclomatic 53) internal/reviewtransaction/artifact_admission.go:404 — reviewtransaction.AdmitArtifact has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateSelectorNextTransition (cyclomatic 52) · ×1
  • ReviewTargetStatusResult.validateSelectorNextTransition (cyclomatic 52) internal/cli/review_status_contract.go:1008 — ReviewTargetStatusResult.validateSelectorNextTransition has cyclomatic complexity 52 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · communitytool.InstallWithOptions (cyclomatic 51) · ×1
  • communitytool.InstallWithOptions (cyclomatic 51) internal/components/communitytool/tool.go:148 — communitytool.InstallWithOptions has cyclomatic complexity 51 (threshold 15). Of this number, 49 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Service.componentOperations (cyclomatic 51) · ×1
  • Service.componentOperations (cyclomatic 51) internal/components/uninstall/service.go:1147 — Service.componentOperations has cyclomatic complexity 51 (threshold 15). Of this number, 50 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AuthorityRepairAssessment.Validate (cyclomatic 50) · ×1
  • AuthorityRepairAssessment.Validate (cyclomatic 50) internal/reviewtransaction/authority_repair.go:772 — AuthorityRepairAssessment.Validate has cyclomatic complexity 50 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · componentSyncStep.Run (cyclomatic 49) · ×1
  • componentSyncStep.Run (cyclomatic 49) REDACTED:1468 — componentSyncStep.Run has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store.append (cyclomatic 49) · ×1
  • Store.append (cyclomatic 49) internal/reviewtransaction/store.go:178 — Store.append has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runReviewInspectCandidate (cyclomatic 48) · ×1
  • cli.runReviewInspectCandidate (cyclomatic 48) internal/cli/review_inspect_candidate.go:55 — cli.runReviewInspectCandidate has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotBuilder.build (cyclomatic 46) · ×1
  • SnapshotBuilder.build (cyclomatic 46) internal/reviewtransaction/snapshot.go:149 — SnapshotBuilder.build has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.StageNativePNPMInstallation (cyclomatic 46) · ×1
  • shellinstaller.StageNativePNPMInstallation (cyclomatic 46) REDACTED:28 — shellinstaller.StageNativePNPMInstallation has cyclomatic complexity 46 (threshold 15). Of this number, 22 points are the body's own statements and 24 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userValidateInstall (cyclomatic 45) · ×1
  • shellinstaller.userValidateInstall (cyclomatic 45) internal/shellinstaller/user_install_flow_unix.go:48 — shellinstaller.userValidateInstall has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.removeJSONCMember (cyclomatic 43) · ×1
  • filemerge.removeJSONCMember (cyclomatic 43) internal/components/filemerge/jsonc_members.go:85 — filemerge.removeJSONCMember has cyclomatic complexity 43 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactRecoveryEdge (cyclomatic 43) · ×1
  • reviewtransaction.validateCompactRecoveryEdge (cyclomatic 43) internal/reviewtransaction/compact_store.go:581 — reviewtransaction.validateCompactRecoveryEdge has cyclomatic complexity 43 (threshold 15). Of this number, 42 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateChainBundle (cyclomatic 42) · ×1
  • reviewtransaction.validateChainBundle (cyclomatic 42) internal/reviewtransaction/bundle.go:134 — reviewtransaction.validateChainBundle has cyclomatic complexity 42 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userUnixOverlaySelectSDK (cyclomatic 42) · ×1
  • shellinstaller.userUnixOverlaySelectSDK (cyclomatic 42) internal/shellinstaller/user_channel_overlay_unix.go:224 — shellinstaller.userUnixOverlaySelectSDK has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · cli.validateReviewStartBinding (cyclomatic 41) · ×1
  • cli.validateReviewStartBinding (cyclomatic 41) internal/cli/review_facade.go:2763 — cli.validateReviewStartBinding has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · communitytool.ReconcilePiCodeGraph (cyclomatic 41) · ×1
  • communitytool.ReconcilePiCodeGraph (cyclomatic 41) internal/components/communitytool/pi_codegraph.go:196 — communitytool.ReconcilePiCodeGraph has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewassets.InstallNativeAgents (cyclomatic 41) · ×1
  • reviewassets.InstallNativeAgents (cyclomatic 41) internal/components/reviewassets/install.go:89 — reviewassets.InstallNativeAgents has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.SetCloneLocalRDDMode (cyclomatic 40) · ×1
  • reviewtransaction.SetCloneLocalRDDMode (cyclomatic 40) internal/reviewtransaction/rdd_mode.go:334 — reviewtransaction.SetCloneLocalRDDMode has cyclomatic complexity 40 (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.
D1 · Cyclomatic Complexity · reviewtransaction.ParseGateContext (cyclomatic 40) · ×1
  • reviewtransaction.ParseGateContext (cyclomatic 40) internal/reviewtransaction/receipt.go:290 — reviewtransaction.ParseGateContext has cyclomatic complexity 40 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactAdmittedRoleResults (cyclomatic 39) · ×1
  • reviewtransaction.validateCompactAdmittedRoleResults (cyclomatic 39) internal/reviewtransaction/compact.go:1086 — reviewtransaction.validateCompactAdmittedRoleResults has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotBuilder.buildCurrentChanges (cyclomatic 39) · ×1
  • SnapshotBuilder.buildCurrentChanges (cyclomatic 39) internal/reviewtransaction/snapshot.go:1193 — SnapshotBuilder.buildCurrentChanges has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Service.executePlan (cyclomatic 38) · ×1
  • Service.executePlan (cyclomatic 38) internal/components/uninstall/service.go:659 — Service.executePlan has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactStore.mergeAdmittedNonLensRoleResult (cyclomatic 38) · ×1
  • CompactStore.mergeAdmittedNonLensRoleResult (cyclomatic 38) internal/reviewtransaction/compact_reviewer_capture.go:619 — CompactStore.mergeAdmittedNonLensRoleResult has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · Transaction.validateFindingRouting (cyclomatic 38) · ×1
  • Transaction.validateFindingRouting (cyclomatic 38) internal/reviewtransaction/transaction.go:1422 — Transaction.validateFindingRouting has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userStageJSON (cyclomatic 38) · ×1
  • shellinstaller.userStageJSON (cyclomatic 38) internal/shellinstaller/user_experience_private_unix.go:148 — shellinstaller.userStageJSON has cyclomatic complexity 38 (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.
D1 · Cyclomatic Complexity · shellinstaller.userNativeCoordinate (cyclomatic 38) · ×1
  • shellinstaller.userNativeCoordinate (cyclomatic 38) internal/shellinstaller/user_native_coordinate_linux.go:52 — shellinstaller.userNativeCoordinate has cyclomatic complexity 38 (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.
D1 · Cyclomatic Complexity · shellinstaller.userSnapshotZIP (cyclomatic 38) · ×1
  • shellinstaller.userSnapshotZIP (cyclomatic 38) internal/shellinstaller/user_source_archive.go:18 — shellinstaller.userSnapshotZIP has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Model.updateShellInstall (cyclomatic 38) · ×1
  • Model.updateShellInstall (cyclomatic 38) internal/tui/shell_install.go:810 — Model.updateShellInstall has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.persistAssignments (cyclomatic 37) · ×1
  • app.persistAssignments (cyclomatic 37) internal/app/app.go:1040 — app.persistAssignments has cyclomatic complexity 37 (threshold 15). Of this number, 18 points are the body's own statements and 19 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · cli.parseReviewProviderRoleCapture (cyclomatic 37) · ×1
  • cli.parseReviewProviderRoleCapture (cyclomatic 37) internal/cli/review_provider_role_capture.go:62 — cli.parseReviewProviderRoleCapture has cyclomatic complexity 37 (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.
D1 · Cyclomatic Complexity · filemerge.RemoveLegacyOpenCodeAgentMarkers (cyclomatic 37) · ×1
  • filemerge.RemoveLegacyOpenCodeAgentMarkers (cyclomatic 37) REDACTED:372 — filemerge.RemoveLegacyOpenCodeAgentMarkers has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userCodeGraphMembers (cyclomatic 37) · ×1
  • shellinstaller.userCodeGraphMembers (cyclomatic 37) internal/shellinstaller/user_codegraph_library_unix.go:122 — shellinstaller.userCodeGraphMembers has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetry.NormalizeOpenCode (cyclomatic 37) · ×1
  • telemetry.NormalizeOpenCode (cyclomatic 37) internal/telemetry/runtime_opencode.go:36 — telemetry.NormalizeOpenCode has cyclomatic complexity 37 (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.
D1 · Cyclomatic Complexity · filemerge.ReadYAMLMCPServerCommand (cyclomatic 36) · ×1
  • filemerge.ReadYAMLMCPServerCommand (cyclomatic 36) internal/components/filemerge/yaml.go:301 — filemerge.ReadYAMLMCPServerCommand has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactRecoveredEvidenceEdge (cyclomatic 36) · ×1
  • reviewtransaction.validateCompactRecoveredEvidenceEdge (cyclomatic 36) internal/reviewtransaction/compact_recovered_evidence.go:257 — reviewtransaction.validateCompactRecoveredEvidenceEdge has cyclomatic complexity 36 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CompactStore.mergeAdmittedLensResult (cyclomatic 36) · ×1
  • CompactStore.mergeAdmittedLensResult (cyclomatic 36) internal/reviewtransaction/compact_reviewer_capture.go:497 — CompactStore.mergeAdmittedLensResult has cyclomatic complexity 36 (threshold 15). Of this number, 33 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · shellinstaller.userReadRecordedManifest (cyclomatic 36) · ×1
  • shellinstaller.userReadRecordedManifest (cyclomatic 36) internal/shellinstaller/user_install_flow_unix.go:1182 — shellinstaller.userReadRecordedManifest has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userNativeMountsData (cyclomatic 36) · ×1
  • shellinstaller.userNativeMountsData (cyclomatic 36) internal/shellinstaller/user_native_guard_linux.go:136 — shellinstaller.userNativeMountsData has cyclomatic complexity 36 (threshold 15). Of this number, 29 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.ApplyUserExperiencePreferences (cyclomatic 36) · ×1
  • shellinstaller.ApplyUserExperiencePreferences (cyclomatic 36) internal/shellinstaller/user_shell_apply_unix.go:16 — shellinstaller.ApplyUserExperiencePreferences has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotBuilder.processBoundaryRiskReasons (cyclomatic 35) · ×1
  • SnapshotBuilder.processBoundaryRiskReasons (cyclomatic 35) internal/reviewtransaction/risk.go:649 — SnapshotBuilder.processBoundaryRiskReasons has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.CheckUserShellUpdate (cyclomatic 35) · ×1
  • shellinstaller.CheckUserShellUpdate (cyclomatic 35) internal/shellinstaller/user_shell_update_unix.go:30 — shellinstaller.CheckUserShellUpdate has cyclomatic complexity 35 (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.
D1 · Cyclomatic Complexity · Model.updateShellInstallRun (cyclomatic 35) · ×1
  • Model.updateShellInstallRun (cyclomatic 35) internal/tui/shell_install.go:698 — Model.updateShellInstallRun has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunReviewCaptureUnachievable (cyclomatic 34) · ×1
  • cli.RunReviewCaptureUnachievable (cyclomatic 34) internal/cli/review_capture_unachievable.go:60 — cli.RunReviewCaptureUnachievable has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunPreparedInstall (cyclomatic 34) · ×1
  • cli.RunPreparedInstall (cyclomatic 34) internal/cli/run.go:207 — cli.RunPreparedInstall has cyclomatic complexity 34 (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.
D1 · Cyclomatic Complexity · cli.runSyncWithSelectionScope (cyclomatic 34) · ×1
  • cli.runSyncWithSelectionScope (cyclomatic 34) REDACTED:2053 — cli.runSyncWithSelectionScope has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateClassifiedAuthorityRepairRecordShape (cyclomatic 34) · ×1
  • reviewtransaction.validateClassifiedAuthorityRepairRecordShape (cyclomatic 34) internal/reviewtransaction/classified_authority_replay.go:225 — reviewtransaction.validateClassifiedAuthorityRepairRecordShape has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.reopenCompactAdmittedRoleResults (cyclomatic 34) · ×1
  • reviewtransaction.reopenCompactAdmittedRoleResults (cyclomatic 34) internal/reviewtransaction/compact.go:1418 — reviewtransaction.reopenCompactAdmittedRoleResults has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CompactStore.replaceContextGuarded (cyclomatic 34) · ×1
  • CompactStore.replaceContextGuarded (cyclomatic 34) internal/reviewtransaction/compact_store.go:1545 — CompactStore.replaceContextGuarded has cyclomatic complexity 34 (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.
D1 · Cyclomatic Complexity · shellinstaller.ReadNativePNPMInstallation (cyclomatic 34) · ×1
  • shellinstaller.ReadNativePNPMInstallation (cyclomatic 34) internal/shellinstaller/user_pnpm_readback_unix.go:28 — shellinstaller.ReadNativePNPMInstallation has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body's own statements and 9 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsCodeGraphExtract (cyclomatic 34) · ×1
  • shellinstaller.userWindowsCodeGraphExtract (cyclomatic 34) internal/shellinstaller/user_codegraph_windows.go:99 — shellinstaller.userWindowsCodeGraphExtract has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewActionEligibility.Validate (cyclomatic 33) · ×1
  • ReviewActionEligibility.Validate (cyclomatic 33) internal/cli/review_status_contract.go:1871 — ReviewActionEligibility.Validate has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · uninstall.removeOpenCodeFamilyAgents (cyclomatic 33) · ×1
  • uninstall.removeOpenCodeFamilyAgents (cyclomatic 33) internal/components/uninstall/opencode_agents.go:49 — uninstall.removeOpenCodeFamilyAgents has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to one function literal inside it that branches (line 51). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · startupPathModel.enterBlocks (cyclomatic 33) · ×1
  • startupPathModel.enterBlocks (cyclomatic 33) internal/opencode/background_readiness.go:544 — startupPathModel.enterBlocks has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · RARAuthorityRepository.Publish (cyclomatic 33) · ×1
  • RARAuthorityRepository.Publish (cyclomatic 33) internal/reviewtransaction/rar_authority_repository.go:245 — RARAuthorityRepository.Publish has cyclomatic complexity 33 (threshold 15). Of this number, 25 points are the body's own statements and 8 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · shellinstaller.userRecover (cyclomatic 33) · ×1
  • shellinstaller.userRecover (cyclomatic 33) internal/shellinstaller/user_install_flow_unix.go:702 — shellinstaller.userRecover has cyclomatic complexity 33 (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.
D1 · Cyclomatic Complexity · screens.RenderShellInstall (cyclomatic 33) · ×1
  • screens.RenderShellInstall (cyclomatic 33) internal/tui/screens/shell_install.go:66 — screens.RenderShellInstall has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · providercontractbundle.validateEntries (cyclomatic 32) · ×1
  • providercontractbundle.validateEntries (cyclomatic 32) internal/providercontractbundle/bundle.go:627 — providercontractbundle.validateEntries has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactStore.CaptureAdmittedReviewerResult (cyclomatic 32) · ×1
  • CompactStore.CaptureAdmittedReviewerResult (cyclomatic 32) internal/reviewtransaction/compact_reviewer_capture.go:346 — CompactStore.CaptureAdmittedReviewerResult has cyclomatic complexity 32 (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.
D1 · Cyclomatic Complexity · CompactStore.RecordUnachievableLensAttempt (cyclomatic 32) · ×1
  • CompactStore.RecordUnachievableLensAttempt (cyclomatic 32) internal/reviewtransaction/compact_unachievable_lens.go:39 — CompactStore.RecordUnachievableLensAttempt has cyclomatic complexity 32 (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.
D1 · Cyclomatic Complexity · VerificationApplicability.Validate (cyclomatic 32) · ×1
  • VerificationApplicability.Validate (cyclomatic 32) internal/reviewtransaction/verification_contract.go:129 — VerificationApplicability.Validate has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.runPostSyncVerificationWithState (cyclomatic 31) · ×1
  • cli.runPostSyncVerificationWithState (cyclomatic 31) REDACTED:2742 — cli.runPostSyncVerificationWithState has cyclomatic complexity 31 (threshold 15). Of this number, 25 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewTransitionSubmission.validateProviderRoleCapture (cyclomatic 31) · ×1
  • ReviewTransitionSubmission.validateProviderRoleCapture (cyclomatic 31) internal/cli/review_status_contract.go:1573 — ReviewTransitionSubmission.validateProviderRoleCapture has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactReviewLifecycle (cyclomatic 31) · ×1
  • reviewtransaction.validateCompactReviewLifecycle (cyclomatic 31) internal/reviewtransaction/compact.go:1568 — reviewtransaction.validateCompactReviewLifecycle has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.ValidateCorrectionImpactClosure (cyclomatic 31) · ×1
  • reviewtransaction.ValidateCorrectionImpactClosure (cyclomatic 31) internal/reviewtransaction/verification_contract.go:766 — reviewtransaction.ValidateCorrectionImpactClosure has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RARAuthorityRepository.PublishPlan (cyclomatic 31) · ×1
  • RARAuthorityRepository.PublishPlan (cyclomatic 31) internal/reviewtransaction/rar_plan_authority.go:322 — RARAuthorityRepository.PublishPlan has cyclomatic complexity 31 (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.
D1 · Cyclomatic Complexity · Transaction.validateCorrectionBudget (cyclomatic 31) · ×1
  • Transaction.validateCorrectionBudget (cyclomatic 31) internal/reviewtransaction/transaction.go:1118 — Transaction.validateCorrectionBudget has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userCodeGraphReadbackWithNode (cyclomatic 31) · ×1
  • shellinstaller.userCodeGraphReadbackWithNode (cyclomatic 31) internal/shellinstaller/user_codegraph_admission_unix.go:21 — shellinstaller.userCodeGraphReadbackWithNode has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userTreeStamp (cyclomatic 31) · ×1
  • shellinstaller.userTreeStamp (cyclomatic 31) internal/shellinstaller/user_install_unix.go:64 — shellinstaller.userTreeStamp has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to one function literal inside it that branches (line 69). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · shellinstaller.userRestoreAgentImages (cyclomatic 31) · ×1
  • shellinstaller.userRestoreAgentImages (cyclomatic 31) internal/shellinstaller/user_shell_agent_unix.go:306 — shellinstaller.userRestoreAgentImages has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsIdentityBelow (cyclomatic 31) · ×1
  • shellinstaller.userWindowsIdentityBelow (cyclomatic 31) REDACTED:85 — shellinstaller.userWindowsIdentityBelow has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Model.updateShellManage (cyclomatic 31) · ×1
  • Model.updateShellManage (cyclomatic 31) internal/tui/shell_install.go:525 — Model.updateShellManage has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.renderWelcomeWithInstaller (cyclomatic 31) · ×1
  • screens.renderWelcomeWithInstaller (cyclomatic 31) internal/tui/screens/welcome.go:78 — screens.renderWelcomeWithInstaller has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 90, 164, 84). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · shellInstallModel.Update (cyclomatic 30) · ×1
  • shellInstallModel.Update (cyclomatic 30) internal/cli/shell_install_model_other.go:45 — shellInstallModel.Update has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.lockedAuthorityDispositionMutation (cyclomatic 30) · ×1
  • reviewtransaction.lockedAuthorityDispositionMutation (cyclomatic 30) internal/reviewtransaction/authority_disposition_execute.go:178 — reviewtransaction.lockedAuthorityDispositionMutation has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.repairHistoricalLegacyAlias (cyclomatic 30) · ×1
  • reviewtransaction.repairHistoricalLegacyAlias (cyclomatic 30) internal/reviewtransaction/legacy_alias_repair.go:70 — reviewtransaction.repairHistoricalLegacyAlias has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · CompactStore.CreateOrReplayAtomicStart (cyclomatic 30) · ×1
  • CompactStore.CreateOrReplayAtomicStart (cyclomatic 30) internal/reviewtransaction/compact_store.go:1338 — CompactStore.CreateOrReplayAtomicStart has cyclomatic complexity 30 (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.
D1 · Cyclomatic Complexity · Transaction.ValidateFixDeltaResult (cyclomatic 30) · ×1
  • Transaction.ValidateFixDeltaResult (cyclomatic 30) internal/reviewtransaction/transaction.go:781 — Transaction.ValidateFixDeltaResult has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userAgentPreflight (cyclomatic 30) · ×1
  • shellinstaller.userAgentPreflight (cyclomatic 30) internal/shellinstaller/user_shell_agent_unix.go:41 — shellinstaller.userAgentPreflight has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.loadPersistedAssignments (cyclomatic 29) · ×1
  • app.loadPersistedAssignments (cyclomatic 29) internal/app/app.go:967 — app.loadPersistedAssignments has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.RunReviewBundleImport (cyclomatic 29) · ×1
  • cli.RunReviewBundleImport (cyclomatic 29) internal/cli/review.go:558 — cli.RunReviewBundleImport has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentguidance.InjectStrictTDDWithOptions (cyclomatic 29) · ×1
  • agentguidance.InjectStrictTDDWithOptions (cyclomatic 29) internal/components/agentguidance/strict_tdd.go:42 — agentguidance.InjectStrictTDDWithOptions has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.topLevelJSONCKeyCount (cyclomatic 29) · ×1
  • filemerge.topLevelJSONCKeyCount (cyclomatic 29) REDACTED:679 — filemerge.topLevelJSONCKeyCount has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · startupPathModel.expand (cyclomatic 29) · ×1
  • startupPathModel.expand (cyclomatic 29) internal/opencode/background_readiness.go:700 — startupPathModel.expand has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactResultReopens (cyclomatic 29) · ×1
  • reviewtransaction.validateCompactResultReopens (cyclomatic 29) internal/reviewtransaction/compact.go:2060 — reviewtransaction.validateCompactResultReopens has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.classifyCompactTargetRelation (cyclomatic 29) · ×1
  • reviewtransaction.classifyCompactTargetRelation (cyclomatic 29) internal/reviewtransaction/compact_target_relation.go:45 — reviewtransaction.classifyCompactTargetRelation has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.projectTargetStatusDecision (cyclomatic 29) · ×1
  • reviewtransaction.projectTargetStatusDecision (cyclomatic 29) internal/reviewtransaction/target_status.go:844 — reviewtransaction.projectTargetStatusDecision has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CompactStore.resolveAdmittedReviewerResult (cyclomatic 29) · ×1
  • CompactStore.resolveAdmittedReviewerResult (cyclomatic 29) internal/reviewtransaction/compact_reviewer_capture.go:290 — CompactStore.resolveAdmittedReviewerResult has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · telemetry.Opportunistic (cyclomatic 29) · ×1
  • telemetry.Opportunistic (cyclomatic 29) internal/telemetry/opportunistic.go:72 — telemetry.Opportunistic has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · opencode.parseCodeGraphCommand (cyclomatic 28) · ×1
  • opencode.parseCodeGraphCommand (cyclomatic 28) internal/agents/opencode/adapter.go:245 — opencode.parseCodeGraphCommand has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · filemerge.UpsertYAMLMCPServerBlock (cyclomatic 28) · ×1
  • filemerge.UpsertYAMLMCPServerBlock (cyclomatic 28) internal/components/filemerge/yaml.go:29 — filemerge.UpsertYAMLMCPServerBlock has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.RetireClaudeSDDPreflightHook (cyclomatic 28) · ×1
  • legacyassets.RetireClaudeSDDPreflightHook (cyclomatic 28) internal/components/legacyassets/claude_hook.go:41 — legacyassets.RetireClaudeSDDPreflightHook has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.RetireOpenCodeSDDSettings (cyclomatic 28) · ×1
  • legacyassets.RetireOpenCodeSDDSettings (cyclomatic 28) internal/components/legacyassets/opencode_settings.go:310 — legacyassets.RetireOpenCodeSDDSettings has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.removeOwnedFile (cyclomatic 28) · ×1
  • opencode.removeOwnedFile (cyclomatic 28) internal/opencode/background_remove_unix.go:37 — opencode.removeOwnedFile has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · reviewtransaction.validateBundleExpectation (cyclomatic 28) · ×1
  • reviewtransaction.validateBundleExpectation (cyclomatic 28) internal/reviewtransaction/bundle.go:202 — reviewtransaction.validateBundleExpectation has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactRecoveredEvidenceReferenceShape (cyclomatic 28) · ×1
  • reviewtransaction.validateCompactRecoveredEvidenceReferenceShape (cyclomatic 28) internal/reviewtransaction/compact_recovered_evidence.go:151 — reviewtransaction.validateCompactRecoveredEvidenceReferenceShape has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactRepositoryEvidence (cyclomatic 28) · ×1
  • reviewtransaction.validateCompactRepositoryEvidence (cyclomatic 28) internal/reviewtransaction/compact_store.go:1654 — reviewtransaction.validateCompactRepositoryEvidence has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.markCompactGraph (cyclomatic 28) · ×1
  • reviewtransaction.markCompactGraph (cyclomatic 28) internal/reviewtransaction/status.go:463 — reviewtransaction.markCompactGraph has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userStageOwnedAgentContext7 (cyclomatic 28) · ×1
  • shellinstaller.userStageOwnedAgentContext7 (cyclomatic 28) internal/shellinstaller/user_shell_agent_unix.go:181 — shellinstaller.userStageOwnedAgentContext7 has cyclomatic complexity 28 (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.
D1 · Cyclomatic Complexity · RestoreService.restoreCompressed (cyclomatic 27) · ×1
  • RestoreService.restoreCompressed (cyclomatic 27) internal/backup/restore.go:340 — RestoreService.restoreCompressed has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.newReviewActionEligibility (cyclomatic 27) · ×1
  • cli.newReviewActionEligibility (cyclomatic 27) internal/cli/review_status_contract.go:293 — cli.newReviewActionEligibility has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateRepairNextTransition (cyclomatic 27) · ×1
  • ReviewTargetStatusResult.validateRepairNextTransition (cyclomatic 27) internal/cli/review_status_contract.go:1134 — ReviewTargetStatusResult.validateRepairNextTransition has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · filemerge.topLevelJSONCPropertyValueRange (cyclomatic 27) · ×1
  • filemerge.topLevelJSONCPropertyValueRange (cyclomatic 27) REDACTED:908 — filemerge.topLevelJSONCPropertyValueRange has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · geminimodules.Publish (cyclomatic 27) · ×1
  • geminimodules.Publish (cyclomatic 27) internal/components/geminimodules/modules.go:107 — geminimodules.Publish has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenCodeSDDRegistry.Owns (cyclomatic 27) · ×1
  • OpenCodeSDDRegistry.Owns (cyclomatic 27) internal/components/legacyassets/opencode_settings.go:115 — OpenCodeSDDRegistry.Owns has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.discoverClassifiedAuthorityRepairRecord (cyclomatic 27) · ×1
  • reviewtransaction.discoverClassifiedAuthorityRepairRecord (cyclomatic 27) internal/reviewtransaction/classified_authority_replay.go:139 — reviewtransaction.discoverClassifiedAuthorityRepairRecord has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateChangedPathManifestEntry (cyclomatic 27) · ×1
  • reviewtransaction.validateChangedPathManifestEntry (cyclomatic 27) internal/reviewtransaction/frozen_candidate_context.go:608 — reviewtransaction.validateChangedPathManifestEntry has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validateGateRequest (cyclomatic 27) · ×1
  • reviewtransaction.validateGateRequest (cyclomatic 27) internal/reviewtransaction/gate.go:636 — reviewtransaction.validateGateRequest has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userToolsAcquire (cyclomatic 27) · ×1
  • shellinstaller.userToolsAcquire (cyclomatic 27) internal/shellinstaller/user_install_flow_unix.go:876 — shellinstaller.userToolsAcquire has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userNativeReadback (cyclomatic 27) · ×1
  • shellinstaller.userNativeReadback (cyclomatic 27) internal/shellinstaller/user_install_flow_unix.go:1043 — shellinstaller.userNativeReadback has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · shellinstaller.userPublishNativePNPMPrepared (cyclomatic 27) · ×1
  • shellinstaller.userPublishNativePNPMPrepared (cyclomatic 27) internal/shellinstaller/user_pnpm_publish_linux.go:15 — shellinstaller.userPublishNativePNPMPrepared has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsInventory (cyclomatic 27) · ×1
  • shellinstaller.userWindowsInventory (cyclomatic 27) REDACTED:384 — shellinstaller.userWindowsInventory has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 423, 399, 410). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · upgrade.managedAgentBackupPaths (cyclomatic 27) · ×1
  • upgrade.managedAgentBackupPaths (cyclomatic 27) internal/update/upgrade/executor.go:203 — upgrade.managedAgentBackupPaths has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.runBenchModelPickerCommand (cyclomatic 26) · ×1
  • app.runBenchModelPickerCommand (cyclomatic 26) internal/app/bench_model_picker.go:7 — app.runBenchModelPickerCommand has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · cli.RunReviewInvalidate (cyclomatic 26) · ×1
  • cli.RunReviewInvalidate (cyclomatic 26) internal/cli/review_facade.go:2296 — cli.RunReviewInvalidate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewIntegrationConsentResult.Validate (cyclomatic 26) · ×1
  • ReviewIntegrationConsentResult.Validate (cyclomatic 26) internal/cli/review_consent_contract.go:299 — ReviewIntegrationConsentResult.Validate has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · installRuntime.stagePlan (cyclomatic 26) · ×1
  • installRuntime.stagePlan (cyclomatic 26) internal/cli/run.go:929 — installRuntime.stagePlan has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · syncRuntime.stagePlan (cyclomatic 26) · ×1
  • syncRuntime.stagePlan (cyclomatic 26) REDACTED:515 — syncRuntime.stagePlan has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openCodeModelAssignmentSyncStep.Run (cyclomatic 26) · ×1
  • openCodeModelAssignmentSyncStep.Run (cyclomatic 26) REDACTED:1173 — openCodeModelAssignmentSyncStep.Run has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · agenthooks.installSkillRegistry (cyclomatic 26) · ×1
  • agenthooks.installSkillRegistry (cyclomatic 26) internal/components/agenthooks/skill_registry.go:77 — agenthooks.installSkillRegistry has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · communitytool.UninstallPiCodeGraph (cyclomatic 26) · ×1
  • communitytool.UninstallPiCodeGraph (cyclomatic 26) internal/components/communitytool/pi_codegraph.go:823 — communitytool.UninstallPiCodeGraph has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · engram.stdioHandshake (cyclomatic 26) · ×1
  • engram.stdioHandshake (cyclomatic 26) internal/components/engram/healthprobe.go:149 — engram.stdioHandshake has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.RetireSDDAssets (cyclomatic 26) · ×1
  • legacyassets.RetireSDDAssets (cyclomatic 26) internal/components/legacyassets/sdd_assets.go:164 — legacyassets.RetireSDDAssets has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetryruntime.inspect (cyclomatic 26) · ×1
  • telemetryruntime.inspect (cyclomatic 26) internal/components/telemetryruntime/managed.go:124 — telemetryruntime.inspect has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · uninstall.removeSkillRegistryHook (cyclomatic 26) · ×1
  • uninstall.removeSkillRegistryHook (cyclomatic 26) internal/components/uninstall/service.go:1725 — uninstall.removeSkillRegistryHook has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · startupPathModel.apply (cyclomatic 26) · ×1
  • startupPathModel.apply (cyclomatic 26) internal/opencode/background_readiness.go:439 — startupPathModel.apply has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.AbandonPristineCompactStore (cyclomatic 26) · ×1
  • reviewtransaction.AbandonPristineCompactStore (cyclomatic 26) internal/reviewtransaction/compact_abandon.go:242 — reviewtransaction.AbandonPristineCompactStore has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · reviewtransaction.loadCompactTargetStatusCandidates (cyclomatic 26) · ×1
  • reviewtransaction.loadCompactTargetStatusCandidates (cyclomatic 26) internal/reviewtransaction/target_status_projection.go:35 — reviewtransaction.loadCompactTargetStatusCandidates has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.ValidateTargetedValidationRequest (cyclomatic 26) · ×1
  • reviewtransaction.ValidateTargetedValidationRequest (cyclomatic 26) internal/reviewtransaction/targeted_validation_request.go:208 — reviewtransaction.ValidateTargetedValidationRequest has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SnapshotBuilder.classifyVerificationStat (cyclomatic 26) · ×1
  • SnapshotBuilder.classifyVerificationStat (cyclomatic 26) internal/reviewtransaction/verification_contract.go:938 — SnapshotBuilder.classifyVerificationStat has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Model.shellInstallView (cyclomatic 26) · ×1
  • Model.shellInstallView (cyclomatic 26) internal/tui/shell_experience.go:331 — Model.shellInstallView has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunReviewAssess (cyclomatic 25) · ×1
  • cli.RunReviewAssess (cyclomatic 25) internal/cli/review_assess.go:269 — cli.RunReviewAssess has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · cli.RenderSyncReport (cyclomatic 25) · ×1
  • cli.RenderSyncReport (cyclomatic 25) REDACTED:2594 — cli.RenderSyncReport has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentguidance.prepareDesiredOrchestratorModules (cyclomatic 25) · ×1
  • agentguidance.prepareDesiredOrchestratorModules (cyclomatic 25) internal/components/agentguidance/orchestrator_module_install.go:120 — agentguidance.prepareDesiredOrchestratorModules has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.updateTOMLMultilineString (cyclomatic 25) · ×1
  • filemerge.updateTOMLMultilineString (cyclomatic 25) internal/components/filemerge/toml.go:387 — filemerge.updateTOMLMultilineString has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencodeplugin.Uninstall (cyclomatic 25) · ×1
  • opencodeplugin.Uninstall (cyclomatic 25) internal/components/opencodeplugin/uninstall.go:36 — opencodeplugin.Uninstall has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetryruntime.sendOpenCode (cyclomatic 25) · ×1
  • telemetryruntime.sendOpenCode (cyclomatic 25) internal/components/telemetryruntime/opencode.go:77 — telemetryruntime.sendOpenCode has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.splitShellCommands (cyclomatic 25) · ×1
  • opencode.splitShellCommands (cyclomatic 25) internal/opencode/background_readiness.go:810 — opencode.splitShellCommands has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · opencode.overlayConfiguredProviders (cyclomatic 25) · ×1
  • opencode.overlayConfiguredProviders (cyclomatic 25) internal/opencode/config_v2.go:18 — opencode.overlayConfiguredProviders has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · providercontractbundle.VerifyArchive (cyclomatic 25) · ×1
  • providercontractbundle.VerifyArchive (cyclomatic 25) internal/providercontractbundle/bundle.go:448 — providercontractbundle.VerifyArchive has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.ensureRARDirectoryChain (cyclomatic 25) · ×1
  • reviewtransaction.ensureRARDirectoryChain (cyclomatic 25) internal/reviewtransaction/rar_path_safety.go:103 — reviewtransaction.ensureRARDirectoryChain has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactStore.WithdrawUnachievableLensAttempt (cyclomatic 25) · ×1
  • CompactStore.WithdrawUnachievableLensAttempt (cyclomatic 25) internal/reviewtransaction/compact_unachievable_lens.go:154 — CompactStore.WithdrawUnachievableLensAttempt has cyclomatic complexity 25 (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.
D1 · Cyclomatic Complexity · shellinstaller.userStageExperience (cyclomatic 25) · ×1
  • shellinstaller.userStageExperience (cyclomatic 25) internal/shellinstaller/user_experience_stage_unix.go:18 — shellinstaller.userStageExperience has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userSupervisorSHA (cyclomatic 25) · ×1
  • shellinstaller.userSupervisorSHA (cyclomatic 25) internal/shellinstaller/user_install_unix.go:252 — shellinstaller.userSupervisorSHA has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userToolMember (cyclomatic 25) · ×1
  • shellinstaller.userToolMember (cyclomatic 25) internal/shellinstaller/user_install_unix.go:370 — shellinstaller.userToolMember has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.privateNativeFile (cyclomatic 25) · ×1
  • shellinstaller.privateNativeFile (cyclomatic 25) REDACTED:32 — shellinstaller.privateNativeFile has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.LoadUserShellExperience (cyclomatic 25) · ×1
  • shellinstaller.LoadUserShellExperience (cyclomatic 25) internal/shellinstaller/user_shell_registry_unix.go:204 — shellinstaller.LoadUserShellExperience has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · userNativeServiceCustody.captureFiles (cyclomatic 25) · ×1
  • userNativeServiceCustody.captureFiles (cyclomatic 25) internal/shellinstaller/user_native_service_linux.go:51 — userNativeServiceCustody.captureFiles has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.closeReviewOnLastCapturedLens (cyclomatic 24) · ×1
  • cli.closeReviewOnLastCapturedLens (cyclomatic 24) internal/cli/review_last_event_closure.go:197 — cli.closeReviewOnLastCapturedLens has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runReviewStopHookStop (cyclomatic 24) · ×1
  • cli.runReviewStopHookStop (cyclomatic 24) internal/cli/review_stop_hook.go:165 — cli.runReviewStopHookStop has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewCapabilitiesResult.Validate (cyclomatic 24) · ×1
  • ReviewCapabilitiesResult.Validate (cyclomatic 24) internal/cli/review_capabilities.go:425 — ReviewCapabilitiesResult.Validate has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ReviewTransitionSubmission.validateIntendedUntrackedSelection (cyclomatic 24) · ×1
  • ReviewTransitionSubmission.validateIntendedUntrackedSelection (cyclomatic 24) internal/cli/review_status_contract.go:1518 — ReviewTransitionSubmission.validateIntendedUntrackedSelection has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ReviewTransitionSubmission.validateCorrectionPlan (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ReviewTargetStatusProjection.Validate (cyclomatic 24) · ×1
  • ReviewTargetStatusProjection.Validate (cyclomatic 24) internal/cli/review_status_contract.go:1913 — ReviewTargetStatusProjection.Validate has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ReviewTransitionSubmission.validateCorrectionPlan (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · filemerge.scanJSONCValueEnd (cyclomatic 24) · ×1
  • filemerge.scanJSONCValueEnd (cyclomatic 24) REDACTED:1008 — filemerge.scanJSONCValueEnd has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateReceiptStructure (cyclomatic 24) · ×1
  • reviewtransaction.validateReceiptStructure (cyclomatic 24) internal/reviewtransaction/receipt.go:353 — reviewtransaction.validateReceiptStructure has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.runGitCapturedRangeWithTimeout (cyclomatic 24) · ×1
  • reviewtransaction.runGitCapturedRangeWithTimeout (cyclomatic 24) internal/reviewtransaction/snapshot.go:2002 — reviewtransaction.runGitCapturedRangeWithTimeout has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactState.EscalationEvidence (cyclomatic 24) · ×1
  • CompactState.EscalationEvidence (cyclomatic 24) internal/reviewtransaction/compact_reviewer_capture.go:68 — CompactState.EscalationEvidence has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotBuilder.activePassiveContentPaths (cyclomatic 24) · ×1
  • SnapshotBuilder.activePassiveContentPaths (cyclomatic 24) internal/reviewtransaction/risk.go:373 — SnapshotBuilder.activePassiveContentPaths has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotBuilder.renameAwareSavings (cyclomatic 24) · ×1
  • SnapshotBuilder.renameAwareSavings (cyclomatic 24) internal/reviewtransaction/risk.go:1073 — SnapshotBuilder.renameAwareSavings has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Transaction.validateResolutionCounters (cyclomatic 24) · ×1
  • Transaction.validateResolutionCounters (cyclomatic 24) internal/reviewtransaction/transaction.go:1622 — Transaction.validateResolutionCounters has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.DecodeUserExperience (cyclomatic 24) · ×1
  • shellinstaller.DecodeUserExperience (cyclomatic 24) internal/shellinstaller/user_experience.go:154 — shellinstaller.DecodeUserExperience has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsVerify (cyclomatic 24) · ×1
  • shellinstaller.userWindowsVerify (cyclomatic 24) internal/shellinstaller/user_launch_windows.go:68 — shellinstaller.userWindowsVerify has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeInstallerRuntime.produceForDestination (cyclomatic 24) · ×1
  • NativeInstallerRuntime.produceForDestination (cyclomatic 24) internal/shellinstaller/user_native_install_linux.go:18 — NativeInstallerRuntime.produceForDestination has cyclomatic complexity 24 (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.
D1 · Cyclomatic Complexity · main.run (cyclomatic 23) · ×1
  • main.run (cyclomatic 23) cmd/gentle-telemetry/main.go:104 — main.run has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · cli.checkStateJSON (cyclomatic 23) · ×1
  • cli.checkStateJSON (cyclomatic 23) internal/cli/doctor.go:517 — cli.checkStateJSON has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunReviewCaptureCorrectionPlan (cyclomatic 23) · ×1
  • cli.RunReviewCaptureCorrectionPlan (cyclomatic 23) internal/cli/review_correction_plan_capture.go:28 — cli.RunReviewCaptureCorrectionPlan has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · cli.reviewLensContextBlock (cyclomatic 23) · ×1
  • cli.reviewLensContextBlock (cyclomatic 23) internal/cli/review_lens_context.go:690 — cli.reviewLensContextBlock has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.reviewProviderAdmitTargetedValidatorRaw (cyclomatic 23) · ×1
  • cli.reviewProviderAdmitTargetedValidatorRaw (cyclomatic 23) internal/cli/review_provider_roles.go:622 — cli.reviewProviderAdmitTargetedValidatorRaw has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · cli.newReviewIntegrationStartResult (cyclomatic 23) · ×1
  • cli.newReviewIntegrationStartResult (cyclomatic 23) internal/cli/review_start_contract.go:65 — cli.newReviewIntegrationStartResult has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.mergeExplicitAgentInstallState (cyclomatic 23) · ×1
  • cli.mergeExplicitAgentInstallState (cyclomatic 23) internal/cli/run.go:469 — cli.mergeExplicitAgentInstallState has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · agentguidance.decodeOrchestratorFragments (cyclomatic 23) · ×1
  • agentguidance.decodeOrchestratorFragments (cyclomatic 23) internal/components/agentguidance/orchestrator_module_fragments.go:50 — agentguidance.decodeOrchestratorFragments has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.topLevelJSONCObjectEnd (cyclomatic 23) · ×1
  • filemerge.topLevelJSONCObjectEnd (cyclomatic 23) REDACTED:776 — filemerge.topLevelJSONCObjectEnd has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.mergeObjectScope (cyclomatic 23) · ×1
  • filemerge.mergeObjectScope (cyclomatic 23) REDACTED:1126 — filemerge.mergeObjectScope has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.RetireSDDAgents (cyclomatic 23) · ×1
  • legacyassets.RetireSDDAgents (cyclomatic 23) internal/components/legacyassets/sdd_agents.go:201 — legacyassets.RetireSDDAgents has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ActivationPlan.Apply (cyclomatic 23) · ×1
  • ActivationPlan.Apply (cyclomatic 23) internal/opencode/background.go:707 — ActivationPlan.Apply has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.authorityRepairRoot (cyclomatic 23) · ×1
  • reviewtransaction.authorityRepairRoot (cyclomatic 23) internal/reviewtransaction/authority_repair.go:705 — reviewtransaction.authorityRepairRoot has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.RepairClassifiedAuthority (cyclomatic 23) · ×1
  • reviewtransaction.RepairClassifiedAuthority (cyclomatic 23) internal/reviewtransaction/authority_repair.go:871 — reviewtransaction.RepairClassifiedAuthority has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.RebuildCommittedBaseDiffCorrectionCandidate (cyclomatic 23) · ×1
  • reviewtransaction.RebuildCommittedBaseDiffCorrectionCandidate (cyclomatic 23) internal/reviewtransaction/snapshot.go:992 — reviewtransaction.RebuildCommittedBaseDiffCorrectionCandidate has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · reviewtransaction.inventoryLineage (cyclomatic 23) · ×1
  • reviewtransaction.inventoryLineage (cyclomatic 23) internal/reviewtransaction/status.go:299 — reviewtransaction.inventoryLineage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactStore.CaptureAdmittedTargetedValidatorResult (cyclomatic 23) · ×1
  • CompactStore.CaptureAdmittedTargetedValidatorResult (cyclomatic 23) internal/reviewtransaction/compact_reviewer_capture.go:824 — CompactStore.CaptureAdmittedTargetedValidatorResult has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactStore.RecordInconclusiveTargetedValidatorAttempt (cyclomatic 23) · ×1
  • CompactStore.RecordInconclusiveTargetedValidatorAttempt (cyclomatic 23) internal/reviewtransaction/compact_reviewer_capture.go:917 — CompactStore.RecordInconclusiveTargetedValidatorAttempt has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · SnapshotBuilder.candidateFindingSupportsCausality (cyclomatic 23) · ×1
  • SnapshotBuilder.candidateFindingSupportsCausality (cyclomatic 23) internal/reviewtransaction/snapshot.go:481 — SnapshotBuilder.candidateFindingSupportsCausality has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userStageContext7 (cyclomatic 23) · ×1
  • shellinstaller.userStageContext7 (cyclomatic 23) internal/shellinstaller/user_context7_stage_unix.go:18 — shellinstaller.userStageContext7 has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · shellinstaller.userPNPMRelocation (cyclomatic 23) · ×1
  • shellinstaller.userPNPMRelocation (cyclomatic 23) REDACTED:170 — shellinstaller.userPNPMRelocation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · shellinstaller.userStageVerify (cyclomatic 23) · ×1
  • shellinstaller.userStageVerify (cyclomatic 23) internal/shellinstaller/user_install_darwin.go:283 — shellinstaller.userStageVerify has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · telemetry.DecodeCodexHook (cyclomatic 23) · ×1
  • telemetry.DecodeCodexHook (cyclomatic 23) internal/telemetry/runtime_codex.go:40 — telemetry.DecodeCodexHook has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunReview (cyclomatic 22) · ×1
  • cli.RunReview (cyclomatic 22) internal/cli/review_facade.go:601 — cli.RunReview has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.parseVerboseCatalog (cyclomatic 22) · ×1
  • opencode.parseVerboseCatalog (cyclomatic 22) internal/opencode/catalog.go:336 — opencode.parseVerboseCatalog has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.configuredVariants (cyclomatic 22) · ×1
  • opencode.configuredVariants (cyclomatic 22) internal/opencode/config.go:279 — opencode.configuredVariants has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 280). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · reviewtransaction.ExtractBoundedSingleJSONObject (cyclomatic 22) · ×1
  • reviewtransaction.ExtractBoundedSingleJSONObject (cyclomatic 22) internal/reviewtransaction/artifact_admission.go:721 — reviewtransaction.ExtractBoundedSingleJSONObject has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.deriveAuthorityDispositionPlan (cyclomatic 22) · ×1
  • reviewtransaction.deriveAuthorityDispositionPlan (cyclomatic 22) internal/reviewtransaction/authority_disposition_plan.go:279 — reviewtransaction.deriveAuthorityDispositionPlan has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.replayCommittedCompactAbandonment (cyclomatic 22) · ×1
  • reviewtransaction.replayCommittedCompactAbandonment (cyclomatic 22) internal/reviewtransaction/compact_abandon.go:347 — reviewtransaction.replayCommittedCompactAbandonment has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.isPassiveSVG (cyclomatic 22) · ×1
  • reviewtransaction.isPassiveSVG (cyclomatic 22) internal/reviewtransaction/verification_contract.go:1216 — reviewtransaction.isPassiveSVG has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RARAuthorityRepository.resolve (cyclomatic 22) · ×1
  • RARAuthorityRepository.resolve (cyclomatic 22) internal/reviewtransaction/rar_authority_repository.go:476 — RARAuthorityRepository.resolve has cyclomatic complexity 22 (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.
D1 · Cyclomatic Complexity · Transaction.ClassifyEvidence (cyclomatic 22) · ×1
  • Transaction.ClassifyEvidence (cyclomatic 22) internal/reviewtransaction/transaction.go:520 — Transaction.ClassifyEvidence has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userUnixChannelOverlay (cyclomatic 22) · ×1
  • shellinstaller.userUnixChannelOverlay (cyclomatic 22) internal/shellinstaller/user_channel_overlay_unix.go:98 — shellinstaller.userUnixChannelOverlay has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · shellinstaller.userServiceWithPlan (cyclomatic 22) · ×1
  • shellinstaller.userServiceWithPlan (cyclomatic 22) REDACTED:192 — shellinstaller.userServiceWithPlan has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · shellinstaller.privateColdReceive (cyclomatic 22) · ×1
  • shellinstaller.privateColdReceive (cyclomatic 22) internal/shellinstaller/user_runtime_primitives_unix.go:193 — shellinstaller.privateColdReceive has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.PublishUserShellLauncher (cyclomatic 22) · ×1
  • shellinstaller.PublishUserShellLauncher (cyclomatic 22) internal/shellinstaller/user_shell_launcher_unix.go:116 — shellinstaller.PublishUserShellLauncher has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsSecurity (cyclomatic 22) · ×1
  • shellinstaller.userWindowsSecurity (cyclomatic 22) REDACTED:29 — shellinstaller.userWindowsSecurity has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · userPNPMInventoryReader.file (cyclomatic 22) · ×1
  • userPNPMInventoryReader.file (cyclomatic 22) REDACTED:83 — userPNPMInventoryReader.file has cyclomatic complexity 22 (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.
D1 · Cyclomatic Complexity · telemetry.SendRuntimeWithDeliveryID (cyclomatic 22) · ×1
  • telemetry.SendRuntimeWithDeliveryID (cyclomatic 22) internal/telemetry/runtime_send.go:34 — telemetry.SendRuntimeWithDeliveryID has cyclomatic complexity 22 (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.
D1 · Cyclomatic Complexity · screens.renderPhaseList (cyclomatic 22) · ×1
  • screens.renderPhaseList (cyclomatic 22) internal/tui/screens/model_picker.go:756 — screens.renderPhaseList has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · upgrade.ExecuteWithOptions (cyclomatic 22) · ×1
  • upgrade.ExecuteWithOptions (cyclomatic 22) internal/update/upgrade/executor.go:533 — upgrade.ExecuteWithOptions has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · upgrade.RenderUpgradeReport (cyclomatic 22) · ×1
  • upgrade.RenderUpgradeReport (cyclomatic 22) internal/update/upgrade/render.go:12 — upgrade.RenderUpgradeReport has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.openCodeTransportComplete (cyclomatic 21) · ×1
  • cli.openCodeTransportComplete (cyclomatic 21) internal/cli/review_opencode_transport.go:492 — cli.openCodeTransportComplete has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runPostApplyVerification (cyclomatic 21) · ×1
  • cli.runPostApplyVerification (cyclomatic 21) internal/cli/run.go:4792 — cli.runPostApplyVerification has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.jsonValueEnd (cyclomatic 21) · ×1
  • filemerge.jsonValueEnd (cyclomatic 21) internal/components/filemerge/jsonc_members.go:194 — filemerge.jsonValueEnd has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Service.retiredSDDOperation (cyclomatic 21) · ×1
  • Service.retiredSDDOperation (cyclomatic 21) internal/components/uninstall/retired_sdd.go:22 — Service.retiredSDDOperation has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · releasepolicy.compareYAML (cyclomatic 21) · ×1
  • releasepolicy.compareYAML (cyclomatic 21) internal/releasepolicy/policy.go:213 — releasepolicy.compareYAML has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.reconcileClassifiedAuthorityRepairRecord (cyclomatic 21) · ×1
  • reviewtransaction.reconcileClassifiedAuthorityRepairRecord (cyclomatic 21) internal/reviewtransaction/classified_authority_replay.go:275 — reviewtransaction.reconcileClassifiedAuthorityRepairRecord has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · reviewtransaction.ResolveCorrectedCandidateInspection (cyclomatic 21) · ×1
  • reviewtransaction.ResolveCorrectedCandidateInspection (cyclomatic 21) internal/reviewtransaction/corrected_inspection.go:22 — reviewtransaction.ResolveCorrectedCandidateInspection has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · reviewtransaction.BuildCorrectionPlanRequest (cyclomatic 21) · ×1
  • reviewtransaction.BuildCorrectionPlanRequest (cyclomatic 21) internal/reviewtransaction/correction_plan_request.go:41 — reviewtransaction.BuildCorrectionPlanRequest has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · reviewtransaction.ValidateCorrectionPlanRequest (cyclomatic 21) · ×1
  • reviewtransaction.ValidateCorrectionPlanRequest (cyclomatic 21) internal/reviewtransaction/correction_plan_request.go:129 — reviewtransaction.ValidateCorrectionPlanRequest has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.resolveAdvertisedSelector (cyclomatic 21) · ×1
  • reviewtransaction.resolveAdvertisedSelector (cyclomatic 21) internal/reviewtransaction/gate.go:409 — reviewtransaction.resolveAdvertisedSelector has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.readPrivateRARFile (cyclomatic 21) · ×1
  • reviewtransaction.readPrivateRARFile (cyclomatic 21) internal/reviewtransaction/rar_path_safety.go:260 — reviewtransaction.readPrivateRARFile has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · ArtifactAdmission.Validate (cyclomatic 21) · ×1
  • ArtifactAdmission.Validate (cyclomatic 21) internal/reviewtransaction/artifact_admission.go:357 — ArtifactAdmission.Validate has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CompactState.CompleteCorrection (cyclomatic 21) · ×1
  • CompactState.CompleteCorrection (cyclomatic 21) internal/reviewtransaction/compact.go:2220 — CompactState.CompleteCorrection has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · CompactAtomicStartBinding.Validate (cyclomatic 21) · ×1
  • CompactAtomicStartBinding.Validate (cyclomatic 21) internal/reviewtransaction/compact.go:358 — CompactAtomicStartBinding.Validate has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · SnapshotBuilder.DiffStats (cyclomatic 21) · ×1
  • SnapshotBuilder.DiffStats (cyclomatic 21) internal/reviewtransaction/snapshot.go:587 — SnapshotBuilder.DiffStats has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Transaction.validateLensState (cyclomatic 21) · ×1
  • Transaction.validateLensState (cyclomatic 21) internal/reviewtransaction/transaction.go:1309 — Transaction.validateLensState has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.pristineReviewing (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · shellinstaller.userStageCodeGraphLibrary (cyclomatic 21) · ×1
  • shellinstaller.userStageCodeGraphLibrary (cyclomatic 21) internal/shellinstaller/user_codegraph_library_unix.go:195 — shellinstaller.userStageCodeGraphLibrary has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userPublishManifest (cyclomatic 21) · ×1
  • shellinstaller.userPublishManifest (cyclomatic 21) internal/shellinstaller/user_install_flow_unix.go:626 — shellinstaller.userPublishManifest has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · shellinstaller.userStageMainSource (cyclomatic 21) · ×1
  • shellinstaller.userStageMainSource (cyclomatic 21) internal/shellinstaller/user_main_source_unix.go:18 — shellinstaller.userStageMainSource has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.newUserNativeSlice (cyclomatic 21) · ×1
  • shellinstaller.newUserNativeSlice (cyclomatic 21) internal/shellinstaller/user_native_slice_linux.go:43 — shellinstaller.newUserNativeSlice has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · shellinstaller.privateCgroupPath (cyclomatic 21) · ×1
  • shellinstaller.privateCgroupPath (cyclomatic 21) internal/shellinstaller/user_runtime_primitives_linux.go:25 — shellinstaller.privateCgroupPath has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsChannelOverlay (cyclomatic 21) · ×1
  • shellinstaller.userWindowsChannelOverlay (cyclomatic 21) internal/shellinstaller/user_channel_overlay_windows.go:71 — shellinstaller.userWindowsChannelOverlay has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · UserExperience.Validate (cyclomatic 21) · ×1
  • UserExperience.Validate (cyclomatic 21) internal/shellinstaller/user_experience.go:118 — UserExperience.Validate has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NativeInstallerRuntime.Prepare (cyclomatic 21) · ×1
  • NativeInstallerRuntime.Prepare (cyclomatic 21) internal/shellinstaller/user_native_bootstrap_unix.go:18 — NativeInstallerRuntime.Prepare has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · opencode-review-transport.startRelay (cyclomatic 21) · ×1
  • opencode-review-transport.startRelay (cyclomatic 21) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:99 — opencode-review-transport.startRelay has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 118, 152, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · pi.ResolvePackageBin (cyclomatic 20) · ×1
  • pi.ResolvePackageBin (cyclomatic 20) internal/agents/pi/model_routing.go:57 — pi.ResolvePackageBin has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · cli.discoverCompactFacadeReview (cyclomatic 20) · ×1
  • cli.discoverCompactFacadeReview (cyclomatic 20) internal/cli/review_facade.go:3269 — cli.discoverCompactFacadeReview has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runReviewCommand (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.RunReviewMode (cyclomatic 20) · ×1
  • cli.RunReviewMode (cyclomatic 20) internal/cli/review_mode.go:46 — cli.RunReviewMode has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · cli.renderReviewStoreReset (cyclomatic 20) · ×1
  • cli.renderReviewStoreReset (cyclomatic 20) internal/cli/review_store_reset.go:102 — cli.renderReviewStoreReset has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.openCodeSDKRunApprovedManager (cyclomatic 20) · ×1
  • cli.openCodeSDKRunApprovedManager (cyclomatic 20) internal/cli/run.go:1825 — cli.openCodeSDKRunApprovedManager has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · cli.NormalizeInstallFlags (cyclomatic 20) · ×1
  • cli.NormalizeInstallFlags (cyclomatic 20) internal/cli/validate.go:26 — cli.NormalizeInstallFlags has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.defaultAgentsFromDetection (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · agentguidance.ApplyOpenCodeBackgroundPolicy (cyclomatic 20) · ×1
  • agentguidance.ApplyOpenCodeBackgroundPolicy (cyclomatic 20) internal/components/agentguidance/opencode_background.go:21 — agentguidance.ApplyOpenCodeBackgroundPolicy has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · agenthooks.InstallRetainedClaudeHooks (cyclomatic 20) · ×1
  • agenthooks.InstallRetainedClaudeHooks (cyclomatic 20) internal/components/agenthooks/claude.go:13 — agenthooks.InstallRetainedClaudeHooks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agenthooks.InstallCodexTelemetry (cyclomatic 20) · ×1
  • agenthooks.InstallCodexTelemetry (cyclomatic 20) internal/components/agenthooks/codex_telemetry.go:15 — agenthooks.InstallCodexTelemetry has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · engram.fetchLatestEngramVersionRequest (cyclomatic 20) · ×1
  • engram.fetchLatestEngramVersionRequest (cyclomatic 20) REDACTED:271 — engram.fetchLatestEngramVersionRequest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetryruntime.ReconcileForMajorWithRollback (cyclomatic 20) · ×1
  • telemetryruntime.ReconcileForMajorWithRollback (cyclomatic 20) internal/components/telemetryruntime/managed.go:272 — telemetryruntime.ReconcileForMajorWithRollback has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · releasepolicy.validateSnapshotFile (cyclomatic 20) · ×1
  • releasepolicy.validateSnapshotFile (cyclomatic 20) internal/releasepolicy/policy.go:508 — releasepolicy.validateSnapshotFile has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.parseFindingLocation (cyclomatic 20) · ×1
  • reviewtransaction.parseFindingLocation (cyclomatic 20) internal/reviewtransaction/compact.go:1977 — reviewtransaction.parseFindingLocation has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · reviewtransaction.compactDiscardedWorkSummary (cyclomatic 20) · ×1
  • reviewtransaction.compactDiscardedWorkSummary (cyclomatic 20) internal/reviewtransaction/compact_abandon.go:97 — reviewtransaction.compactDiscardedWorkSummary has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.ensurePrivateRARDirectoryTree (cyclomatic 20) · ×1
  • reviewtransaction.ensurePrivateRARDirectoryTree (cyclomatic 20) internal/reviewtransaction/rar_path_safety.go:175 — reviewtransaction.ensurePrivateRARDirectoryTree has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.canonicalLensResult (cyclomatic 20) · ×1
  • reviewtransaction.canonicalLensResult (cyclomatic 20) internal/reviewtransaction/transaction.go:388 — reviewtransaction.canonicalLensResult has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.pristineReviewing (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · reviewtransaction.validateCounters (cyclomatic 20) · ×1
  • reviewtransaction.validateCounters (cyclomatic 20) internal/reviewtransaction/transaction.go:1220 — reviewtransaction.validateCounters has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: reviewtransaction.pristineReviewing (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · authorityRepairScan.scanLegacy (cyclomatic 20) · ×1
  • authorityRepairScan.scanLegacy (cyclomatic 20) internal/reviewtransaction/authority_repair.go:322 — authorityRepairScan.scanLegacy has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreparedCandidateInspector.Inspect (cyclomatic 20) · ×1
  • PreparedCandidateInspector.Inspect (cyclomatic 20) internal/reviewtransaction/frozen_candidate_context.go:344 — PreparedCandidateInspector.Inspect has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · SnapshotBuilder.ClassifyVerificationApplicability (cyclomatic 20) · ×1
  • SnapshotBuilder.ClassifyVerificationApplicability (cyclomatic 20) internal/reviewtransaction/verification_contract.go:853 — SnapshotBuilder.ClassifyVerificationApplicability has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · shellinstaller.userValidateStageExperience (cyclomatic 20) · ×1
  • shellinstaller.userValidateStageExperience (cyclomatic 20) internal/shellinstaller/user_experience_files.go:8 — shellinstaller.userValidateStageExperience has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.PreviewUserInstall (cyclomatic 20) · ×1
  • shellinstaller.PreviewUserInstall (cyclomatic 20) internal/shellinstaller/user_install_preview.go:13 — shellinstaller.PreviewUserInstall has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userValidateInstallStage (cyclomatic 20) · ×1
  • shellinstaller.userValidateInstallStage (cyclomatic 20) internal/shellinstaller/user_install_stage_unix.go:28 — shellinstaller.userValidateInstallStage has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · shellinstaller.userMainSourceFiles (cyclomatic 20) · ×1
  • shellinstaller.userMainSourceFiles (cyclomatic 20) internal/shellinstaller/user_source_archive.go:65 — shellinstaller.userMainSourceFiles has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsOverlayToStable (cyclomatic 20) · ×1
  • shellinstaller.userWindowsOverlayToStable (cyclomatic 20) internal/shellinstaller/user_channel_overlay_windows.go:235 — shellinstaller.userWindowsOverlayToStable has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetry-runtime.telemetryRuntime.event (cyclomatic 20) · ×1
  • telemetry-runtime.telemetryRuntime.event (cyclomatic 20) internal/assets/opencode/plugins/telemetry-runtime.ts:23 — telemetry-runtime.telemetryRuntime.event has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cli.validateCompatibilityDestinations (cyclomatic 19) · ×1
  • cli.validateCompatibilityDestinations (cyclomatic 19) internal/cli/compatibility_skills.go:127 — cli.validateCompatibilityDestinations has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.authorizeReviewStart (cyclomatic 19) · ×1
  • cli.authorizeReviewStart (cyclomatic 19) internal/cli/review_mode.go:827 — cli.authorizeReviewStart has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · cli.retireOpenCodeFamilyReviewAgents (cyclomatic 19) · ×1
  • cli.retireOpenCodeFamilyReviewAgents (cyclomatic 19) internal/cli/run.go:2323 — cli.retireOpenCodeFamilyReviewAgents has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewIntegrationOperationResult.Validate (cyclomatic 19) · ×1
  • ReviewIntegrationOperationResult.Validate (cyclomatic 19) internal/cli/review_operation_contract.go:1717 — ReviewIntegrationOperationResult.Validate has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateStartNextTransition (cyclomatic 19) · ×1
  • ReviewTargetStatusResult.validateStartNextTransition (cyclomatic 19) internal/cli/review_status_contract.go:1085 — ReviewTargetStatusResult.validateStartNextTransition has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ReviewTransitionSubmission.validateCorrectionPlan (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · filemerge.marshalPermissionOrder (cyclomatic 19) · ×1
  • filemerge.marshalPermissionOrder (cyclomatic 19) REDACTED:215 — filemerge.marshalPermissionOrder has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.InjectMarkdownSection (cyclomatic 19) · ×1
  • filemerge.InjectMarkdownSection (cyclomatic 19) internal/components/filemerge/section.go:280 — filemerge.InjectMarkdownSection has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.UpsertTOMLTableKey (cyclomatic 19) · ×1
  • filemerge.UpsertTOMLTableKey (cyclomatic 19) internal/components/filemerge/toml.go:121 — filemerge.UpsertTOMLTableKey has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · geminimodules.MigrateLegacyRoot (cyclomatic 19) · ×1
  • geminimodules.MigrateLegacyRoot (cyclomatic 19) internal/components/geminimodules/migrate.go:19 — geminimodules.MigrateLegacyRoot has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · legacyassets.retiredSDDAssetItems (cyclomatic 19) · ×1
  • legacyassets.retiredSDDAssetItems (cyclomatic 19) internal/components/legacyassets/sdd_assets.go:101 — legacyassets.retiredSDDAssetItems has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · opencode.SettingsFileReferences (cyclomatic 19) · ×1
  • opencode.SettingsFileReferences (cyclomatic 19) internal/opencode/file_references.go:38 — opencode.SettingsFileReferences has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 52). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · reviewtransaction.ValidateArtifactSubject (cyclomatic 19) · ×1
  • reviewtransaction.ValidateArtifactSubject (cyclomatic 19) internal/reviewtransaction/artifact_subject.go:113 — reviewtransaction.ValidateArtifactSubject has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.classifyCompactCorrectionTarget (cyclomatic 19) · ×1
  • reviewtransaction.classifyCompactCorrectionTarget (cyclomatic 19) internal/reviewtransaction/compact_store.go:1203 — reviewtransaction.classifyCompactCorrectionTarget has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.forensicRemintedStateValid (cyclomatic 19) · ×1
  • reviewtransaction.forensicRemintedStateValid (cyclomatic 19) internal/reviewtransaction/compact_store.go:2079 — reviewtransaction.forensicRemintedStateValid has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.validatePrivateLocatorDirectory (cyclomatic 19) · ×1
  • reviewtransaction.validatePrivateLocatorDirectory (cyclomatic 19) internal/reviewtransaction/repository_locator.go:1074 — reviewtransaction.validatePrivateLocatorDirectory has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.canonicalGitDirectory (cyclomatic 19) · ×1
  • reviewtransaction.canonicalGitDirectory (cyclomatic 19) internal/reviewtransaction/snapshot.go:1131 — reviewtransaction.canonicalGitDirectory has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · reviewtransaction.buildTargetedValidationRequest (cyclomatic 19) · ×1
  • reviewtransaction.buildTargetedValidationRequest (cyclomatic 19) internal/reviewtransaction/targeted_validation_request.go:53 — reviewtransaction.buildTargetedValidationRequest has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · reviewtransaction.validVerificationID (cyclomatic 19) · ×1
  • reviewtransaction.validVerificationID (cyclomatic 19) internal/reviewtransaction/verification_contract.go:1378 — reviewtransaction.validVerificationID has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · authorityRepairScan.scanCompact (cyclomatic 19) · ×1
  • authorityRepairScan.scanCompact (cyclomatic 19) internal/reviewtransaction/authority_repair.go:255 — authorityRepairScan.scanCompact has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userPlanAgentToolsRestore (cyclomatic 19) · ×1
  • shellinstaller.userPlanAgentToolsRestore (cyclomatic 19) internal/shellinstaller/user_agent_tools_unix.go:217 — shellinstaller.userPlanAgentToolsRestore has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · shellinstaller.userEngramDecide (cyclomatic 19) · ×1
  • shellinstaller.userEngramDecide (cyclomatic 19) internal/shellinstaller/user_engram_shared.go:92 — shellinstaller.userEngramDecide has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userReuseComponents (cyclomatic 19) · ×1
  • shellinstaller.userReuseComponents (cyclomatic 19) internal/shellinstaller/user_install_scope_unix.go:106 — shellinstaller.userReuseComponents has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userReadMainArchive (cyclomatic 19) · ×1
  • shellinstaller.userReadMainArchive (cyclomatic 19) internal/shellinstaller/user_main_custody_unix.go:65 — shellinstaller.userReadMainArchive has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · shellinstaller.userCompareMainSource (cyclomatic 19) · ×1
  • shellinstaller.userCompareMainSource (cyclomatic 19) internal/shellinstaller/user_main_source_unix.go:100 — shellinstaller.userCompareMainSource has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 114). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · shellinstaller.userPNPMResolve (cyclomatic 19) · ×1
  • shellinstaller.userPNPMResolve (cyclomatic 19) internal/shellinstaller/user_pnpm_readback_unix.go:137 — shellinstaller.userPNPMResolve has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userLauncherProfileState (cyclomatic 19) · ×1
  • shellinstaller.userLauncherProfileState (cyclomatic 19) internal/shellinstaller/user_shell_launcher_path_unix.go:114 — shellinstaller.userLauncherProfileState has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsCompareMain (cyclomatic 19) · ×1
  • shellinstaller.userWindowsCompareMain (cyclomatic 19) internal/shellinstaller/user_artifacts_windows.go:40 — shellinstaller.userWindowsCompareMain has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 45). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsManifestReadAs (cyclomatic 19) · ×1
  • shellinstaller.userWindowsManifestReadAs (cyclomatic 19) REDACTED:254 — shellinstaller.userWindowsManifestReadAs has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · skillregistry.parseFrontmatter (cyclomatic 19) · ×1
  • skillregistry.parseFrontmatter (cyclomatic 19) internal/skillregistry/registry.go:323 — skillregistry.parseFrontmatter has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetrycollector.validateRuntimeStorage (cyclomatic 19) · ×1
  • telemetrycollector.validateRuntimeStorage (cyclomatic 19) internal/telemetrycollector/runtime_storage.go:103 — telemetrycollector.validateRuntimeStorage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Model.updateShellUpdate (cyclomatic 19) · ×1
  • Model.updateShellUpdate (cyclomatic 19) internal/tui/shell_install.go:330 — Model.updateShellUpdate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codex.compareSemanticVersion (cyclomatic 18) · ×1
  • codex.compareSemanticVersion (cyclomatic 18) internal/agents/codex/runtime_version.go:135 — codex.compareSemanticVersion has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · app.selfUpdate (cyclomatic 18) · ×1
  • app.selfUpdate (cyclomatic 18) internal/app/selfupdate.go:86 — app.selfUpdate has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · cli.ResolveOpenCodeBackground (cyclomatic 18) · ×1
  • cli.ResolveOpenCodeBackground (cyclomatic 18) internal/cli/opencode_background.go:44 — cli.ResolveOpenCodeBackground has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · cli.ResolvePiBackground (cyclomatic 18) · ×1
  • cli.ResolvePiBackground (cyclomatic 18) internal/cli/pi_background.go:62 — cli.ResolvePiBackground has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · cli.reviewLensContextParseNumstat (cyclomatic 18) · ×1
  • cli.reviewLensContextParseNumstat (cyclomatic 18) internal/cli/review_lens_context.go:605 — cli.reviewLensContextParseNumstat has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.reviewRecoveryCollection (cyclomatic 18) · ×1
  • cli.reviewRecoveryCollection (cyclomatic 18) internal/cli/review_next_transition.go:1176 — cli.reviewRecoveryCollection has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.reviewReasonDescription (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.runReviewOpenCodeTransportFrames (cyclomatic 18) · ×1
  • cli.runReviewOpenCodeTransportFrames (cyclomatic 18) internal/cli/review_opencode_transport.go:260 — cli.runReviewOpenCodeTransportFrames has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · cli.openCodeTransportStartBound (cyclomatic 18) · ×1
  • cli.openCodeTransportStartBound (cyclomatic 18) internal/cli/review_opencode_transport.go:411 — cli.openCodeTransportStartBound has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunReviewCaptureRefuter (cyclomatic 18) · ×1
  • cli.RunReviewCaptureRefuter (cyclomatic 18) internal/cli/review_provider_role_capture.go:185 — cli.RunReviewCaptureRefuter has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.reviewProviderAdmitRefuterRaw (cyclomatic 18) · ×1
  • cli.reviewProviderAdmitRefuterRaw (cyclomatic 18) internal/cli/review_provider_roles.go:481 — cli.reviewProviderAdmitRefuterRaw has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.migrateLegacyOpenCodeAgents (cyclomatic 18) · ×1
  • cli.migrateLegacyOpenCodeAgents (cyclomatic 18) internal/cli/run.go:2245 — cli.migrateLegacyOpenCodeAgents has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · unixCompatibilityDirectoryWriter.Write (cyclomatic 18) · ×1
  • unixCompatibilityDirectoryWriter.Write (cyclomatic 18) internal/cli/compatibility_writer_unix.go:60 — unixCompatibilityDirectoryWriter.Write has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · agentguidance.commitPreparedOrchestratorCoreAt (cyclomatic 18) · ×1
  • agentguidance.commitPreparedOrchestratorCoreAt (cyclomatic 18) internal/components/agentguidance/orchestrator_module_transaction.go:59 — agentguidance.commitPreparedOrchestratorCoreAt has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · agentguidance.splitOrchestratorModules (cyclomatic 18) · ×1
  • agentguidance.splitOrchestratorModules (cyclomatic 18) internal/components/agentguidance/orchestrator_modules.go:110 — agentguidance.splitOrchestratorModules has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · communitytool.probePiCodeGraphMCPWithTransport (cyclomatic 18) · ×1
  • communitytool.probePiCodeGraphMCPWithTransport (cyclomatic 18) internal/components/communitytool/pi_codegraph.go:587 — communitytool.probePiCodeGraphMCPWithTransport has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · communitytool.isReadOnlyCodeGraphExploreSchema (cyclomatic 18) · ×1
  • communitytool.isReadOnlyCodeGraphExploreSchema (cyclomatic 18) internal/components/communitytool/pi_codegraph.go:673 — communitytool.isReadOnlyCodeGraphExploreSchema has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · legacyassets.referencedSDDAgents (cyclomatic 18) · ×1
  • legacyassets.referencedSDDAgents (cyclomatic 18) internal/components/legacyassets/sdd_agents.go:287 — legacyassets.referencedSDDAgents has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencodeagents.Shape (cyclomatic 18) · ×1
  • opencodeagents.Shape (cyclomatic 18) internal/components/opencodeagents/agents.go:224 — opencodeagents.Shape has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.ResolveTarget (cyclomatic 18) · ×1
  • opencode.ResolveTarget (cyclomatic 18) internal/opencode/background.go:398 — opencode.ResolveTarget has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.shellWords (cyclomatic 18) · ×1
  • opencode.shellWords (cyclomatic 18) internal/opencode/background_readiness.go:857 — opencode.shellWords has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · opencode.parseV2ModelAPI (cyclomatic 18) · ×1
  • opencode.parseV2ModelAPI (cyclomatic 18) internal/opencode/catalog.go:148 — opencode.parseV2ModelAPI has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewerprovider.codexReviewerLoopbackBaseURL (cyclomatic 18) · ×1
  • reviewerprovider.codexReviewerLoopbackBaseURL (cyclomatic 18) internal/reviewerprovider/codex_adapter.go:140 — reviewerprovider.codexReviewerLoopbackBaseURL has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · reviewtransaction.AcknowledgeApprovedCompactAuthority (cyclomatic 18) · ×1
  • reviewtransaction.AcknowledgeApprovedCompactAuthority (cyclomatic 18) internal/reviewtransaction/compact_burn.go:147 — reviewtransaction.AcknowledgeApprovedCompactAuthority has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · reviewtransaction.quarantineCompactStoreEntry (cyclomatic 18) · ×1
  • reviewtransaction.quarantineCompactStoreEntry (cyclomatic 18) internal/reviewtransaction/compact_reclaim.go:229 — reviewtransaction.quarantineCompactStoreEntry has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · reviewtransaction.acquireRARAuthorityLock (cyclomatic 18) · ×1
  • reviewtransaction.acquireRARAuthorityLock (cyclomatic 18) internal/reviewtransaction/rar_path_safety.go:390 — reviewtransaction.acquireRARAuthorityLock has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.acquireMaintenanceLockInternal (cyclomatic 18) · ×1
  • reviewtransaction.acquireMaintenanceLockInternal (cyclomatic 18) internal/reviewtransaction/store_lock.go:233 — reviewtransaction.acquireMaintenanceLockInternal has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.explicitReviewingCompactCandidate (cyclomatic 18) · ×1
  • reviewtransaction.explicitReviewingCompactCandidate (cyclomatic 18) internal/reviewtransaction/target_status.go:684 — reviewtransaction.explicitReviewingCompactCandidate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · reviewtransaction.validateSnapshotKinds (cyclomatic 18) · ×1
  • reviewtransaction.validateSnapshotKinds (cyclomatic 18) internal/reviewtransaction/transaction.go:1194 — reviewtransaction.validateSnapshotKinds has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: reviewtransaction.pristineReviewing (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · authorityRepairBudget.readKind (cyclomatic 18) · ×1
  • authorityRepairBudget.readKind (cyclomatic 18) internal/reviewtransaction/authority_repair.go:625 — authorityRepairBudget.readKind has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validateClassifiedAuthorityRepairRequest (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Store.installBundle (cyclomatic 18) · ×1
  • Store.installBundle (cyclomatic 18) internal/reviewtransaction/bundle.go:241 — Store.installBundle has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userAcquireCodeGraphArchives (cyclomatic 18) · ×1
  • shellinstaller.userAcquireCodeGraphArchives (cyclomatic 18) internal/shellinstaller/user_codegraph_library_unix.go:77 — shellinstaller.userAcquireCodeGraphArchives has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userStageConfigFiles (cyclomatic 18) · ×1
  • shellinstaller.userStageConfigFiles (cyclomatic 18) internal/shellinstaller/user_experience_stage_unix.go:39 — shellinstaller.userStageConfigFiles has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userManagerVersion (cyclomatic 18) · ×1
  • shellinstaller.userManagerVersion (cyclomatic 18) REDACTED:153 — shellinstaller.userManagerVersion has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userNativeExecutionCheck (cyclomatic 18) · ×1
  • shellinstaller.userNativeExecutionCheck (cyclomatic 18) internal/shellinstaller/user_native_guard_linux.go:92 — shellinstaller.userNativeExecutionCheck has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.decodeNativeInstallation (cyclomatic 18) · ×1
  • shellinstaller.decodeNativeInstallation (cyclomatic 18) internal/shellinstaller/user_native_location_unix.go:37 — shellinstaller.decodeNativeInstallation has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.rootSystemService (cyclomatic 18) · ×1
  • shellinstaller.rootSystemService (cyclomatic 18) internal/shellinstaller/user_root_service_linux.go:36 — shellinstaller.rootSystemService has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsOverlayToMain (cyclomatic 18) · ×1
  • shellinstaller.userWindowsOverlayToMain (cyclomatic 18) internal/shellinstaller/user_channel_overlay_windows.go:158 — shellinstaller.userWindowsOverlayToMain has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsReuseComponents (cyclomatic 18) · ×1
  • shellinstaller.userWindowsReuseComponents (cyclomatic 18) internal/shellinstaller/user_install_scope_windows.go:88 — shellinstaller.userWindowsReuseComponents has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetry.normalizeRuntimeRows (cyclomatic 18) · ×1
  • telemetry.normalizeRuntimeRows (cyclomatic 18) internal/telemetry/runtime.go:340 — telemetry.normalizeRuntimeRows has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.renderUpgradeSyncResult (cyclomatic 18) · ×1
  • screens.renderUpgradeSyncResult (cyclomatic 18) internal/tui/screens/upgrade_sync.go:116 — screens.renderUpgradeSyncResult has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · styles.parseRose (cyclomatic 18) · ×1
  • styles.parseRose (cyclomatic 18) internal/tui/styles/rose.go:51 — styles.parseRose has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · update.detectHomebrewOwnershipWith (cyclomatic 18) · ×1
  • update.detectHomebrewOwnershipWith (cyclomatic 18) internal/update/homebrew.go:80 — update.detectHomebrewOwnershipWith has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RestoreService.restorePlain (cyclomatic 17) · ×1
  • RestoreService.restorePlain (cyclomatic 17) internal/backup/restore.go:461 — RestoreService.restorePlain has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunCodeGraph (cyclomatic 17) · ×1
  • cli.RunCodeGraph (cyclomatic 17) internal/cli/codegraph.go:28 — cli.RunCodeGraph has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cli.runRestoreWithHomeDir (cyclomatic 17) · ×1
  • cli.runRestoreWithHomeDir (cyclomatic 17) internal/cli/restore.go:65 — cli.runRestoreWithHomeDir has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.prepareCompactReviewerResults (cyclomatic 17) · ×1
  • cli.prepareCompactReviewerResults (cyclomatic 17) internal/cli/review_facade.go:3185 — cli.prepareCompactReviewerResults has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runReviewCommand (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.decodeOpenCodeTaskHostOutput (cyclomatic 17) · ×1
  • cli.decodeOpenCodeTaskHostOutput (cyclomatic 17) internal/cli/review_opencode_transport.go:738 — cli.decodeOpenCodeTaskHostOutput has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runTelemetryRuntimeInput (cyclomatic 17) · ×1
  • cli.runTelemetryRuntimeInput (cyclomatic 17) internal/cli/telemetry_runtime.go:76 — cli.runTelemetryRuntimeInput has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewTargetStatusResult.validateIntendedUntrackedSelectionTransition (cyclomatic 17) · ×1
  • ReviewTargetStatusResult.validateIntendedUntrackedSelectionTransition (cyclomatic 17) internal/cli/review_status_contract.go:982 — ReviewTargetStatusResult.validateIntendedUntrackedSelectionTransition has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ReviewTransitionSubmission.validateCorrectionPlan (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · openCodePluginDependencyPreflightStep.Run (cyclomatic 17) · ×1
  • openCodePluginDependencyPreflightStep.Run (cyclomatic 17) internal/cli/run.go:1699 — openCodePluginDependencyPreflightStep.Run has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codeGraphGuidanceSyncStep.Run (cyclomatic 17) · ×1
  • codeGraphGuidanceSyncStep.Run (cyclomatic 17) REDACTED:1359 — codeGraphGuidanceSyncStep.Run has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · agentguidance.resolveRoutingDelivery (cyclomatic 17) · ×1
  • agentguidance.resolveRoutingDelivery (cyclomatic 17) internal/components/agentguidance/inject.go:245 — agentguidance.resolveRoutingDelivery has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · communitytool.piChildTools (cyclomatic 17) · ×1
  • communitytool.piChildTools (cyclomatic 17) internal/components/communitytool/pi_codegraph.go:379 — communitytool.piChildTools has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · engram.DownloadLatestBinary (cyclomatic 17) · ×1
  • engram.DownloadLatestBinary (cyclomatic 17) REDACTED:146 — engram.DownloadLatestBinary has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · engram.removeManagedAntigravityGlobalEngram (cyclomatic 17) · ×1
  • engram.removeManagedAntigravityGlobalEngram (cyclomatic 17) internal/components/engram/inject.go:1671 — engram.removeManagedAntigravityGlobalEngram has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.stripJSONComments (cyclomatic 17) · ×1
  • filemerge.stripJSONComments (cyclomatic 17) REDACTED:554 — filemerge.stripJSONComments has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.trailingLineCommentStart (cyclomatic 17) · ×1
  • filemerge.trailingLineCommentStart (cyclomatic 17) REDACTED:850 — filemerge.trailingLineCommentStart has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.RemoveJSONCMembers (cyclomatic 17) · ×1
  • filemerge.RemoveJSONCMembers (cyclomatic 17) internal/components/filemerge/jsonc_members.go:17 — filemerge.RemoveJSONCMembers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gga.literalWord (cyclomatic 17) · ×1
  • gga.literalWord (cyclomatic 17) internal/components/gga/provider.go:43 — gga.literalWord has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.RetireOpenCodeSDDPrompts (cyclomatic 17) · ×1
  • legacyassets.RetireOpenCodeSDDPrompts (cyclomatic 17) internal/components/legacyassets/opencode_settings.go:481 — legacyassets.RetireOpenCodeSDDPrompts has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.removeSDDOrchestratorBlock (cyclomatic 17) · ×1
  • legacyassets.removeSDDOrchestratorBlock (cyclomatic 17) internal/components/legacyassets/sdd_runtime_files.go:131 — legacyassets.removeSDDOrchestratorBlock has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · UninstallPlan.Apply (cyclomatic 17) · ×1
  • UninstallPlan.Apply (cyclomatic 17) internal/components/opencodedefault/ownership.go:129 — UninstallPlan.Apply has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · persona.preflightJSONCAgentCleanup (cyclomatic 17) · ×1
  • persona.preflightJSONCAgentCleanup (cyclomatic 17) internal/components/persona/inject.go:812 — persona.preflightJSONCAgentCleanup has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewassets.renderNativeAgent (cyclomatic 17) · ×1
  • reviewassets.renderNativeAgent (cyclomatic 17) internal/components/reviewassets/install.go:231 — reviewassets.renderNativeAgent has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetryruntime.readClaudeFile (cyclomatic 17) · ×1
  • telemetryruntime.readClaudeFile (cyclomatic 17) internal/components/telemetryruntime/claude.go:63 — telemetryruntime.readClaudeFile has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · uninstall.stripJSONComments (cyclomatic 17) · ×1
  • uninstall.stripJSONComments (cyclomatic 17) internal/components/uninstall/cleaners.go:267 — uninstall.stripJSONComments has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.shellVariableName (cyclomatic 17) · ×1
  • opencode.shellVariableName (cyclomatic 17) internal/opencode/background_readiness.go:765 — opencode.shellVariableName has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.safeAdmissionLocation (cyclomatic 17) · ×1
  • reviewtransaction.safeAdmissionLocation (cyclomatic 17) internal/reviewtransaction/artifact_admission.go:213 — reviewtransaction.safeAdmissionLocation has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewtransaction.artifactRepositoryPathReference (cyclomatic 17) · ×1
  • reviewtransaction.artifactRepositoryPathReference (cyclomatic 17) internal/reviewtransaction/artifact_admission.go:982 — reviewtransaction.artifactRepositoryPathReference has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewtransaction.newArtifactSubjectIdentity (cyclomatic 17) · ×1
  • reviewtransaction.newArtifactSubjectIdentity (cyclomatic 17) internal/reviewtransaction/artifact_subject.go:78 — reviewtransaction.newArtifactSubjectIdentity has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reviewtransaction.discoverAuthorityDispositionRecord (cyclomatic 17) · ×1
  • reviewtransaction.discoverAuthorityDispositionRecord (cyclomatic 17) internal/reviewtransaction/authority_disposition_execute.go:528 — reviewtransaction.discoverAuthorityDispositionRecord has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactPostLifecycleState (cyclomatic 17) · ×1
  • reviewtransaction.validateCompactPostLifecycleState (cyclomatic 17) internal/reviewtransaction/compact.go:1008 — reviewtransaction.validateCompactPostLifecycleState has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validateCompactRecoveredCorrection (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · reviewtransaction.inspectHistoricalLegacyAlias (cyclomatic 17) · ×1
  • reviewtransaction.inspectHistoricalLegacyAlias (cyclomatic 17) internal/reviewtransaction/legacy_alias_repair.go:175 — reviewtransaction.inspectHistoricalLegacyAlias has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.publishPrivateRARImmutable (cyclomatic 17) · ×1
  • reviewtransaction.publishPrivateRARImmutable (cyclomatic 17) internal/reviewtransaction/rar_path_safety.go:309 — reviewtransaction.publishPrivateRARImmutable has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewtransaction.acquirePrivateRARLocalStoreLock (cyclomatic 17) · ×1
  • reviewtransaction.acquirePrivateRARLocalStoreLock (cyclomatic 17) internal/reviewtransaction/rar_path_safety.go:440 — reviewtransaction.acquirePrivateRARLocalStoreLock has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewtransaction.readRefuterProbeBatch (cyclomatic 17) · ×1
  • reviewtransaction.readRefuterProbeBatch (cyclomatic 17) internal/reviewtransaction/refuter_probe.go:114 — reviewtransaction.readRefuterProbeBatch has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.resolveSealedReviewRepositoryContextWith (cyclomatic 17) · ×1
  • reviewtransaction.resolveSealedReviewRepositoryContextWith (cyclomatic 17) internal/reviewtransaction/repository_context_seal.go:184 — reviewtransaction.resolveSealedReviewRepositoryContextWith has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewtransaction.resolveOpaqueReviewRepositoryContextRecord (cyclomatic 17) · ×1
  • reviewtransaction.resolveOpaqueReviewRepositoryContextRecord (cyclomatic 17) internal/reviewtransaction/repository_locator.go:519 — reviewtransaction.resolveOpaqueReviewRepositoryContextRecord has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · reviewtransaction.ValidateVerificationResultRef (cyclomatic 17) · ×1
  • reviewtransaction.ValidateVerificationResultRef (cyclomatic 17) internal/reviewtransaction/verification_contract.go:649 — reviewtransaction.ValidateVerificationResultRef has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactState.ActiveAdmittedLensResult (cyclomatic 17) · ×1
  • CompactState.ActiveAdmittedLensResult (cyclomatic 17) internal/reviewtransaction/compact.go:1361 — CompactState.ActiveAdmittedLensResult has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validateCompactRecoveredCorrection (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SnapshotBuilder.buildHeadWithIntended (cyclomatic 17) · ×1
  • SnapshotBuilder.buildHeadWithIntended (cyclomatic 17) internal/reviewtransaction/snapshot.go:277 — SnapshotBuilder.buildHeadWithIntended has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store.loadChain (cyclomatic 17) · ×1
  • Store.loadChain (cyclomatic 17) internal/reviewtransaction/store.go:360 — Store.loadChain has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validInitialStoreRecord (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · VerificationPlan.validateStructure (cyclomatic 17) · ×1
  • VerificationPlan.validateStructure (cyclomatic 17) internal/reviewtransaction/verification_contract.go:521 — VerificationPlan.validateStructure has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userUnixOverlayRebindManifest (cyclomatic 17) · ×1
  • shellinstaller.userUnixOverlayRebindManifest (cyclomatic 17) internal/shellinstaller/user_channel_overlay_unix.go:343 — shellinstaller.userUnixOverlayRebindManifest has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · shellinstaller.userReadNativeReceipt (cyclomatic 17) · ×1
  • shellinstaller.userReadNativeReceipt (cyclomatic 17) internal/shellinstaller/user_native_receipt_linux.go:40 — shellinstaller.userReadNativeReceipt has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userPNPMSyncTree (cyclomatic 17) · ×1
  • shellinstaller.userPNPMSyncTree (cyclomatic 17) internal/shellinstaller/user_pnpm_sync_tree_linux.go:17 — shellinstaller.userPNPMSyncTree has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 33, 22). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · shellinstaller.privateACL (cyclomatic 17) · ×1
  • shellinstaller.privateACL (cyclomatic 17) REDACTED:231 — shellinstaller.privateACL has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · telemetry.NormalizeClaude (cyclomatic 17) · ×1
  • telemetry.NormalizeClaude (cyclomatic 17) internal/telemetry/runtime_claude.go:253 — telemetry.NormalizeClaude has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · Storage.RunDailyRollup (cyclomatic 17) · ×1
  • Storage.RunDailyRollup (cyclomatic 17) internal/telemetrycollector/rollup.go:105 — Storage.RunDailyRollup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.renderCustomPhaseList (cyclomatic 17) · ×1
  • screens.renderCustomPhaseList (cyclomatic 17) internal/tui/screens/claude_model_picker.go:422 — screens.renderCustomPhaseList has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.RenderInstalling (cyclomatic 17) · ×1
  • screens.RenderInstalling (cyclomatic 17) internal/tui/screens/installing.go:24 — screens.RenderInstalling has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.handleModelNav (cyclomatic 17) · ×1
  • screens.handleModelNav (cyclomatic 17) internal/tui/screens/model_picker.go:386 — screens.handleModelNav has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.shellExperienceRecommendation (cyclomatic 17) · ×1
  • screens.shellExperienceRecommendation (cyclomatic 17) internal/tui/screens/shell_experience_advice.go:5 — screens.shellExperienceRecommendation has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · screens.RenderShellManage (cyclomatic 17) · ×1
  • screens.RenderShellManage (cyclomatic 17) internal/tui/screens/shell_manage.go:17 — screens.RenderShellManage has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.RenderUninstallConfirm (cyclomatic 17) · ×1
  • screens.RenderUninstallConfirm (cyclomatic 17) internal/tui/screens/uninstall.go:223 — screens.RenderUninstallConfirm has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · screens.renderShellWelcomeMinimum (cyclomatic 17) · ×1
  • screens.renderShellWelcomeMinimum (cyclomatic 17) internal/tui/screens/welcome.go:198 — screens.renderShellWelcomeMinimum has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · windowsCompatibilityDirectoryWriter.Write (cyclomatic 17) · ×1
  • windowsCompatibilityDirectoryWriter.Write (cyclomatic 17) REDACTED:249 — windowsCompatibilityDirectoryWriter.Write has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · pi.selectPackageBin (cyclomatic 16) · ×1
  • pi.selectPackageBin (cyclomatic 16) internal/agents/pi/model_routing.go:124 — pi.selectPackageBin has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.applyOverrides (cyclomatic 16) · ×1
  • app.applyOverrides (cyclomatic 16) internal/app/app.go:909 — app.applyOverrides 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.
D1 · Cyclomatic Complexity · cli.excludeCodeGraphIndexLocally (cyclomatic 16) · ×1
  • cli.excludeCodeGraphIndexLocally (cyclomatic 16) internal/cli/codegraph.go:58 — cli.excludeCodeGraphIndexLocally 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.
D1 · Cyclomatic Complexity · cli.openCodeSDKShimManagerFromPath (cyclomatic 16) · ×1
  • cli.openCodeSDKShimManagerFromPath (cyclomatic 16) internal/cli/opencode_sdk_manager.go:74 — cli.openCodeSDKShimManagerFromPath has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · cli.RunReviewBundleExport (cyclomatic 16) · ×1
  • cli.RunReviewBundleExport (cyclomatic 16) internal/cli/review.go:498 — cli.RunReviewBundleExport has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.reviewMissingCaptureTransition (cyclomatic 16) · ×1
  • cli.reviewMissingCaptureTransition (cyclomatic 16) internal/cli/review_next_transition.go:633 — cli.reviewMissingCaptureTransition has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.reviewReasonDescription (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.safeReviewIntegrationArguments (cyclomatic 16) · ×1
  • cli.safeReviewIntegrationArguments (cyclomatic 16) internal/cli/review_operation_contract.go:1278 — cli.safeReviewIntegrationArguments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.SplitPrintedCommandWords (cyclomatic 16) · ×1
  • cli.SplitPrintedCommandWords (cyclomatic 16) internal/cli/review_printed_command.go:22 — cli.SplitPrintedCommandWords has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.openCodePluginPackageManager (cyclomatic 16) · ×1
  • cli.openCodePluginPackageManager (cyclomatic 16) internal/cli/run.go:1925 — cli.openCodePluginPackageManager has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.RunShellInstallInline (cyclomatic 16) · ×1
  • cli.RunShellInstallInline (cyclomatic 16) internal/cli/shell_install.go:151 — cli.RunShellInstallInline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.restoreSyncFiles (cyclomatic 16) · ×1
  • cli.restoreSyncFiles (cyclomatic 16) REDACTED:1816 — cli.restoreSyncFiles has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · prepareBackupStep.Run (cyclomatic 16) · ×1
  • prepareBackupStep.Run (cyclomatic 16) internal/cli/run.go:2849 — prepareBackupStep.Run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · engram.fetchLatestEngramVersionWithAssets (cyclomatic 16) · ×1
  • engram.fetchLatestEngramVersionWithAssets (cyclomatic 16) REDACTED:368 — engram.fetchLatestEngramVersionWithAssets has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filemerge.stripTrailingCommas (cyclomatic 16) · ×1
  • filemerge.stripTrailingCommas (cyclomatic 16) REDACTED:622 — filemerge.stripTrailingCommas has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacyassets.retirePromptText (cyclomatic 16) · ×1
  • legacyassets.retirePromptText (cyclomatic 16) internal/components/legacyassets/sdd_runtime_files.go:183 — legacyassets.retirePromptText 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.
D1 · Cyclomatic Complexity · persona.removeJSONNestedSubKey (cyclomatic 16) · ×1
  • persona.removeJSONNestedSubKey (cyclomatic 16) internal/components/persona/inject.go:1096 — persona.removeJSONNestedSubKey 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.
D1 · Cyclomatic Complexity · uninstall.stripTrailingCommas (cyclomatic 16) · ×1
  • uninstall.stripTrailingCommas (cyclomatic 16) internal/components/uninstall/cleaners.go:335 — uninstall.stripTrailingCommas has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · opencode.validSemVerIdentifiers (cyclomatic 16) · ×1
  • opencode.validSemVerIdentifiers (cyclomatic 16) internal/opencode/background.go:134 — opencode.validSemVerIdentifiers has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · opencode.overlayConfiguredAssignments (cyclomatic 16) · ×1
  • opencode.overlayConfiguredAssignments (cyclomatic 16) internal/opencode/config_v2.go:118 — opencode.overlayConfiguredAssignments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.AcknowledgedBoundaryCommit (cyclomatic 16) · ×1
  • reviewtransaction.AcknowledgedBoundaryCommit (cyclomatic 16) internal/reviewtransaction/acknowledged_predecessor.go:58 — reviewtransaction.AcknowledgedBoundaryCommit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.rejectedValidatorDispositionPlanForSelector (cyclomatic 16) · ×1
  • reviewtransaction.rejectedValidatorDispositionPlanForSelector (cyclomatic 16) internal/reviewtransaction/authority_disposition_plan.go:80 — reviewtransaction.rejectedValidatorDispositionPlanForSelector 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.
D1 · Cyclomatic Complexity · reviewtransaction.scanLegacyAuthorityRepairOnce (cyclomatic 16) · ×1
  • reviewtransaction.scanLegacyAuthorityRepairOnce (cyclomatic 16) internal/reviewtransaction/authority_repair.go:492 — reviewtransaction.scanLegacyAuthorityRepairOnce has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validateClassifiedAuthorityRepairRequest (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · reviewtransaction.validateCompactReviewInput (cyclomatic 16) · ×1
  • reviewtransaction.validateCompactReviewInput (cyclomatic 16) internal/reviewtransaction/compact.go:1797 — reviewtransaction.validateCompactReviewInput has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validateCompactRecoveredCorrection (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · reviewtransaction.inspectCompactRecoveryRecordSet (cyclomatic 16) · ×1
  • reviewtransaction.inspectCompactRecoveryRecordSet (cyclomatic 16) internal/reviewtransaction/compact_inspect.go:372 — reviewtransaction.inspectCompactRecoveryRecordSet has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.parseCompactRecord (cyclomatic 16) · ×1
  • reviewtransaction.parseCompactRecord (cyclomatic 16) internal/reviewtransaction/compact_store.go:1929 — reviewtransaction.parseCompactRecord has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.forensicHistoricalCompactRecord (cyclomatic 16) · ×1
  • reviewtransaction.forensicHistoricalCompactRecord (cyclomatic 16) internal/reviewtransaction/compact_store.go:2002 — reviewtransaction.forensicHistoricalCompactRecord has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.replayCommittedLegacyAliasRepair (cyclomatic 16) · ×1
  • reviewtransaction.replayCommittedLegacyAliasRepair (cyclomatic 16) internal/reviewtransaction/legacy_alias_repair.go:262 — reviewtransaction.replayCommittedLegacyAliasRepair has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reviewtransaction.repairPrivateRARDirectoryNoFollow (cyclomatic 16) · ×1
  • reviewtransaction.repairPrivateRARDirectoryNoFollow (cyclomatic 16) internal/reviewtransaction/rar_path_safety_unix.go:38 — reviewtransaction.repairPrivateRARDirectoryNoFollow 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.
D1 · Cyclomatic Complexity · reviewtransaction.readReviewRepositoryControlPayload (cyclomatic 16) · ×1
  • reviewtransaction.readReviewRepositoryControlPayload (cyclomatic 16) internal/reviewtransaction/repository_locator.go:881 — reviewtransaction.readReviewRepositoryControlPayload 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.
D1 · Cyclomatic Complexity · reviewtransaction.inventoryLock (cyclomatic 16) · ×1
  • reviewtransaction.inventoryLock (cyclomatic 16) internal/reviewtransaction/status.go:403 — reviewtransaction.inventoryLock has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D1 · Cyclomatic Complexity · reviewtransaction.selectorlessCommittedBaseDiffCorrections (cyclomatic 16) · ×1
  • reviewtransaction.selectorlessCommittedBaseDiffCorrections (cyclomatic 16) internal/reviewtransaction/target_status.go:354 — reviewtransaction.selectorlessCommittedBaseDiffCorrections has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · authorityRepairScan.run (cyclomatic 16) · ×1
  • authorityRepairScan.run (cyclomatic 16) internal/reviewtransaction/authority_repair.go:205 — authorityRepairScan.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: reviewtransaction.validateClassifiedAuthorityRepairRequest (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · Transaction.CompleteFix (cyclomatic 16) · ×1
  • Transaction.CompleteFix (cyclomatic 16) internal/reviewtransaction/transaction.go:711 — Transaction.CompleteFix 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. This is NOT this file's highest cyclomatic complexity: reviewtransaction.pristineReviewing (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · shellinstaller.userSetAsideAgentTools (cyclomatic 16) · ×1
  • shellinstaller.userSetAsideAgentTools (cyclomatic 16) internal/shellinstaller/user_agent_tools_unix.go:123 — shellinstaller.userSetAsideAgentTools has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: shellinstaller.userReadAgentToolsRecord (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · shellinstaller.userExperienceSupported (cyclomatic 16) · ×1
  • shellinstaller.userExperienceSupported (cyclomatic 16) internal/shellinstaller/user_experience_selection.go:126 — shellinstaller.userExperienceSupported has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userPruneRemovedBackup (cyclomatic 16) · ×1
  • shellinstaller.userPruneRemovedBackup (cyclomatic 16) internal/shellinstaller/user_install_cleanup_unix.go:89 — shellinstaller.userPruneRemovedBackup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userRecordUnit (cyclomatic 16) · ×1
  • shellinstaller.userRecordUnit (cyclomatic 16) REDACTED:313 — shellinstaller.userRecordUnit 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.
D1 · Cyclomatic Complexity · shellinstaller.userReuseSDKState (cyclomatic 16) · ×1
  • shellinstaller.userReuseSDKState (cyclomatic 16) internal/shellinstaller/user_install_scope_unix.go:179 — shellinstaller.userReuseSDKState has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userCompareMainSourceCached (cyclomatic 16) · ×1
  • shellinstaller.userCompareMainSourceCached (cyclomatic 16) internal/shellinstaller/user_main_source_cache_unix.go:44 — shellinstaller.userCompareMainSourceCached has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsAcquireNetwork (cyclomatic 16) · ×1
  • shellinstaller.userWindowsAcquireNetwork (cyclomatic 16) internal/shellinstaller/user_artifacts_windows.go:189 — shellinstaller.userWindowsAcquireNetwork has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsZIP (cyclomatic 16) · ×1
  • shellinstaller.userWindowsZIP (cyclomatic 16) internal/shellinstaller/user_artifacts_windows.go:228 — shellinstaller.userWindowsZIP has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsPruneRemovedBackup (cyclomatic 16) · ×1
  • shellinstaller.userWindowsPruneRemovedBackup (cyclomatic 16) internal/shellinstaller/user_install_cleanup_windows.go:67 — shellinstaller.userWindowsPruneRemovedBackup has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shellinstaller.userWindowsJobQuiesce (cyclomatic 16) · ×1
  • shellinstaller.userWindowsJobQuiesce (cyclomatic 16) REDACTED:196 — shellinstaller.userWindowsJobQuiesce has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · userNativeSlice.read (cyclomatic 16) · ×1
  • userNativeSlice.read (cyclomatic 16) internal/shellinstaller/user_native_slice_linux.go:155 — userNativeSlice.read 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.
D1 · Cyclomatic Complexity · telemetry.ParseClaudeTranscriptTail (cyclomatic 16) · ×1
  • telemetry.ParseClaudeTranscriptTail (cyclomatic 16) internal/telemetry/runtime_claude.go:166 — telemetry.ParseClaudeTranscriptTail has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · telemetry.ResolveCodexAgentType (cyclomatic 16) · ×1
  • telemetry.ResolveCodexAgentType (cyclomatic 16) internal/telemetry/runtime_codex.go:131 — telemetry.ResolveCodexAgentType 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.
D1 · Cyclomatic Complexity · telemetry.codexTranscriptEvidence (cyclomatic 16) · ×1
  • telemetry.codexTranscriptEvidence (cyclomatic 16) internal/telemetry/runtime_codex.go:235 — telemetry.codexTranscriptEvidence has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.RenderDetection (cyclomatic 16) · ×1
  • screens.RenderDetection (cyclomatic 16) internal/tui/screens/detection.go:17 — screens.RenderDetection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · screens.RenderUserInstallDestination (cyclomatic 16) · ×1
  • screens.RenderUserInstallDestination (cyclomatic 16) internal/tui/screens/user_install_destination.go:13 — screens.RenderUserInstallDestination has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · upgrade.Download (cyclomatic 16) · ×1
  • upgrade.Download (cyclomatic 16) internal/update/upgrade/download.go:92 — upgrade.Download 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.
D1 · Cyclomatic Complexity · opencode-review-transport.startRelay (cyclomatic 16) · ×1
  • opencode-review-transport.startRelay (cyclomatic 16) internal/assets/opencode/plugins/opencode-review-transport.ts:200 — opencode-review-transport.startRelay has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 219, 247, 250). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.runReviewStatus (cognitive 684) · ×1
  • cli.runReviewStatus (cognitive 684) internal/cli/review_facade.go:799 — cli.runReviewStatus has cognitive complexity 684 (threshold 15). Drivers by points: if/else 165 (583 pts), boolean chains 75, match/switch 2 (16 pts), loops 2 (10 pts) (nesting depth added 440). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Model.confirmSelection (cognitive 358) · ×1
  • Model.confirmSelection (cognitive 358) internal/tui/model.go:2100 — Model.confirmSelection has cognitive complexity 358 (threshold 15). Drivers by points: if/else 117 (284 pts), match/switch 17 (37 pts), boolean chains 26, loops 3 (11 pts) (nesting depth added 195). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Model.handleKeyPress (cognitive 238) · ×1
  • Model.handleKeyPress (cognitive 238) internal/tui/model.go:1672 — Model.handleKeyPress has cognitive complexity 238 (threshold 15). Drivers by points: if/else 81 (201 pts), boolean chains 18, loops 3 (14 pts), match/switch 3 (5 pts) (nesting depth added 133). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReviewNextTransition.Validate (cognitive 235) · ×1
  • ReviewNextTransition.Validate (cognitive 235) internal/cli/review_status_contract.go:1239 — ReviewNextTransition.Validate has cognitive complexity 235 (threshold 15). Drivers by points: if/else 50 (158 pts), boolean chains 51, loops 7 (21 pts), match/switch 2 (5 pts) (nesting depth added 125). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · componentApplyStep.Run (cognitive 220) · ×1
  • componentApplyStep.Run (cognitive 220) internal/cli/run.go:3343 — componentApplyStep.Run has cognitive complexity 220 (threshold 15). Drivers by points: if/else 68 (192 pts), loops 11 (24 pts), boolean chains 3, match/switch 1 (nesting depth added 137). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · persona.injectInternal (cognitive 204) · ×1
  • persona.injectInternal (cognitive 204) internal/components/persona/inject.go:125 — persona.injectInternal has cognitive complexity 204 (threshold 15). Drivers by points: if/else 74 (174 pts), boolean chains 25, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 102). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.componentPathsWithWorkspaceScoped (cognitive 160) · ×1
  • cli.componentPathsWithWorkspaceScoped (cognitive 160) internal/cli/run.go:4341 — cli.componentPathsWithWorkspaceScoped has cognitive complexity 160 (threshold 15). Drivers by points: if/else 40 (138 pts), loops 4 (10 pts), match/switch 3 (8 pts), boolean chains 4 (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userRunInstall (cognitive 155) · ×1
  • shellinstaller.userRunInstall (cognitive 155) internal/shellinstaller/user_install_flow_unix.go:218 — shellinstaller.userRunInstall has cognitive complexity 155 (threshold 15). Drivers by points: if/else 96 (138 pts), boolean chains 15, loops 1 (2 pts) (nesting depth added 43). Of this number, 153 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.syncBackupTargetsScoped (cognitive 144) · ×1
  • cli.syncBackupTargetsScoped (cognitive 144) REDACTED:712 — cli.syncBackupTargetsScoped has cognitive complexity 144 (threshold 15). Drivers by points: if/else 35 (81 pts), loops 30 (56 pts), boolean chains 7 (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewTargetStatusResult.validateWithCompactAuthority (cognitive 129) · ×1
  • ReviewTargetStatusResult.validateWithCompactAuthority (cognitive 129) internal/cli/review_status_contract.go:363 — ReviewTargetStatusResult.validateWithCompactAuthority has cognitive complexity 129 (threshold 15). Drivers by points: if/else 44 (79 pts), boolean chains 41, match/switch 6 (9 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.buildPlan (cognitive 129) · ×1
  • Service.buildPlan (cognitive 129) internal/components/uninstall/service.go:431 — Service.buildPlan has cognitive complexity 129 (threshold 15). Drivers by points: if/else 30 (67 pts), loops 24 (51 pts), boolean chains 8, match/switch 1 (3 pts) (nesting depth added 66). Of this number, 125 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.installBackupTargets (cognitive 117) · ×1
  • cli.installBackupTargets (cognitive 117) internal/cli/run.go:4066 — cli.installBackupTargets has cognitive complexity 117 (threshold 15). Drivers by points: if/else 27 (63 pts), loops 26 (51 pts), boolean chains 3 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.configureShellExperience (cognitive 115) · ×1
  • Model.configureShellExperience (cognitive 115) internal/tui/shell_experience.go:134 — Model.configureShellExperience has cognitive complexity 115 (threshold 15). Drivers by points: if/else 41 (97 pts), boolean chains 11, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.Update (cognitive 112) · ×1
  • Model.Update (cognitive 112) internal/tui/model.go:1068 — Model.Update has cognitive complexity 112 (threshold 15). Drivers by points: if/else 43 (91 pts), boolean chains 16, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewCaptureResult (cognitive 110) · ×1
  • cli.RunReviewCaptureResult (cognitive 110) internal/cli/review_artifact.go:143 — cli.RunReviewCaptureResult has cognitive complexity 110 (threshold 15). Drivers by points: if/else 55 (94 pts), boolean chains 16 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewRecover (cognitive 110) · ×1
  • cli.RunReviewRecover (cognitive 110) internal/cli/review_facade.go:1880 — cli.RunReviewRecover has cognitive complexity 110 (threshold 15). Drivers by points: if/else 55 (72 pts), boolean chains 35, match/switch 2 (3 pts) (nesting depth added 18). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CompactState.CompactReviewView (cognitive 107) · ×1
  • CompactState.CompactReviewView (cognitive 107) internal/reviewtransaction/compact.go:1188 — CompactState.CompactReviewView has cognitive complexity 107 (threshold 15). Drivers by points: if/else 28 (71 pts), boolean chains 24, loops 6 (8 pts), match/switch 2 (4 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runReviewFacadeStart (cognitive 106) · ×1
  • cli.runReviewFacadeStart (cognitive 106) internal/cli/review_facade.go:2386 — cli.runReviewFacadeStart has cognitive complexity 106 (threshold 15). Drivers by points: if/else 66 (92 pts), boolean chains 14 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.validateReviewTransitionExecution (cognitive 106) · ×1
  • cli.validateReviewTransitionExecution (cognitive 106) internal/cli/review_status_contract.go:1671 — cli.validateReviewTransitionExecution has cognitive complexity 106 (threshold 15). Drivers by points: if/else 24 (52 pts), boolean chains 36, loops 8 (14 pts), match/switch 2 (4 pts) (nesting depth added 36). Of this number, 97 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewIntegrationStartResult.Validate (cognitive 104) · ×1
  • ReviewIntegrationStartResult.Validate (cognitive 104) internal/cli/review_start_contract.go:176 — ReviewIntegrationStartResult.Validate has cognitive complexity 104 (threshold 15). Drivers by points: if/else 38 (57 pts), boolean chains 40, match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateSuccessor (cognitive 102) · ×1
  • reviewtransaction.validateSuccessor (cognitive 102) internal/reviewtransaction/store.go:474 — reviewtransaction.validateSuccessor has cognitive complexity 102 (threshold 15). Drivers by points: if/else 48 (63 pts), boolean chains 39 (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.resolveReviewNextTransition (cognitive 101) · ×1
  • cli.resolveReviewNextTransition (cognitive 101) internal/cli/review_next_transition.go:223 — cli.resolveReviewNextTransition has cognitive complexity 101 (threshold 15). Drivers by points: if/else 35 (80 pts), boolean chains 18, match/switch 2 (3 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.assessTargetStatusSnapshot (cognitive 101) · ×1
  • reviewtransaction.assessTargetStatusSnapshot (cognitive 101) internal/reviewtransaction/target_status.go:429 — reviewtransaction.assessTargetStatusSnapshot has cognitive complexity 101 (threshold 15). Drivers by points: if/else 34 (70 pts), boolean chains 21, loops 4 (6 pts), match/switch 2 (4 pts) (nesting depth added 40). Of this number, 100 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.injectWithOptions (cognitive 100) · ×1
  • engram.injectWithOptions (cognitive 100) internal/components/engram/inject.go:748 — engram.injectWithOptions has cognitive complexity 100 (threshold 15). Drivers by points: if/else 39 (83 pts), boolean chains 14, match/switch 2 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewTargetStatusResult.validateNextTransitionTargets (cognitive 99) · ×1
  • ReviewTargetStatusResult.validateNextTransitionTargets (cognitive 99) internal/cli/review_status_contract.go:802 — ReviewTargetStatusResult.validateNextTransitionTargets has cognitive complexity 99 (threshold 15). Drivers by points: if/else 32 (68 pts), boolean chains 25, match/switch 2 (5 pts), loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · componentSyncStep.Run (cognitive 98) · ×1
  • componentSyncStep.Run (cognitive 98) REDACTED:1468 — componentSyncStep.Run has cognitive complexity 98 (threshold 15). Drivers by points: if/else 33 (79 pts), loops 8 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewRepairResult.Validate (cognitive 93) · ×1
  • ReviewRepairResult.Validate (cognitive 93) internal/cli/review_repair.go:112 — ReviewRepairResult.Validate has cognitive complexity 93 (threshold 15). Drivers by points: if/else 23 (63 pts), boolean chains 20, loops 2 (7 pts), match/switch 2 (3 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewTargetStatusResult.validateSubmissionDescriptors (cognitive 93) · ×1
  • ReviewTargetStatusResult.validateSubmissionDescriptors (cognitive 93) internal/cli/review_status_contract.go:578 — ReviewTargetStatusResult.validateSubmissionDescriptors has cognitive complexity 93 (threshold 15). Drivers by points: if/else 31 (71 pts), boolean chains 10, loops 5 (8 pts), match/switch 2 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newReviewIntegrationFailure (cognitive 88) · ×1
  • cli.newReviewIntegrationFailure (cognitive 88) internal/cli/review_operation_contract.go:660 — cli.newReviewIntegrationFailure has cognitive complexity 88 (threshold 15). Drivers by points: if/else 48 (76 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.validateFindingState (cognitive 84) · ×1
  • Transaction.validateFindingState (cognitive 84) internal/reviewtransaction/transaction.go:1508 — Transaction.validateFindingState has cognitive complexity 84 (threshold 15). Drivers by points: if/else 28 (59 pts), boolean chains 17, loops 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.AdmitArtifact (cognitive 82) · ×1
  • reviewtransaction.AdmitArtifact (cognitive 82) internal/reviewtransaction/artifact_admission.go:404 — reviewtransaction.AdmitArtifact has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (63 pts), loops 7 (9 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactState.Validate (cognitive 81) · ×1
  • CompactState.Validate (cognitive 81) internal/reviewtransaction/compact.go:834 — CompactState.Validate has cognitive complexity 81 (threshold 15). Drivers by points: if/else 47 (60 pts), boolean chains 19, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · app.RunArgs (cognitive 80) · ×1
  • app.RunArgs (cognitive 80) internal/app/app.go:91 — app.RunArgs has cognitive complexity 80 (threshold 15). Drivers by points: if/else 35 (66 pts), boolean chains 11, match/switch 2 (3 pts) (nesting depth added 32). Of this number, 79 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunSync (cognitive 80) · ×1
  • cli.RunSync (cognitive 80) REDACTED:2281 — cli.RunSync has cognitive complexity 80 (threshold 15). Drivers by points: if/else 35 (55 pts), boolean chains 13, loops 6 (12 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewIntegrationFailure.Validate (cognitive 80) · ×1
  • ReviewIntegrationFailure.Validate (cognitive 80) internal/cli/review_operation_contract.go:1429 — ReviewIntegrationFailure.Validate has cognitive complexity 80 (threshold 15). Drivers by points: if/else 24 (42 pts), boolean chains 30, loops 2 (4 pts), match/switch 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactCorrection (cognitive 80) · ×1
  • reviewtransaction.validateCompactCorrection (cognitive 80) internal/reviewtransaction/compact.go:1629 — reviewtransaction.validateCompactCorrection has cognitive complexity 80 (threshold 15). Drivers by points: if/else 29 (52 pts), boolean chains 26, loops 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentRoutingGuidanceStep.Run (cognitive 78) · ×1
  • agentRoutingGuidanceStep.Run (cognitive 78) internal/cli/run.go:2046 — agentRoutingGuidanceStep.Run has cognitive complexity 78 (threshold 15). Drivers by points: if/else 42 (64 pts), boolean chains 14 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.append (cognitive 77) · ×1
  • Store.append (cognitive 77) internal/reviewtransaction/store.go:178 — Store.append has cognitive complexity 77 (threshold 15). Drivers by points: if/else 42 (72 pts), boolean chains 5 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.goBack (cognitive 77) · ×1
  • Model.goBack (cognitive 77) internal/tui/model.go:3685 — Model.goBack has cognitive complexity 77 (threshold 15). Drivers by points: if/else 45 (65 pts), boolean chains 8, match/switch 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runPostSyncVerificationWithState (cognitive 75) · ×1
  • cli.runPostSyncVerificationWithState (cognitive 75) REDACTED:2742 — cli.runPostSyncVerificationWithState has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (56 pts), loops 6 (13 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 45). Of this number, 54 points are the body's own statements and 21 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runReviewRepair (cognitive 74) · ×1
  • cli.runReviewRepair (cognitive 74) internal/cli/review_repair.go:259 — cli.runReviewRepair has cognitive complexity 74 (threshold 15). Drivers by points: if/else 37 (60 pts), boolean chains 9, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactRecoveryEdge (cognitive 74) · ×1
  • reviewtransaction.validateCompactRecoveryEdge (cognitive 74) internal/reviewtransaction/compact_store.go:581 — reviewtransaction.validateCompactRecoveryEdge has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (59 pts), boolean chains 12, match/switch 2 (3 pts) (nesting depth added 36). Of this number, 73 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.componentOperations (cognitive 72) · ×1
  • Service.componentOperations (cognitive 72) internal/components/uninstall/service.go:1147 — Service.componentOperations has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (46 pts), loops 8 (17 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 36). Of this number, 71 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.validate (cognitive 68) · ×1
  • Transaction.validate (cognitive 68) internal/reviewtransaction/transaction.go:969 — Transaction.validate has cognitive complexity 68 (threshold 15). Drivers by points: if/else 37 (48 pts), boolean chains 17, loops 2, match/switch 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · communitytool.InstallWithOptions (cognitive 66) · ×1
  • communitytool.InstallWithOptions (cognitive 66) internal/components/communitytool/tool.go:148 — communitytool.InstallWithOptions has cognitive complexity 66 (threshold 15). Drivers by points: if/else 33 (51 pts), boolean chains 11, loops 2 (3 pts), match/switch 1 (nesting depth added 19). Of this number, 64 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.ReadYAMLMCPServerCommand (cognitive 66) · ×1
  • filemerge.ReadYAMLMCPServerCommand (cognitive 66) internal/components/filemerge/yaml.go:301 — filemerge.ReadYAMLMCPServerCommand has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 10, loops 5 (7 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · reviewtransaction.validateCompactSuccessor (cognitive 66) · ×1
  • reviewtransaction.validateCompactSuccessor (cognitive 66) internal/reviewtransaction/compact_store.go:1727 — reviewtransaction.validateCompactSuccessor has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 23, match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.updateShellInstallRun (cognitive 66) · ×1
  • Model.updateShellInstallRun (cognitive 66) internal/tui/shell_install.go:698 — Model.updateShellInstallRun has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 2 (7 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · reviewtransaction.RecoverCompactAuthority (cognitive 64) · ×1
  • reviewtransaction.RecoverCompactAuthority (cognitive 64) internal/reviewtransaction/compact_store.go:319 — reviewtransaction.RecoverCompactAuthority has cognitive complexity 64 (threshold 15). Drivers by points: if/else 40 (50 pts), boolean chains 13, loops 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · communitytool.ReconcilePiCodeGraph (cognitive 63) · ×1
  • communitytool.ReconcilePiCodeGraph (cognitive 63) internal/components/communitytool/pi_codegraph.go:196 — communitytool.ReconcilePiCodeGraph has cognitive complexity 63 (threshold 15). Drivers by points: if/else 33 (55 pts), boolean chains 6, loops 2 (nesting depth added 22). Of this number, 60 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.executePlan (cognitive 62) · ×1
  • Service.executePlan (cognitive 62) internal/components/uninstall/service.go:659 — Service.executePlan has cognitive complexity 62 (threshold 15). Drivers by points: if/else 32 (56 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.overlayConfiguredProviders (cognitive 62) · ×1
  • opencode.overlayConfiguredProviders (cognitive 62) internal/opencode/config_v2.go:18 — opencode.overlayConfiguredProviders has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (50 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactState.EscalationEvidence (cognitive 62) · ×1
  • CompactState.EscalationEvidence (cognitive 62) internal/reviewtransaction/compact_reviewer_capture.go:68 — CompactState.EscalationEvidence has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (53 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SnapshotBuilder.processBoundaryRiskReasons (cognitive 62) · ×1
  • SnapshotBuilder.processBoundaryRiskReasons (cognitive 62) internal/reviewtransaction/risk.go:649 — SnapshotBuilder.processBoundaryRiskReasons has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 8 (14 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.StageNativePNPMInstallation (cognitive 62) · ×1
  • shellinstaller.StageNativePNPMInstallation (cognitive 62) REDACTED:28 — shellinstaller.StageNativePNPMInstallation has cognitive complexity 62 (threshold 15). Drivers by points: if/else 30 (55 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 26). Of this number, 17 points are the body's own statements and 45 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · releasepolicy.validateArtifacts (cognitive 60) · ×1
  • releasepolicy.validateArtifacts (cognitive 60) internal/releasepolicy/policy.go:303 — releasepolicy.validateArtifacts has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 11, loops 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotBuilder.buildCurrentChanges (cognitive 59) · ×1
  • SnapshotBuilder.buildCurrentChanges (cognitive 59) internal/reviewtransaction/snapshot.go:1193 — SnapshotBuilder.buildCurrentChanges has cognitive complexity 59 (threshold 15). Drivers by points: if/else 32 (52 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.RemoveLegacyOpenCodeAgentMarkers (cognitive 58) · ×1
  • filemerge.RemoveLegacyOpenCodeAgentMarkers (cognitive 58) REDACTED:372 — filemerge.RemoveLegacyOpenCodeAgentMarkers has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 7 (13 pts), boolean chains 8 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewassets.InstallNativeAgents (cognitive 58) · ×1
  • reviewassets.InstallNativeAgents (cognitive 58) internal/components/reviewassets/install.go:89 — reviewassets.InstallNativeAgents has cognitive complexity 58 (threshold 15). Drivers by points: if/else 26 (45 pts), boolean chains 8, loops 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.loadCompactTargetStatusCandidates (cognitive 58) · ×1
  • reviewtransaction.loadCompactTargetStatusCandidates (cognitive 58) internal/reviewtransaction/target_status_projection.go:35 — reviewtransaction.loadCompactTargetStatusCandidates has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (48 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotBuilder.build (cognitive 57) · ×1
  • SnapshotBuilder.build (cognitive 57) internal/reviewtransaction/snapshot.go:149 — SnapshotBuilder.build has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (46 pts), boolean chains 10, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userValidateInstall (cognitive 55) · ×1
  • shellinstaller.userValidateInstall (cognitive 55) internal/shellinstaller/user_install_flow_unix.go:48 — shellinstaller.userValidateInstall has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 14, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RestoreService.restoreCompressed (cognitive 54) · ×1
  • RestoreService.restoreCompressed (cognitive 54) internal/backup/restore.go:340 — RestoreService.restoreCompressed has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (45 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.topLevelJSONCPropertyValueRange (cognitive 54) · ×1
  • filemerge.topLevelJSONCPropertyValueRange (cognitive 54) REDACTED:908 — filemerge.topLevelJSONCPropertyValueRange has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 7, loops 2 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userAgentPreflight (cognitive 54) · ×1
  • shellinstaller.userAgentPreflight (cognitive 54) internal/shellinstaller/user_shell_agent_unix.go:41 — shellinstaller.userAgentPreflight has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 9, loops 1 (3 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · filemerge.topLevelJSONCKeyCount (cognitive 51) · ×1
  • filemerge.topLevelJSONCKeyCount (cognitive 51) REDACTED:679 — filemerge.topLevelJSONCKeyCount has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 8, loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · uninstall.removeOpenCodeFamilyAgents (cognitive 51) · ×1
  • uninstall.removeOpenCodeFamilyAgents (cognitive 51) internal/components/uninstall/opencode_agents.go:49 — uninstall.removeOpenCodeFamilyAgents has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 21). None of this is in the body itself: all 51 points belong to one function literal inside it that branches (line 51). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · filemerge.UpsertYAMLMCPServerBlock (cognitive 50) · ×1
  • filemerge.UpsertYAMLMCPServerBlock (cognitive 50) internal/components/filemerge/yaml.go:29 — filemerge.UpsertYAMLMCPServerBlock has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 5 (7 pts), boolean chains 6 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.lockedAuthorityDispositionMutation (cognitive 49) · ×1
  • reviewtransaction.lockedAuthorityDispositionMutation (cognitive 49) internal/reviewtransaction/authority_disposition_execute.go:178 — reviewtransaction.lockedAuthorityDispositionMutation has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (43 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.ensureRARDirectoryChain (cognitive 49) · ×1
  • reviewtransaction.ensureRARDirectoryChain (cognitive 49) internal/reviewtransaction/rar_path_safety.go:103 — reviewtransaction.ensureRARDirectoryChain has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (45 pts), boolean chains 3, loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · shellinstaller.userCodeGraphReadbackWithNode (cognitive 49) · ×1
  • shellinstaller.userCodeGraphReadbackWithNode (cognitive 49) internal/shellinstaller/user_codegraph_admission_unix.go:21 — shellinstaller.userCodeGraphReadbackWithNode has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 8 (11 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.validateFindingRouting (cognitive 48) · ×1
  • Transaction.validateFindingRouting (cognitive 48) internal/reviewtransaction/transaction.go:1422 — Transaction.validateFindingRouting has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 8, loops 5, match/switch 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userNativeMountsData (cognitive 48) · ×1
  • shellinstaller.userNativeMountsData (cognitive 48) internal/shellinstaller/user_native_guard_linux.go:136 — shellinstaller.userNativeMountsData has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 7, loops 5 (6 pts) (nesting depth added 18). Of this number, 39 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runReviewInspectCandidate (cognitive 47) · ×1
  • cli.runReviewInspectCandidate (cognitive 47) internal/cli/review_inspect_candidate.go:55 — cli.runReviewInspectCandidate has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 10, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellInstallModel.Update (cognitive 47) · ×1
  • shellInstallModel.Update (cognitive 47) internal/cli/shell_install_model_other.go:45 — shellInstallModel.Update has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uninstall.removeSkillRegistryHook (cognitive 47) · ×1
  • uninstall.removeSkillRegistryHook (cognitive 47) internal/components/uninstall/service.go:1725 — uninstall.removeSkillRegistryHook has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (38 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.markCompactGraph (cognitive 47) · ×1
  • reviewtransaction.markCompactGraph (cognitive 47) internal/reviewtransaction/status.go:463 — reviewtransaction.markCompactGraph has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 7 (13 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.ApplyUserExperiencePreferences (cognitive 47) · ×1
  • shellinstaller.ApplyUserExperiencePreferences (cognitive 47) internal/shellinstaller/user_shell_apply_unix.go:16 — shellinstaller.ApplyUserExperiencePreferences has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 2, loops 1 (nesting depth added 17). Of this number, 36 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderShellInstall (cognitive 47) · ×1
  • screens.RenderShellInstall (cognitive 47) internal/tui/screens/shell_install.go:66 — screens.RenderShellInstall has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 7 (14 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.checkStateJSON (cognitive 46) · ×1
  • cli.checkStateJSON (cognitive 46) internal/cli/doctor.go:517 — cli.checkStateJSON has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (44 pts), boolean chains 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.scanJSONCValueEnd (cognitive 46) · ×1
  • filemerge.scanJSONCValueEnd (cognitive 46) REDACTED:1008 — filemerge.scanJSONCValueEnd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 5, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.validateReviewStartBinding (cognitive 45) · ×1
  • cli.validateReviewStartBinding (cognitive 45) internal/cli/review_facade.go:2763 — cli.validateReviewStartBinding has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 6, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.InjectStrictTDDWithOptions (cognitive 45) · ×1
  • agentguidance.InjectStrictTDDWithOptions (cognitive 45) internal/components/agentguidance/strict_tdd.go:42 — agentguidance.InjectStrictTDDWithOptions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (40 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.stdioHandshake (cognitive 45) · ×1
  • engram.stdioHandshake (cognitive 45) internal/components/engram/healthprobe.go:149 — engram.stdioHandshake has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 21). Of this number, 41 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.RetireSDDAssets (cognitive 45) · ×1
  • legacyassets.RetireSDDAssets (cognitive 45) internal/components/legacyassets/sdd_assets.go:164 — legacyassets.RetireSDDAssets has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 7, loops 4 (5 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactRepositoryEvidence (cognitive 45) · ×1
  • reviewtransaction.validateCompactRepositoryEvidence (cognitive 45) internal/reviewtransaction/compact_store.go:1654 — reviewtransaction.validateCompactRepositoryEvidence has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userCodeGraphMembers (cognitive 45) · ×1
  • shellinstaller.userCodeGraphMembers (cognitive 45) internal/shellinstaller/user_codegraph_library_unix.go:122 — shellinstaller.userCodeGraphMembers has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 8, loops 4 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.prepareCompactReviewerResults (cognitive 44) · ×1
  • cli.prepareCompactReviewerResults (cognitive 44) internal/cli/review_facade.go:3185 — cli.prepareCompactReviewerResults has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (36 pts), loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.validateReviewStartRiskReasons (cognitive 44) · ×1
  • cli.validateReviewStartRiskReasons (cognitive 44) internal/cli/review_start_contract.go:334 — cli.validateReviewStartRiskReasons has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 11, match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runSyncWithSelectionScope (cognitive 44) · ×1
  • cli.runSyncWithSelectionScope (cognitive 44) REDACTED:2053 — cli.runSyncWithSelectionScope has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27 (36 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.topLevelJSONCObjectEnd (cognitive 44) · ×1
  • filemerge.topLevelJSONCObjectEnd (cognitive 44) REDACTED:776 — filemerge.topLevelJSONCObjectEnd has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (38 pts), boolean chains 5, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userUnixOverlaySelectSDK (cognitive 44) · ×1
  • shellinstaller.userUnixOverlaySelectSDK (cognitive 44) internal/shellinstaller/user_channel_overlay_unix.go:224 — shellinstaller.userUnixOverlaySelectSDK has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (32 pts), boolean chains 7, loops 3, match/switch 1 (2 pts) (nesting depth added 8). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userRestoreAgentImages (cognitive 44) · ×1
  • shellinstaller.userRestoreAgentImages (cognitive 44) internal/shellinstaller/user_shell_agent_unix.go:306 — shellinstaller.userRestoreAgentImages has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 18). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.NormalizeOpenCode (cognitive 44) · ×1
  • telemetry.NormalizeOpenCode (cognitive 44) internal/telemetry/runtime_opencode.go:36 — telemetry.NormalizeOpenCode has cognitive complexity 44 (threshold 15). Drivers by points: if/else 31 (39 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · screens.renderWelcomeWithInstaller (cognitive 44) · ×1
  • screens.renderWelcomeWithInstaller (cognitive 44) internal/tui/screens/welcome.go:78 — screens.renderWelcomeWithInstaller has cognitive complexity 44 (threshold 15). Drivers by points: if/else 28 (37 pts), boolean chains 7 (nesting depth added 9). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 90, 164, 84). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · legacyassets.RetireSDDAgents (cognitive 43) · ×1
  • legacyassets.RetireSDDAgents (cognitive 43) internal/components/legacyassets/sdd_agents.go:201 — legacyassets.RetireSDDAgents has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 7 (11 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providercontractbundle.validateEntries (cognitive 43) · ×1
  • providercontractbundle.validateEntries (cognitive 43) internal/providercontractbundle/bundle.go:627 — providercontractbundle.validateEntries has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (37 pts), boolean chains 3, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.updateShellInstall (cognitive 43) · ×1
  • Model.updateShellInstall (cognitive 43) internal/tui/shell_install.go:810 — Model.updateShellInstall has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 10, match/switch 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.removeJSONCMember (cognitive 42) · ×1
  • filemerge.removeJSONCMember (cognitive 42) internal/components/filemerge/jsonc_members.go:85 — filemerge.removeJSONCMember has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 16, loops 2 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotBuilder.activePassiveContentPaths (cognitive 42) · ×1
  • SnapshotBuilder.activePassiveContentPaths (cognitive 42) internal/reviewtransaction/risk.go:373 — SnapshotBuilder.activePassiveContentPaths has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 9 (16 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.CheckUserShellUpdate (cognitive 42) · ×1
  • shellinstaller.CheckUserShellUpdate (cognitive 42) internal/shellinstaller/user_shell_update_unix.go:30 — shellinstaller.CheckUserShellUpdate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 6, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ReviewTargetStatusResult.validateSelectorNextTransition (cognitive 41) · ×1
  • ReviewTargetStatusResult.validateSelectorNextTransition (cognitive 41) internal/cli/review_status_contract.go:1008 — ReviewTargetStatusResult.validateSelectorNextTransition has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 17, loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.SetCloneLocalRDDMode (cognitive 41) · ×1
  • reviewtransaction.SetCloneLocalRDDMode (cognitive 41) internal/reviewtransaction/rdd_mode.go:334 — reviewtransaction.SetCloneLocalRDDMode has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 12 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userReadRecordedManifest (cognitive 41) · ×1
  • shellinstaller.userReadRecordedManifest (cognitive 41) internal/shellinstaller/user_install_flow_unix.go:1182 — shellinstaller.userReadRecordedManifest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactAdmittedRoleResults (cognitive 40) · ×1
  • reviewtransaction.validateCompactAdmittedRoleResults (cognitive 40) internal/reviewtransaction/compact.go:1086 — reviewtransaction.validateCompactAdmittedRoleResults has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 9, match/switch 2 (4 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.replaceContextGuarded (cognitive 40) · ×1
  • CompactStore.replaceContextGuarded (cognitive 40) internal/reviewtransaction/compact_store.go:1545 — CompactStore.replaceContextGuarded has cognitive complexity 40 (threshold 15). Drivers by points: if/else 28 (36 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Model.updateShellManage (cognitive 40) · ×1
  • Model.updateShellManage (cognitive 40) internal/tui/shell_install.go:525 — Model.updateShellManage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.RetireClaudeSDDPreflightHook (cognitive 39) · ×1
  • legacyassets.RetireClaudeSDDPreflightHook (cognitive 39) internal/components/legacyassets/claude_hook.go:41 — legacyassets.RetireClaudeSDDPreflightHook has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 5 (9 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewCaptureUnachievable (cognitive 38) · ×1
  • cli.RunReviewCaptureUnachievable (cognitive 38) internal/cli/review_capture_unachievable.go:60 — cli.RunReviewCaptureUnachievable has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencodeplugin.Uninstall (cognitive 38) · ×1
  • opencodeplugin.Uninstall (cognitive 38) internal/components/opencodeplugin/uninstall.go:36 — opencodeplugin.Uninstall has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.parseVerboseCatalog (cognitive 38) · ×1
  • opencode.parseVerboseCatalog (cognitive 38) internal/opencode/catalog.go:336 — opencode.parseVerboseCatalog has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActivationPlan.Apply (cognitive 38) · ×1
  • ActivationPlan.Apply (cognitive 38) internal/opencode/background.go:707 — ActivationPlan.Apply has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsCodeGraphExtract (cognitive 38) · ×1
  • shellinstaller.userWindowsCodeGraphExtract (cognitive 38) internal/shellinstaller/user_codegraph_windows.go:99 — shellinstaller.userWindowsCodeGraphExtract has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 6 (7 pts), boolean chains 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.shellInstallView (cognitive 38) · ×1
  • Model.shellInstallView (cognitive 38) internal/tui/shell_experience.go:331 — Model.shellInstallView has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.persistAssignments (cognitive 37) · ×1
  • app.persistAssignments (cognitive 37) internal/app/app.go:1040 — app.persistAssignments has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 2 (nesting depth added 8). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to one function literal inside it that branches (line 1057). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.RunReviewBundleImport (cognitive 37) · ×1
  • cli.RunReviewBundleImport (cognitive 37) internal/cli/review.go:558 — cli.RunReviewBundleImport has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.newReviewIntegrationStartResult (cognitive 37) · ×1
  • cli.newReviewIntegrationStartResult (cognitive 37) internal/cli/review_start_contract.go:65 — cli.newReviewIntegrationStartResult has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.restoreSyncFiles (cognitive 37) · ×1
  • cli.restoreSyncFiles (cognitive 37) REDACTED:1816 — cli.restoreSyncFiles has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 3, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userNativeCoordinate (cognitive 37) · ×1
  • shellinstaller.userNativeCoordinate (cognitive 37) internal/shellinstaller/user_native_coordinate_linux.go:52 — shellinstaller.userNativeCoordinate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 29 (31 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userPNPMResolve (cognitive 37) · ×1
  • shellinstaller.userPNPMResolve (cognitive 37) internal/shellinstaller/user_pnpm_readback_unix.go:137 — shellinstaller.userPNPMResolve has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.parseReviewProviderRoleCapture (cognitive 36) · ×1
  • cli.parseReviewProviderRoleCapture (cognitive 36) internal/cli/review_provider_role_capture.go:62 — cli.parseReviewProviderRoleCapture has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 11 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.runPostApplyVerification (cognitive 36) · ×1
  • cli.runPostApplyVerification (cognitive 36) internal/cli/run.go:4792 — cli.runPostApplyVerification has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 18). Of this number, 24 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communitytool.UninstallPiCodeGraph (cognitive 36) · ×1
  • communitytool.UninstallPiCodeGraph (cognitive 36) internal/components/communitytool/pi_codegraph.go:823 — communitytool.UninstallPiCodeGraph has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 2, loops 2 (nesting depth added 11). Of this number, 34 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.RetireOpenCodeSDDSettings (cognitive 36) · ×1
  • legacyassets.RetireOpenCodeSDDSettings (cognitive 36) internal/components/legacyassets/opencode_settings.go:310 — legacyassets.RetireOpenCodeSDDSettings has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (6 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.ValidateFixDeltaResult (cognitive 36) · ×1
  • Transaction.ValidateFixDeltaResult (cognitive 36) internal/reviewtransaction/transaction.go:781 — Transaction.ValidateFixDeltaResult has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 7, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userStageJSON (cognitive 36) · ×1
  • shellinstaller.userStageJSON (cognitive 36) internal/shellinstaller/user_experience_private_unix.go:148 — shellinstaller.userStageJSON has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 11 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.privateCgroupPath (cognitive 36) · ×1
  • shellinstaller.privateCgroupPath (cognitive 36) internal/shellinstaller/user_runtime_primitives_linux.go:25 — shellinstaller.privateCgroupPath has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewInvalidate (cognitive 35) · ×1
  • cli.RunReviewInvalidate (cognitive 35) internal/cli/review_facade.go:2296 — cli.RunReviewInvalidate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.closeReviewOnLastCapturedLens (cognitive 35) · ×1
  • cli.closeReviewOnLastCapturedLens (cognitive 35) internal/cli/review_last_event_closure.go:197 — cli.closeReviewOnLastCapturedLens has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (34 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewLensContextBlock (cognitive 35) · ×1
  • cli.reviewLensContextBlock (cognitive 35) internal/cli/review_lens_context.go:690 — cli.reviewLensContextBlock has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 2, boolean chains 1 (nesting depth added 14). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunPreparedInstall (cognitive 35) · ×1
  • cli.RunPreparedInstall (cognitive 35) internal/cli/run.go:207 — cli.RunPreparedInstall has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28 (30 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.RenderSyncReport (cognitive 35) · ×1
  • cli.RenderSyncReport (cognitive 35) REDACTED:2594 — cli.RenderSyncReport has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (23 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 9). Of this number, 21 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.mergeAdmittedNonLensRoleResult (cognitive 35) · ×1
  • CompactStore.mergeAdmittedNonLensRoleResult (cognitive 35) internal/reviewtransaction/compact_reviewer_capture.go:619 — CompactStore.mergeAdmittedNonLensRoleResult has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 7). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CompactStore.CreateOrReplayAtomicStart (cognitive 35) · ×1
  • CompactStore.CreateOrReplayAtomicStart (cognitive 35) internal/reviewtransaction/compact_store.go:1338 — CompactStore.CreateOrReplayAtomicStart has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · screens.RenderDetection (cognitive 35) · ×1
  • screens.RenderDetection (cognitive 35) internal/tui/screens/detection.go:17 — screens.RenderDetection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 4 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.loadPersistedAssignments (cognitive 34) · ×1
  • app.loadPersistedAssignments (cognitive 34) internal/app/app.go:967 — app.loadPersistedAssignments has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 6 (12 pts), boolean chains 8 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.safeReviewIntegrationArguments (cognitive 34) · ×1
  • cli.safeReviewIntegrationArguments (cognitive 34) internal/cli/review_operation_contract.go:1278 — cli.safeReviewIntegrationArguments has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agenthooks.installSkillRegistry (cognitive 34) · ×1
  • agenthooks.installSkillRegistry (cognitive 34) internal/components/agenthooks/skill_registry.go:77 — agenthooks.installSkillRegistry has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 4, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.fetchLatestEngramVersionWithAssets (cognitive 34) · ×1
  • engram.fetchLatestEngramVersionWithAssets (cognitive 34) REDACTED:368 — engram.fetchLatestEngramVersionWithAssets has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.stripJSONComments (cognitive 34) · ×1
  • filemerge.stripJSONComments (cognitive 34) REDACTED:554 — filemerge.stripJSONComments has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.trailingLineCommentStart (cognitive 34) · ×1
  • filemerge.trailingLineCommentStart (cognitive 34) REDACTED:850 — filemerge.trailingLineCommentStart has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.referencedSDDAgents (cognitive 34) · ×1
  • legacyassets.referencedSDDAgents (cognitive 34) internal/components/legacyassets/sdd_agents.go:287 — legacyassets.referencedSDDAgents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 7 (12 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uninstall.stripJSONComments (cognitive 34) · ×1
  • uninstall.stripJSONComments (cognitive 34) internal/components/uninstall/cleaners.go:267 — uninstall.stripJSONComments has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.authorityRepairRoot (cognitive 34) · ×1
  • reviewtransaction.authorityRepairRoot (cognitive 34) internal/reviewtransaction/authority_repair.go:705 — reviewtransaction.authorityRepairRoot has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactReviewLifecycle (cognitive 34) · ×1
  • reviewtransaction.validateCompactReviewLifecycle (cognitive 34) internal/reviewtransaction/compact.go:1568 — reviewtransaction.validateCompactReviewLifecycle has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 7, match/switch 1 (nesting depth added 12). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.repairHistoricalLegacyAlias (cognitive 34) · ×1
  • reviewtransaction.repairHistoricalLegacyAlias (cognitive 34) internal/reviewtransaction/legacy_alias_repair.go:70 — reviewtransaction.repairHistoricalLegacyAlias has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.ParseGateContext (cognitive 34) · ×1
  • reviewtransaction.ParseGateContext (cognitive 34) internal/reviewtransaction/receipt.go:290 — reviewtransaction.ParseGateContext has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 13, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsReuseComponents (cognitive 34) · ×1
  • shellinstaller.userWindowsReuseComponents (cognitive 34) internal/shellinstaller/user_install_scope_windows.go:88 — shellinstaller.userWindowsReuseComponents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · shellinstaller.userWindowsVerify (cognitive 34) · ×1
  • shellinstaller.userWindowsVerify (cognitive 34) internal/shellinstaller/user_launch_windows.go:68 — shellinstaller.userWindowsVerify has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 5, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderPhaseList (cognitive 34) · ×1
  • screens.renderPhaseList (cognitive 34) internal/tui/screens/model_picker.go:756 — screens.renderPhaseList has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.UpsertTOMLTableKey (cognitive 33) · ×1
  • filemerge.UpsertTOMLTableKey (cognitive 33) internal/components/filemerge/toml.go:121 — filemerge.UpsertTOMLTableKey has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startupPathModel.apply (cognitive 33) · ×1
  • startupPathModel.apply (cognitive 33) internal/opencode/background_readiness.go:439 — startupPathModel.apply has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 4, loops 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · releasepolicy.compareYAML (cognitive 33) · ×1
  • releasepolicy.compareYAML (cognitive 33) internal/releasepolicy/policy.go:213 — releasepolicy.compareYAML has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.RepairClassifiedAuthority (cognitive 33) · ×1
  • reviewtransaction.RepairClassifiedAuthority (cognitive 33) internal/reviewtransaction/authority_repair.go:871 — reviewtransaction.RepairClassifiedAuthority has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (33 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.isPassiveSVG (cognitive 33) · ×1
  • reviewtransaction.isPassiveSVG (cognitive 33) internal/reviewtransaction/verification_contract.go:1216 — reviewtransaction.isPassiveSVG has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 2 (5 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · authorityRepairScan.scanLegacy (cognitive 33) · ×1
  • authorityRepairScan.scanLegacy (cognitive 33) internal/reviewtransaction/authority_repair.go:322 — authorityRepairScan.scanLegacy has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RARAuthorityRepository.Publish (cognitive 33) · ×1
  • RARAuthorityRepository.Publish (cognitive 33) internal/reviewtransaction/rar_authority_repository.go:245 — RARAuthorityRepository.Publish has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (31 pts), boolean chains 2 (nesting depth added 6). Of this number, 28 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.ReadNativePNPMInstallation (cognitive 33) · ×1
  • shellinstaller.ReadNativePNPMInstallation (cognitive 33) internal/shellinstaller/user_pnpm_readback_unix.go:28 — shellinstaller.ReadNativePNPMInstallation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 7, loops 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · upgrade.managedAgentBackupPaths (cognitive 33) · ×1
  • upgrade.managedAgentBackupPaths (cognitive 33) internal/update/upgrade/executor.go:203 — upgrade.managedAgentBackupPaths has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 4 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 11). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · upgrade.RenderUpgradeReport (cognitive 33) · ×1
  • upgrade.RenderUpgradeReport (cognitive 33) internal/update/upgrade/render.go:12 — upgrade.RenderUpgradeReport has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.discoverCompactFacadeReview (cognitive 32) · ×1
  • cli.discoverCompactFacadeReview (cognitive 32) internal/cli/review_facade.go:3269 — cli.discoverCompactFacadeReview has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewLensContextParseNumstat (cognitive 32) · ×1
  • cli.reviewLensContextParseNumstat (cognitive 32) internal/cli/review_lens_context.go:605 — cli.reviewLensContextParseNumstat has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.mergeObjectScope (cognitive 32) · ×1
  • filemerge.mergeObjectScope (cognitive 32) REDACTED:1126 — filemerge.mergeObjectScope has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 10, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminimodules.Publish (cognitive 32) · ×1
  • geminimodules.Publish (cognitive 32) internal/components/geminimodules/modules.go:107 — geminimodules.Publish has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 5, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.SettingsFileReferences (cognitive 32) · ×1
  • opencode.SettingsFileReferences (cognitive 32) internal/opencode/file_references.go:38 — opencode.SettingsFileReferences has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 16). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 52). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · reviewtransaction.validateChainBundle (cognitive 32) · ×1
  • reviewtransaction.validateChainBundle (cognitive 32) internal/reviewtransaction/bundle.go:134 — reviewtransaction.validateChainBundle has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 8, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.inventoryLineage (cognitive 32) · ×1
  • reviewtransaction.inventoryLineage (cognitive 32) internal/reviewtransaction/status.go:299 — reviewtransaction.inventoryLineage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotBuilder.DiffStats (cognitive 32) · ×1
  • SnapshotBuilder.DiffStats (cognitive 32) internal/reviewtransaction/snapshot.go:587 — SnapshotBuilder.DiffStats has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotBuilder.classifyVerificationStat (cognitive 32) · ×1
  • SnapshotBuilder.classifyVerificationStat (cognitive 32) internal/reviewtransaction/verification_contract.go:938 — SnapshotBuilder.classifyVerificationStat has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (26 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · userNativeServiceCustody.captureFiles (cognitive 32) · ×1
  • userNativeServiceCustody.captureFiles (cognitive 32) internal/shellinstaller/user_native_service_linux.go:51 — userNativeServiceCustody.captureFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 8). Of this number, 21 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skillregistry.findAllSkillFiles (cognitive 32) · ×1
  • skillregistry.findAllSkillFiles (cognitive 32) internal/skillregistry/registry.go:258 — skillregistry.findAllSkillFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backfill-victoriametrics.post_chunks (cognitive 32) · ×1
  • backfill-victoriametrics.post_chunks (cognitive 32) deploy/telemetry/scripts/backfill-victoriametrics.py:341 — backfill-victoriametrics.post_chunks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (22 pts), error handling 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · syncRuntime.stagePlan (cognitive 31) · ×1
  • syncRuntime.stagePlan (cognitive 31) REDACTED:515 — syncRuntime.stagePlan has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communitytool.piChildTools (cognitive 31) · ×1
  • communitytool.piChildTools (cognitive 31) internal/components/communitytool/pi_codegraph.go:379 — communitytool.piChildTools has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.stripTrailingCommas (cognitive 31) · ×1
  • filemerge.stripTrailingCommas (cognitive 31) REDACTED:622 — filemerge.stripTrailingCommas has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.InjectMarkdownSection (cognitive 31) · ×1
  • filemerge.InjectMarkdownSection (cognitive 31) internal/components/filemerge/section.go:280 — filemerge.InjectMarkdownSection has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.updateTOMLMultilineString (cognitive 31) · ×1
  • filemerge.updateTOMLMultilineString (cognitive 31) internal/components/filemerge/toml.go:387 — filemerge.updateTOMLMultilineString has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.sendOpenCode (cognitive 31) · ×1
  • telemetryruntime.sendOpenCode (cognitive 31) internal/components/telemetryruntime/opencode.go:77 — telemetryruntime.sendOpenCode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uninstall.stripTrailingCommas (cognitive 31) · ×1
  • uninstall.stripTrailingCommas (cognitive 31) internal/components/uninstall/cleaners.go:335 — uninstall.stripTrailingCommas has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.discoverClassifiedAuthorityRepairRecord (cognitive 31) · ×1
  • reviewtransaction.discoverClassifiedAuthorityRepairRecord (cognitive 31) internal/reviewtransaction/classified_authority_replay.go:139 — reviewtransaction.discoverClassifiedAuthorityRepairRecord has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.resolveAdvertisedSelector (cognitive 31) · ×1
  • reviewtransaction.resolveAdvertisedSelector (cognitive 31) internal/reviewtransaction/gate.go:409 — reviewtransaction.resolveAdvertisedSelector has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateReceiptStructure (cognitive 31) · ×1
  • reviewtransaction.validateReceiptStructure (cognitive 31) internal/reviewtransaction/receipt.go:353 — reviewtransaction.validateReceiptStructure has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3, match/switch 2 (3 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotBuilder.candidateFindingSupportsCausality (cognitive 31) · ×1
  • SnapshotBuilder.candidateFindingSupportsCausality (cognitive 31) internal/reviewtransaction/snapshot.go:481 — SnapshotBuilder.candidateFindingSupportsCausality has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userStageExperience (cognitive 31) · ×1
  • shellinstaller.userStageExperience (cognitive 31) internal/shellinstaller/user_experience_stage_unix.go:18 — shellinstaller.userStageExperience has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 4, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userReuseSDKState (cognitive 31) · ×1
  • shellinstaller.userReuseSDKState (cognitive 31) internal/shellinstaller/user_install_scope_unix.go:179 — shellinstaller.userReuseSDKState has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userPublishNativePNPMPrepared (cognitive 31) · ×1
  • shellinstaller.userPublishNativePNPMPrepared (cognitive 31) internal/shellinstaller/user_pnpm_publish_linux.go:15 — shellinstaller.userPublishNativePNPMPrepared has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 7 (nesting depth added 4). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · shellinstaller.LoadUserShellExperience (cognitive 31) · ×1
  • shellinstaller.LoadUserShellExperience (cognitive 31) internal/shellinstaller/user_shell_registry_unix.go:204 — shellinstaller.LoadUserShellExperience has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.Opportunistic (cognitive 31) · ×1
  • telemetry.Opportunistic (cognitive 31) internal/telemetry/opportunistic.go:72 — telemetry.Opportunistic has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 6, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetry.normalizeRuntimeRows (cognitive 31) · ×1
  • telemetry.normalizeRuntimeRows (cognitive 31) internal/telemetry/runtime.go:340 — telemetry.normalizeRuntimeRows has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.DecodeCodexHook (cognitive 31) · ×1
  • telemetry.DecodeCodexHook (cognitive 31) internal/telemetry/runtime_codex.go:40 — telemetry.DecodeCodexHook has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderUpgradeSyncResult (cognitive 31) · ×1
  • screens.renderUpgradeSyncResult (cognitive 31) internal/tui/screens/upgrade_sync.go:116 — screens.renderUpgradeSyncResult has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.MergeConfiguredCatalog (cognitive 30) · ×1
  • opencode.MergeConfiguredCatalog (cognitive 30) internal/opencode/catalog.go:229 — opencode.MergeConfiguredCatalog has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (11 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startupPathModel.expand (cognitive 30) · ×1
  • startupPathModel.expand (cognitive 30) internal/opencode/background_readiness.go:700 — startupPathModel.expand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 9, match/switch 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providercontractbundle.VerifyArchive (cognitive 30) · ×1
  • providercontractbundle.VerifyArchive (cognitive 30) internal/providercontractbundle/bundle.go:448 — providercontractbundle.VerifyArchive has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providercontractbundle.validateRawTarHeaders (cognitive 30) · ×1
  • providercontractbundle.validateRawTarHeaders (cognitive 30) internal/providercontractbundle/bundle.go:520 — providercontractbundle.validateRawTarHeaders has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.deriveAuthorityDispositionPlan (cognitive 30) · ×1
  • reviewtransaction.deriveAuthorityDispositionPlan (cognitive 30) internal/reviewtransaction/authority_disposition_plan.go:279 — reviewtransaction.deriveAuthorityDispositionPlan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · authorityRepairScan.scanCompact (cognitive 30) · ×1
  • authorityRepairScan.scanCompact (cognitive 30) internal/reviewtransaction/authority_repair.go:255 — authorityRepairScan.scanCompact has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RARAuthorityRepository.PublishPlan (cognitive 30) · ×1
  • RARAuthorityRepository.PublishPlan (cognitive 30) internal/reviewtransaction/rar_plan_authority.go:322 — RARAuthorityRepository.PublishPlan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25 (28 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.DecodeUserExperience (cognitive 30) · ×1
  • shellinstaller.DecodeUserExperience (cognitive 30) internal/shellinstaller/user_experience.go:154 — shellinstaller.DecodeUserExperience has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 8, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userSnapshotZIP (cognitive 30) · ×1
  • shellinstaller.userSnapshotZIP (cognitive 30) internal/shellinstaller/user_source_archive.go:18 — shellinstaller.userSnapshotZIP has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.codexTranscriptEvidence (cognitive 30) · ×1
  • telemetry.codexTranscriptEvidence (cognitive 30) internal/telemetry/runtime_codex.go:235 — telemetry.codexTranscriptEvidence has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderUninstallResult (cognitive 30) · ×1
  • screens.RenderUninstallResult (cognitive 30) internal/tui/screens/uninstall.go:333 — screens.RenderUninstallResult has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.runBenchModelPickerCommand (cognitive 29) · ×1
  • app.runBenchModelPickerCommand (cognitive 29) internal/app/bench_model_picker.go:7 — app.runBenchModelPickerCommand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (22 pts), loops 4, boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.runReviewStopHookStop (cognitive 29) · ×1
  • cli.runReviewStopHookStop (cognitive 29) internal/cli/review_stop_hook.go:165 — cli.runReviewStopHookStop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.prepareDesiredOrchestratorModules (cognitive 29) · ×1
  • agentguidance.prepareDesiredOrchestratorModules (cognitive 29) internal/components/agentguidance/orchestrator_module_install.go:120 — agentguidance.prepareDesiredOrchestratorModules has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, loops 3, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.ResolveTarget (cognitive 29) · ×1
  • opencode.ResolveTarget (cognitive 29) internal/opencode/background.go:398 — opencode.ResolveTarget has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.ExtractBoundedSingleJSONObject (cognitive 29) · ×1
  • reviewtransaction.ExtractBoundedSingleJSONObject (cognitive 29) internal/reviewtransaction/artifact_admission.go:721 — reviewtransaction.ExtractBoundedSingleJSONObject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.mergeAdmittedLensResult (cognitive 29) · ×1
  • CompactStore.mergeAdmittedLensResult (cognitive 29) internal/reviewtransaction/compact_reviewer_capture.go:497 — CompactStore.mergeAdmittedLensResult has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 6). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Transaction.ClassifyEvidence (cognitive 29) · ×1
  • Transaction.ClassifyEvidence (cognitive 29) internal/reviewtransaction/transaction.go:520 — Transaction.ClassifyEvidence has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (6 pts), loops 4 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userTreeStamp (cognitive 29) · ×1
  • shellinstaller.userTreeStamp (cognitive 29) internal/shellinstaller/user_install_unix.go:64 — shellinstaller.userTreeStamp has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 5, match/switch 1 (nesting depth added 7). None of this is in the body itself: all 29 points belong to one function literal inside it that branches (line 69). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · shellinstaller.userWindowsInventory (cognitive 29) · ×1
  • shellinstaller.userWindowsInventory (cognitive 29) REDACTED:384 — shellinstaller.userWindowsInventory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 423, 399, 410). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · RuntimeMetrics.WriteTo (cognitive 29) · ×1
  • RuntimeMetrics.WriteTo (cognitive 29) internal/telemetrycollector/metrics.go:253 — RuntimeMetrics.WriteTo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 6 (13 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installRuntime.stagePlan (cognitive 28) · ×1
  • installRuntime.stagePlan (cognitive 28) internal/cli/run.go:929 — installRuntime.stagePlan has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 7, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.RemoveTOMLTableKeys (cognitive 28) · ×1
  • filemerge.RemoveTOMLTableKeys (cognitive 28) internal/components/filemerge/toml.go:208 — filemerge.RemoveTOMLTableKeys has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.inspect (cognitive 28) · ×1
  • telemetryruntime.inspect (cognitive 28) internal/components/telemetryruntime/managed.go:124 — telemetryruntime.inspect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.replayCommittedCompactAbandonment (cognitive 28) · ×1
  • reviewtransaction.replayCommittedCompactAbandonment (cognitive 28) internal/reviewtransaction/compact_abandon.go:347 — reviewtransaction.replayCommittedCompactAbandonment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.ensurePrivateRARDirectoryTree (cognitive 28) · ×1
  • reviewtransaction.ensurePrivateRARDirectoryTree (cognitive 28) internal/reviewtransaction/rar_path_safety.go:175 — reviewtransaction.ensurePrivateRARDirectoryTree has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.runGitCapturedRangeWithTimeout (cognitive 28) · ×1
  • reviewtransaction.runGitCapturedRangeWithTimeout (cognitive 28) internal/reviewtransaction/snapshot.go:2002 — reviewtransaction.runGitCapturedRangeWithTimeout has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userStageCodeGraphLibrary (cognitive 28) · ×1
  • shellinstaller.userStageCodeGraphLibrary (cognitive 28) internal/shellinstaller/user_codegraph_library_unix.go:195 — shellinstaller.userStageCodeGraphLibrary has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userStageOwnedAgentContext7 (cognitive 28) · ×1
  • shellinstaller.userStageOwnedAgentContext7 (cognitive 28) internal/shellinstaller/user_shell_agent_unix.go:181 — shellinstaller.userStageOwnedAgentContext7 has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userMainSourceFiles (cognitive 28) · ×1
  • shellinstaller.userMainSourceFiles (cognitive 28) internal/shellinstaller/user_source_archive.go:65 — shellinstaller.userMainSourceFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsIdentityBelow (cognitive 28) · ×1
  • shellinstaller.userWindowsIdentityBelow (cognitive 28) REDACTED:85 — shellinstaller.userWindowsIdentityBelow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 10, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.parseCodeGraphCommand (cognitive 27) · ×1
  • opencode.parseCodeGraphCommand (cognitive 27) internal/agents/opencode/adapter.go:245 — opencode.parseCodeGraphCommand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 10, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.validateCompatibilityDestinations (cognitive 27) · ×1
  • cli.validateCompatibilityDestinations (cognitive 27) internal/cli/compatibility_skills.go:127 — cli.validateCompatibilityDestinations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewAssess (cognitive 27) · ×1
  • cli.RunReviewAssess (cognitive 27) internal/cli/review_assess.go:269 — cli.RunReviewAssess has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 2 (nesting depth added 3). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.mergeExplicitAgentInstallState (cognitive 27) · ×1
  • cli.mergeExplicitAgentInstallState (cognitive 27) internal/cli/run.go:469 — cli.mergeExplicitAgentInstallState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · openCodeModelAssignmentSyncStep.Run (cognitive 27) · ×1
  • openCodeModelAssignmentSyncStep.Run (cognitive 27) REDACTED:1173 — openCodeModelAssignmentSyncStep.Run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 5, boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · engram.fetchLatestEngramVersionRequest (cognitive 27) · ×1
  • engram.fetchLatestEngramVersionRequest (cognitive 27) REDACTED:271 — engram.fetchLatestEngramVersionRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp.mergeContext7JSON (cognitive 27) · ×1
  • mcp.mergeContext7JSON (cognitive 27) REDACTED:442 — mcp.mergeContext7JSON has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · opencodeagents.Shape (cognitive 27) · ×1
  • opencodeagents.Shape (cognitive 27) internal/components/opencodeagents/agents.go:224 — opencodeagents.Shape has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.removeOwnedFile (cognitive 27) · ×1
  • opencode.removeOwnedFile (cognitive 27) internal/opencode/background_remove_unix.go:37 — opencode.removeOwnedFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, boolean chains 4. Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · reviewtransaction.AbandonPristineCompactStore (cognitive 27) · ×1
  • reviewtransaction.AbandonPristineCompactStore (cognitive 27) internal/reviewtransaction/compact_abandon.go:242 — reviewtransaction.AbandonPristineCompactStore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 2, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.inspectCompactRecoveryRecordSet (cognitive 27) · ×1
  • reviewtransaction.inspectCompactRecoveryRecordSet (cognitive 27) internal/reviewtransaction/compact_inspect.go:372 — reviewtransaction.inspectCompactRecoveryRecordSet has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactRecoveredEvidenceReferenceShape (cognitive 27) · ×1
  • reviewtransaction.validateCompactRecoveredEvidenceReferenceShape (cognitive 27) internal/reviewtransaction/compact_recovered_evidence.go:151 — reviewtransaction.validateCompactRecoveredEvidenceReferenceShape has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, match/switch 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.acquireMaintenanceLockInternal (cognitive 27) · ×1
  • reviewtransaction.acquireMaintenanceLockInternal (cognitive 27) internal/reviewtransaction/store_lock.go:233 — reviewtransaction.acquireMaintenanceLockInternal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.canonicalLensResult (cognitive 27) · ×1
  • reviewtransaction.canonicalLensResult (cognitive 27) internal/reviewtransaction/transaction.go:388 — reviewtransaction.canonicalLensResult has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.ValidateCorrectionImpactClosure (cognitive 27) · ×1
  • reviewtransaction.ValidateCorrectionImpactClosure (cognitive 27) internal/reviewtransaction/verification_contract.go:766 — reviewtransaction.ValidateCorrectionImpactClosure has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.CaptureAdmittedReviewerResult (cognitive 27) · ×1
  • CompactStore.CaptureAdmittedReviewerResult (cognitive 27) internal/reviewtransaction/compact_reviewer_capture.go:346 — CompactStore.CaptureAdmittedReviewerResult has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · Transaction.validateLensState (cognitive 27) · ×1
  • Transaction.validateLensState (cognitive 27) internal/reviewtransaction/transaction.go:1309 — Transaction.validateLensState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.validateResolutionCounters (cognitive 27) · ×1
  • Transaction.validateResolutionCounters (cognitive 27) internal/reviewtransaction/transaction.go:1622 — Transaction.validateResolutionCounters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 7, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · shellinstaller.userReuseComponents (cognitive 27) · ×1
  • shellinstaller.userReuseComponents (cognitive 27) internal/shellinstaller/user_install_scope_unix.go:106 — shellinstaller.userReuseComponents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.View (cognitive 27) · ×1
  • Model.View (cognitive 27) internal/tui/model.go:1509 — Model.View has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 4, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · screens.renderCustomPhaseList (cognitive 27) · ×1
  • screens.renderCustomPhaseList (cognitive 27) internal/tui/screens/claude_model_picker.go:422 — screens.renderCustomPhaseList has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReview (cognitive 26) · ×1
  • cli.RunReview (cognitive 26) internal/cli/review_facade.go:601 — cli.RunReview has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.openCodeTransportComplete (cognitive 26) · ×1
  • cli.openCodeTransportComplete (cognitive 26) internal/cli/review_opencode_transport.go:492 — cli.openCodeTransportComplete has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.renderReviewStoreReset (cognitive 26) · ×1
  • cli.renderReviewStoreReset (cognitive 26) internal/cli/review_store_reset.go:102 — cli.renderReviewStoreReset has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (9 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.retireOpenCodeFamilyReviewAgents (cognitive 26) · ×1
  • cli.retireOpenCodeFamilyReviewAgents (cognitive 26) internal/cli/run.go:2323 — cli.retireOpenCodeFamilyReviewAgents has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.NormalizeInstallFlags (cognitive 26) · ×1
  • cli.NormalizeInstallFlags (cognitive 26) internal/cli/validate.go:26 — cli.NormalizeInstallFlags has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · unixCompatibilityDirectoryWriter.openParent (cognitive 26) · ×1
  • unixCompatibilityDirectoryWriter.openParent (cognitive 26) internal/cli/compatibility_writer_unix.go:169 — unixCompatibilityDirectoryWriter.openParent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewTargetStatusResult.validateRepairNextTransition (cognitive 26) · ×1
  • ReviewTargetStatusResult.validateRepairNextTransition (cognitive 26) internal/cli/review_status_contract.go:1134 — ReviewTargetStatusResult.validateRepairNextTransition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · prepareBackupStep.Run (cognitive 26) · ×1
  • prepareBackupStep.Run (cognitive 26) internal/cli/run.go:2849 — prepareBackupStep.Run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.decodeOrchestratorFragments (cognitive 26) · ×1
  • agentguidance.decodeOrchestratorFragments (cognitive 26) internal/components/agentguidance/orchestrator_module_fragments.go:50 — agentguidance.decodeOrchestratorFragments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (4 pts), boolean chains 3, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.marshalPermissionOrder (cognitive 26) · ×1
  • filemerge.marshalPermissionOrder (cognitive 26) REDACTED:215 — filemerge.marshalPermissionOrder has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenCodeSDDRegistry.Owns (cognitive 26) · ×1
  • OpenCodeSDDRegistry.Owns (cognitive 26) internal/components/legacyassets/opencode_settings.go:115 — OpenCodeSDDRegistry.Owns has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.retiredSDDOperation (cognitive 26) · ×1
  • Service.retiredSDDOperation (cognitive 26) internal/components/uninstall/retired_sdd.go:22 — Service.retiredSDDOperation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 4 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 65, 96). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · reviewtransaction.reopenCompactAdmittedRoleResults (cognitive 26) · ×1
  • reviewtransaction.reopenCompactAdmittedRoleResults (cognitive 26) internal/reviewtransaction/compact.go:1418 — reviewtransaction.reopenCompactAdmittedRoleResults has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 9, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.deleteRetiredCompactField (cognitive 26) · ×1
  • reviewtransaction.deleteRetiredCompactField (cognitive 26) internal/reviewtransaction/compact_store.go:2298 — reviewtransaction.deleteRetiredCompactField has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.readRefuterProbeBatch (cognitive 26) · ×1
  • reviewtransaction.readRefuterProbeBatch (cognitive 26) internal/reviewtransaction/refuter_probe.go:114 — reviewtransaction.readRefuterProbeBatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.selectorlessCommittedBaseDiffCorrections (cognitive 26) · ×1
  • reviewtransaction.selectorlessCommittedBaseDiffCorrections (cognitive 26) internal/reviewtransaction/target_status.go:354 — reviewtransaction.selectorlessCommittedBaseDiffCorrections has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.CaptureAdmittedTargetedValidatorResult (cognitive 26) · ×1
  • CompactStore.CaptureAdmittedTargetedValidatorResult (cognitive 26) internal/reviewtransaction/compact_reviewer_capture.go:824 — CompactStore.CaptureAdmittedTargetedValidatorResult has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7 (nesting depth added 6). Of this number, 18 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.RecordUnachievableLensAttempt (cognitive 26) · ×1
  • CompactStore.RecordUnachievableLensAttempt (cognitive 26) internal/reviewtransaction/compact_unachievable_lens.go:39 — CompactStore.RecordUnachievableLensAttempt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VerificationApplicability.Validate (cognitive 26) · ×1
  • VerificationApplicability.Validate (cognitive 26) internal/reviewtransaction/verification_contract.go:129 — VerificationApplicability.Validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, match/switch 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userRecover (cognitive 26) · ×1
  • shellinstaller.userRecover (cognitive 26) internal/shellinstaller/user_install_flow_unix.go:702 — shellinstaller.userRecover has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 4, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userStageMainSource (cognitive 26) · ×1
  • shellinstaller.userStageMainSource (cognitive 26) internal/shellinstaller/user_main_source_unix.go:18 — shellinstaller.userStageMainSource has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.PublishUserShellLauncher (cognitive 26) · ×1
  • shellinstaller.PublishUserShellLauncher (cognitive 26) internal/shellinstaller/user_shell_launcher_unix.go:116 — shellinstaller.PublishUserShellLauncher has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode-review-transport.startRelay (cognitive 26) · ×1
  • opencode-review-transport.startRelay (cognitive 26) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:99 — opencode-review-transport.startRelay has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 10). None of this is in the body itself: all 26 points belong to 3 function literals inside it that branch (lines 118, 152, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · app.tuiExecuteWithSDK (cognitive 25) · ×1
  • app.tuiExecuteWithSDK (cognitive 25) internal/app/app.go:667 — app.tuiExecuteWithSDK has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (2 pts) (nesting depth added 12). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 698). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.runRestoreWithHomeDir (cognitive 25) · ×1
  • cli.runRestoreWithHomeDir (cognitive 25) internal/cli/restore.go:65 — cli.runRestoreWithHomeDir has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.snapshotSyncFiles (cognitive 25) · ×1
  • cli.snapshotSyncFiles (cognitive 25) REDACTED:1731 — cli.snapshotSyncFiles has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.splitOrchestratorModules (cognitive 25) · ×1
  • agentguidance.splitOrchestratorModules (cognitive 25) internal/components/agentguidance/orchestrator_modules.go:110 — agentguidance.splitOrchestratorModules has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.ReadPersistedStdioCommands (cognitive 25) · ×1
  • engram.ReadPersistedStdioCommands (cognitive 25) internal/components/engram/healthprobe.go:382 — engram.ReadPersistedStdioCommands has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.RetireOpenCodeSDDPrompts (cognitive 25) · ×1
  • legacyassets.RetireOpenCodeSDDPrompts (cognitive 25) internal/components/legacyassets/opencode_settings.go:481 — legacyassets.RetireOpenCodeSDDPrompts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, loops 2 (nesting depth added 9). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.ReconcileForMajorWithRollback (cognitive 25) · ×1
  • telemetryruntime.ReconcileForMajorWithRollback (cognitive 25) internal/components/telemetryruntime/managed.go:272 — telemetryruntime.ReconcileForMajorWithRollback has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 3 (nesting depth added 6). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.configuredVariants (cognitive 25) · ×1
  • opencode.configuredVariants (cognitive 25) internal/opencode/config.go:279 — opencode.configuredVariants has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 8). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 280). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · reviewtransaction.markCompactRecoveryCycles (cognitive 25) · ×1
  • reviewtransaction.markCompactRecoveryCycles (cognitive 25) internal/reviewtransaction/compact_inspect.go:496 — reviewtransaction.markCompactRecoveryCycles has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.acquireRARAuthorityLock (cognitive 25) · ×1
  • reviewtransaction.acquireRARAuthorityLock (cognitive 25) internal/reviewtransaction/rar_path_safety.go:390 — reviewtransaction.acquireRARAuthorityLock has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.documentLineIsActive (cognitive 25) · ×1
  • reviewtransaction.documentLineIsActive (cognitive 25) internal/reviewtransaction/verification_contract.go:1142 — reviewtransaction.documentLineIsActive has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (8 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.validateCorrectionBudget (cognitive 25) · ×1
  • Transaction.validateCorrectionBudget (cognitive 25) internal/reviewtransaction/transaction.go:1118 — Transaction.validateCorrectionBudget has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userUnixChannelOverlay (cognitive 25) · ×1
  • shellinstaller.userUnixChannelOverlay (cognitive 25) internal/shellinstaller/user_channel_overlay_unix.go:98 — shellinstaller.userUnixChannelOverlay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 5). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userInspectInstall (cognitive 25) · ×1
  • shellinstaller.userInspectInstall (cognitive 25) internal/shellinstaller/user_install_flow_unix.go:134 — shellinstaller.userInspectInstall has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userSupervisorSHA (cognitive 25) · ×1
  • shellinstaller.userSupervisorSHA (cognitive 25) internal/shellinstaller/user_install_unix.go:252 — shellinstaller.userSupervisorSHA has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (12 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · shellinstaller.userWindowsJobQuiesce (cognitive 25) · ×1
  • shellinstaller.userWindowsJobQuiesce (cognitive 25) REDACTED:196 — shellinstaller.userWindowsJobQuiesce has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). Of this number, 20 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skillregistry.parseFrontmatter (cognitive 25) · ×1
  • skillregistry.parseFrontmatter (cognitive 25) internal/skillregistry/registry.go:323 — skillregistry.parseFrontmatter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.updateShellUpdate (cognitive 25) · ×1
  • Model.updateShellUpdate (cognitive 25) internal/tui/shell_install.go:330 — Model.updateShellUpdate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update.detectHomebrewOwnershipWith (cognitive 25) · ×1
  • update.detectHomebrewOwnershipWith (cognitive 25) internal/update/homebrew.go:80 — update.detectHomebrewOwnershipWith has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · upgrade.ExecuteWithOptions (cognitive 25) · ×1
  • upgrade.ExecuteWithOptions (cognitive 25) internal/update/upgrade/executor.go:533 — upgrade.ExecuteWithOptions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4, match/switch 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.run (cognitive 24) · ×1
  • main.run (cognitive 24) cmd/gentle-telemetry/main.go:104 — main.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RestoreService.restorePlain (cognitive 24) · ×1
  • RestoreService.restorePlain (cognitive 24) internal/backup/restore.go:461 — RestoreService.restorePlain has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewProviderAdmitTargetedValidatorRaw (cognitive 24) · ×1
  • cli.reviewProviderAdmitTargetedValidatorRaw (cognitive 24) internal/cli/review_provider_roles.go:622 — cli.reviewProviderAdmitTargetedValidatorRaw has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.runTelemetryRuntimeInput (cognitive 24) · ×1
  • cli.runTelemetryRuntimeInput (cognitive 24) internal/cli/telemetry_runtime.go:76 — cli.runTelemetryRuntimeInput has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewActionEligibility.Validate (cognitive 24) · ×1
  • ReviewActionEligibility.Validate (cognitive 24) internal/cli/review_status_contract.go:1871 — ReviewActionEligibility.Validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agenthooks.InstallRetainedClaudeHooks (cognitive 24) · ×1
  • agenthooks.InstallRetainedClaudeHooks (cognitive 24) internal/components/agenthooks/claude.go:13 — agenthooks.InstallRetainedClaudeHooks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.scanJSONCWhitespaceAndComments (cognitive 24) · ×1
  • filemerge.scanJSONCWhitespaceAndComments (cognitive 24) REDACTED:978 — filemerge.scanJSONCWhitespaceAndComments has cognitive complexity 24 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (8 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.classifyCompactCorrectionTarget (cognitive 24) · ×1
  • reviewtransaction.classifyCompactCorrectionTarget (cognitive 24) internal/reviewtransaction/compact_store.go:1203 — reviewtransaction.classifyCompactCorrectionTarget has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.parseCompactRecord (cognitive 24) · ×1
  • reviewtransaction.parseCompactRecord (cognitive 24) internal/reviewtransaction/compact_store.go:1929 — reviewtransaction.parseCompactRecord has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.WithdrawUnachievableLensAttempt (cognitive 24) · ×1
  • CompactStore.WithdrawUnachievableLensAttempt (cognitive 24) internal/reviewtransaction/compact_unachievable_lens.go:154 — CompactStore.WithdrawUnachievableLensAttempt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userWindowsChannelOverlay (cognitive 24) · ×1
  • shellinstaller.userWindowsChannelOverlay (cognitive 24) internal/shellinstaller/user_channel_overlay_windows.go:71 — shellinstaller.userWindowsChannelOverlay has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 2, match/switch 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userWindowsSecurity (cognitive 24) · ×1
  • shellinstaller.userWindowsSecurity (cognitive 24) REDACTED:29 — shellinstaller.userWindowsSecurity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, loops 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewBundleExport (cognitive 23) · ×1
  • cli.RunReviewBundleExport (cognitive 23) internal/cli/review.go:498 — cli.RunReviewBundleExport has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.openCodeTransportStartBound (cognitive 23) · ×1
  • cli.openCodeTransportStartBound (cognitive 23) internal/cli/review_opencode_transport.go:411 — cli.openCodeTransportStartBound has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewCaptureRefuter (cognitive 23) · ×1
  • cli.RunReviewCaptureRefuter (cognitive 23) internal/cli/review_provider_role_capture.go:185 — cli.RunReviewCaptureRefuter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewProviderAdmitRefuterRaw (cognitive 23) · ×1
  • cli.reviewProviderAdmitRefuterRaw (cognitive 23) internal/cli/review_provider_roles.go:481 — cli.reviewProviderAdmitRefuterRaw has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openCodePluginDependencyPreflightStep.Run (cognitive 23) · ×1
  • openCodePluginDependencyPreflightStep.Run (cognitive 23) internal/cli/run.go:1699 — openCodePluginDependencyPreflightStep.Run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (23 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agenthooks.InstallCodexTelemetry (cognitive 23) · ×1
  • agenthooks.InstallCodexTelemetry (cognitive 23) internal/components/agenthooks/codex_telemetry.go:15 — agenthooks.InstallCodexTelemetry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gga.literalWord (cognitive 23) · ×1
  • gga.literalWord (cognitive 23) internal/components/gga/provider.go:43 — gga.literalWord has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.permissionMap (cognitive 23) · ×1
  • legacyassets.permissionMap (cognitive 23) internal/components/legacyassets/opencode_settings.go:196 — legacyassets.permissionMap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.overlayConfiguredAssignments (cognitive 23) · ×1
  • opencode.overlayConfiguredAssignments (cognitive 23) internal/opencode/config_v2.go:118 — opencode.overlayConfiguredAssignments has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.discoverAuthorityDispositionRecord (cognitive 23) · ×1
  • reviewtransaction.discoverAuthorityDispositionRecord (cognitive 23) internal/reviewtransaction/authority_disposition_execute.go:528 — reviewtransaction.discoverAuthorityDispositionRecord has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.compactDiscardedWorkSummary (cognitive 23) · ×1
  • reviewtransaction.compactDiscardedWorkSummary (cognitive 23) internal/reviewtransaction/compact_abandon.go:97 — reviewtransaction.compactDiscardedWorkSummary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userPruneRemovedBackup (cognitive 23) · ×1
  • shellinstaller.userPruneRemovedBackup (cognitive 23) internal/shellinstaller/user_install_cleanup_unix.go:89 — shellinstaller.userPruneRemovedBackup has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userPublishManifest (cognitive 23) · ×1
  • shellinstaller.userPublishManifest (cognitive 23) internal/shellinstaller/user_install_flow_unix.go:626 — shellinstaller.userPublishManifest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, loops 1 (nesting depth added 3). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userNativeReadback (cognitive 23) · ×1
  • shellinstaller.userNativeReadback (cognitive 23) internal/shellinstaller/user_install_flow_unix.go:1043 — shellinstaller.userNativeReadback has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (nesting depth added 2). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · shellinstaller.userWindowsZIP (cognitive 23) · ×1
  • shellinstaller.userWindowsZIP (cognitive 23) internal/shellinstaller/user_artifacts_windows.go:228 — shellinstaller.userWindowsZIP has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsOverlayToStable (cognitive 23) · ×1
  • shellinstaller.userWindowsOverlayToStable (cognitive 23) internal/shellinstaller/user_channel_overlay_windows.go:235 — shellinstaller.userWindowsOverlayToStable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsPruneRemovedBackup (cognitive 23) · ×1
  • shellinstaller.userWindowsPruneRemovedBackup (cognitive 23) internal/shellinstaller/user_install_cleanup_windows.go:67 — shellinstaller.userWindowsPruneRemovedBackup has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.ParseClaudeTranscriptTail (cognitive 23) · ×1
  • telemetry.ParseClaudeTranscriptTail (cognitive 23) internal/telemetry/runtime_claude.go:166 — telemetry.ParseClaudeTranscriptTail has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderUserInstallDestination (cognitive 23) · ×1
  • screens.RenderUserInstallDestination (cognitive 23) internal/tui/screens/user_install_destination.go:13 — screens.RenderUserInstallDestination has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update.checkSingleTool (cognitive 23) · ×1
  • update.checkSingleTool (cognitive 23) internal/update/check.go:60 — update.checkSingleTool has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pi.selectPackageBin (cognitive 22) · ×1
  • pi.selectPackageBin (cognitive 22) internal/agents/pi/model_routing.go:124 — pi.selectPackageBin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backup.ExtractArchive (cognitive 22) · ×1
  • backup.ExtractArchive (cognitive 22) REDACTED:91 — backup.ExtractArchive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.verifiedCandidateCausalFindingIDs (cognitive 22) · ×1
  • cli.verifiedCandidateCausalFindingIDs (cognitive 22) internal/cli/review_artifact.go:567 — cli.verifiedCandidateCausalFindingIDs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.openCodePluginPackageManager (cognitive 22) · ×1
  • cli.openCodePluginPackageManager (cognitive 22) internal/cli/run.go:1925 — cli.openCodePluginPackageManager has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.syncPersonaPathsWithWorkspaceScoped (cognitive 22) · ×1
  • cli.syncPersonaPathsWithWorkspaceScoped (cognitive 22) REDACTED:1060 — cli.syncPersonaPathsWithWorkspaceScoped has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.RenderRouting (cognitive 22) · ×1
  • agentguidance.RenderRouting (cognitive 22) internal/components/agentguidance/routing.go:100 — agentguidance.RenderRouting has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20 (22 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · filemerge.jsonValueEnd (cognitive 22) · ×1
  • filemerge.jsonValueEnd (cognitive 22) internal/components/filemerge/jsonc_members.go:194 — filemerge.jsonValueEnd has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 3 (7 pts), boolean chains 5, if/else 2 (5 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminimodules.MigrateLegacyRoot (cognitive 22) · ×1
  • geminimodules.MigrateLegacyRoot (cognitive 22) internal/components/geminimodules/migrate.go:19 — geminimodules.MigrateLegacyRoot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewassets.renderNativeAgent (cognitive 22) · ×1
  • reviewassets.renderNativeAgent (cognitive 22) internal/components/reviewassets/install.go:231 — reviewassets.renderNativeAgent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.resolveManagedLauncher (cognitive 22) · ×1
  • opencode.resolveManagedLauncher (cognitive 22) internal/opencode/background_readiness.go:906 — opencode.resolveManagedLauncher has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.parseV2ModelAPI (cognitive 22) · ×1
  • opencode.parseV2ModelAPI (cognitive 22) internal/opencode/catalog.go:148 — opencode.parseV2ModelAPI has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateBundleExpectation (cognitive 22) · ×1
  • reviewtransaction.validateBundleExpectation (cognitive 22) internal/reviewtransaction/bundle.go:202 — reviewtransaction.validateBundleExpectation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.compactAuthorityGraphViolations (cognitive 22) · ×1
  • reviewtransaction.compactAuthorityGraphViolations (cognitive 22) internal/reviewtransaction/compact_store.go:908 — reviewtransaction.compactAuthorityGraphViolations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateGateRequest (cognitive 22) · ×1
  • reviewtransaction.validateGateRequest (cognitive 22) internal/reviewtransaction/gate.go:636 — reviewtransaction.validateGateRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, match/switch 2 (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.
D2 · Cognitive Complexity · reviewtransaction.detectRenamePairs (cognitive 22) · ×1
  • reviewtransaction.detectRenamePairs (cognitive 22) internal/reviewtransaction/risk.go:1179 — reviewtransaction.detectRenamePairs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactAtomicStartBinding.Validate (cognitive 22) · ×1
  • CompactAtomicStartBinding.Validate (cognitive 22) internal/reviewtransaction/compact.go:358 — CompactAtomicStartBinding.Validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CompactStore.RecordInconclusiveTargetedValidatorAttempt (cognitive 22) · ×1
  • CompactStore.RecordInconclusiveTargetedValidatorAttempt (cognitive 22) internal/reviewtransaction/compact_reviewer_capture.go:917 — CompactStore.RecordInconclusiveTargetedValidatorAttempt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SnapshotBuilder.buildHeadWithIntended (cognitive 22) · ×1
  • SnapshotBuilder.buildHeadWithIntended (cognitive 22) internal/reviewtransaction/snapshot.go:277 — SnapshotBuilder.buildHeadWithIntended has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.loadChain (cognitive 22) · ×1
  • Store.loadChain (cognitive 22) internal/reviewtransaction/store.go:360 — Store.loadChain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userStageContext7 (cognitive 22) · ×1
  • shellinstaller.userStageContext7 (cognitive 22) internal/shellinstaller/user_context7_stage_unix.go:18 — shellinstaller.userStageContext7 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 5, loops 1 (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.
D2 · Cognitive Complexity · shellinstaller.userToolsAcquire (cognitive 22) · ×1
  • shellinstaller.userToolsAcquire (cognitive 22) internal/shellinstaller/user_install_flow_unix.go:876 — shellinstaller.userToolsAcquire has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, loops 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userServiceWithPlan (cognitive 22) · ×1
  • shellinstaller.userServiceWithPlan (cognitive 22) REDACTED:192 — shellinstaller.userServiceWithPlan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 2 (nesting depth added 2). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.PreviewUserInstall (cognitive 22) · ×1
  • shellinstaller.PreviewUserInstall (cognitive 22) internal/shellinstaller/user_install_preview.go:13 — shellinstaller.PreviewUserInstall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Storage.RunDailyRollup (cognitive 22) · ×1
  • Storage.RunDailyRollup (cognitive 22) internal/telemetrycollector/rollup.go:105 — Storage.RunDailyRollup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderInstalling (cognitive 22) · ×1
  • screens.RenderInstalling (cognitive 22) internal/tui/screens/installing.go:24 — screens.RenderInstalling has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (8 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.handleModelNav (cognitive 22) · ×1
  • screens.handleModelNav (cognitive 22) internal/tui/screens/model_picker.go:386 — screens.handleModelNav has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · claude.mergeUserConfig (cognitive 21) · ×1
  • claude.mergeUserConfig (cognitive 21) internal/agents/claude/adapter.go:104 — claude.mergeUserConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runReviewOpenCodeTransportFrames (cognitive 21) · ×1
  • cli.runReviewOpenCodeTransportFrames (cognitive 21) internal/cli/review_opencode_transport.go:260 — cli.runReviewOpenCodeTransportFrames has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.newReviewActionEligibility (cognitive 21) · ×1
  • cli.newReviewActionEligibility (cognitive 21) internal/cli/review_status_contract.go:293 — cli.newReviewActionEligibility has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.migrateLegacyOpenCodeAgents (cognitive 21) · ×1
  • cli.migrateLegacyOpenCodeAgents (cognitive 21) internal/cli/run.go:2245 — cli.migrateLegacyOpenCodeAgents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.userDeniesQuestion (cognitive 21) · ×1
  • cli.userDeniesQuestion (cognitive 21) internal/cli/run.go:2454 — cli.userDeniesQuestion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunShellInstallInline (cognitive 21) · ×1
  • cli.RunShellInstallInline (cognitive 21) internal/cli/shell_install.go:151 — cli.RunShellInstallInline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.restoreOpenCodeModelAssignmentsFromState (cognitive 21) · ×1
  • cli.restoreOpenCodeModelAssignmentsFromState (cognitive 21) REDACTED:2489 — cli.restoreOpenCodeModelAssignmentsFromState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · checkDependenciesStep.Run (cognitive 21) · ×1
  • checkDependenciesStep.Run (cognitive 21) internal/cli/run.go:5047 — checkDependenciesStep.Run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.resolveRoutingDelivery (cognitive 21) · ×1
  • agentguidance.resolveRoutingDelivery (cognitive 21) internal/components/agentguidance/inject.go:245 — agentguidance.resolveRoutingDelivery has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.DownloadLatestBinary (cognitive 21) · ×1
  • engram.DownloadLatestBinary (cognitive 21) REDACTED:146 — engram.DownloadLatestBinary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (21 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · engram.classifyAntigravityOwnershipTransferFailure (cognitive 21) · ×1
  • engram.classifyAntigravityOwnershipTransferFailure (cognitive 21) internal/components/engram/inject.go:603 — engram.classifyAntigravityOwnershipTransferFailure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.removeManagedAntigravityGlobalEngram (cognitive 21) · ×1
  • engram.removeManagedAntigravityGlobalEngram (cognitive 21) internal/components/engram/inject.go:1671 — engram.removeManagedAntigravityGlobalEngram has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.RemoveJSONCMembers (cognitive 21) · ×1
  • filemerge.RemoveJSONCMembers (cognitive 21) internal/components/filemerge/jsonc_members.go:17 — filemerge.RemoveJSONCMembers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · persona.mergeJSONFile (cognitive 21) · ×1
  • persona.mergeJSONFile (cognitive 21) internal/components/persona/inject.go:736 — persona.mergeJSONFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · persona.removeJSONNestedSubKey (cognitive 21) · ×1
  • persona.removeJSONNestedSubKey (cognitive 21) internal/components/persona/inject.go:1096 — persona.removeJSONNestedSubKey has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · opencode.NativeConfig (cognitive 21) · ×1
  • opencode.NativeConfig (cognitive 21) internal/opencode/config_format.go:13 — opencode.NativeConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.AcknowledgedBoundaryCommit (cognitive 21) · ×1
  • reviewtransaction.AcknowledgedBoundaryCommit (cognitive 21) internal/reviewtransaction/acknowledged_predecessor.go:58 — reviewtransaction.AcknowledgedBoundaryCommit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.loadCompactRecoveryRecordsUnderMaintenanceHold (cognitive 21) · ×1
  • reviewtransaction.loadCompactRecoveryRecordsUnderMaintenanceHold (cognitive 21) internal/reviewtransaction/authority_disposition_execute.go:467 — reviewtransaction.loadCompactRecoveryRecordsUnderMaintenanceHold has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.scanLegacyAuthorityRepairOnce (cognitive 21) · ×1
  • reviewtransaction.scanLegacyAuthorityRepairOnce (cognitive 21) internal/reviewtransaction/authority_repair.go:492 — reviewtransaction.scanLegacyAuthorityRepairOnce has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.loadCompactRecoveryRecords (cognitive 21) · ×1
  • reviewtransaction.loadCompactRecoveryRecords (cognitive 21) internal/reviewtransaction/compact_inspect.go:129 — reviewtransaction.loadCompactRecoveryRecords has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.deriveSnapshotRiskReasons (cognitive 21) · ×1
  • reviewtransaction.deriveSnapshotRiskReasons (cognitive 21) internal/reviewtransaction/risk.go:813 — reviewtransaction.deriveSnapshotRiskReasons has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.storeResetUnrecognized (cognitive 21) · ×1
  • reviewtransaction.storeResetUnrecognized (cognitive 21) internal/reviewtransaction/store_reset.go:457 — reviewtransaction.storeResetUnrecognized has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.projectTargetStatusDecision (cognitive 21) · ×1
  • reviewtransaction.projectTargetStatusDecision (cognitive 21) internal/reviewtransaction/target_status.go:844 — reviewtransaction.projectTargetStatusDecision has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 10 (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.
D2 · Cognitive Complexity · AuthorityRepairAssessment.Validate (cognitive 21) · ×1
  • AuthorityRepairAssessment.Validate (cognitive 21) internal/reviewtransaction/authority_repair.go:772 — AuthorityRepairAssessment.Validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · authorityRepairScan.run (cognitive 21) · ×1
  • authorityRepairScan.run (cognitive 21) internal/reviewtransaction/authority_repair.go:205 — authorityRepairScan.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactStore.resolveAdmittedReviewerResult (cognitive 21) · ×1
  • CompactStore.resolveAdmittedReviewerResult (cognitive 21) internal/reviewtransaction/compact_reviewer_capture.go:290 — CompactStore.resolveAdmittedReviewerResult has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Store.installBundle (cognitive 21) · ×1
  • Store.installBundle (cognitive 21) internal/reviewtransaction/bundle.go:241 — Store.installBundle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userEngramDecide (cognitive 21) · ×1
  • shellinstaller.userEngramDecide (cognitive 21) internal/shellinstaller/user_engram_shared.go:92 — shellinstaller.userEngramDecide has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, match/switch 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userStageConfigFiles (cognitive 21) · ×1
  • shellinstaller.userStageConfigFiles (cognitive 21) internal/shellinstaller/user_experience_stage_unix.go:39 — shellinstaller.userStageConfigFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userToolMember (cognitive 21) · ×1
  • shellinstaller.userToolMember (cognitive 21) internal/shellinstaller/user_install_unix.go:370 — shellinstaller.userToolMember has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.newUserNativeSlice (cognitive 21) · ×1
  • shellinstaller.newUserNativeSlice (cognitive 21) internal/shellinstaller/user_native_slice_linux.go:43 — shellinstaller.newUserNativeSlice has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userPNPMCopyFileWithSync (cognitive 21) · ×1
  • shellinstaller.userPNPMCopyFileWithSync (cognitive 21) REDACTED:218 — shellinstaller.userPNPMCopyFileWithSync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsOverlayToMain (cognitive 21) · ×1
  • shellinstaller.userWindowsOverlayToMain (cognitive 21) internal/shellinstaller/user_channel_overlay_windows.go:158 — shellinstaller.userWindowsOverlayToMain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 3, boolean chains 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userWindowsPublishLauncher (cognitive 21) · ×1
  • shellinstaller.userWindowsPublishLauncher (cognitive 21) internal/shellinstaller/user_shell_launcher_windows.go:69 — shellinstaller.userWindowsPublishLauncher has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetrycollector.validateRuntimeStorage (cognitive 21) · ×1
  • telemetrycollector.validateRuntimeStorage (cognitive 21) internal/telemetrycollector/runtime_storage.go:103 — telemetrycollector.validateRuntimeStorage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Storage.InsertRuntimeEvent (cognitive 21) · ×1
  • Storage.InsertRuntimeEvent (cognitive 21) internal/telemetrycollector/runtime_storage.go:172 — Storage.InsertRuntimeEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.HandleCodexModelPickerNav (cognitive 21) · ×1
  • screens.HandleCodexModelPickerNav (cognitive 21) internal/tui/screens/codex_model_picker.go:225 — screens.HandleCodexModelPickerNav has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderSkillPicker (cognitive 21) · ×1
  • screens.RenderSkillPicker (cognitive 21) internal/tui/screens/skill_picker.go:49 — screens.RenderSkillPicker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pi.ResolvePackageBin (cognitive 20) · ×1
  • pi.ResolvePackageBin (cognitive 20) internal/agents/pi/model_routing.go:57 — pi.ResolvePackageBin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · pi.scanJSONValue (cognitive 20) · ×1
  • pi.scanJSONValue (cognitive 20) internal/agents/pi/model_routing.go:224 — pi.scanJSONValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewCaptureCorrectionPlan (cognitive 20) · ×1
  • cli.RunReviewCaptureCorrectionPlan (cognitive 20) internal/cli/review_correction_plan_capture.go:28 — cli.RunReviewCaptureCorrectionPlan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.reviewMissingCaptureTransition (cognitive 20) · ×1
  • cli.reviewMissingCaptureTransition (cognitive 20) internal/cli/review_next_transition.go:633 — cli.reviewMissingCaptureTransition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewRecoveryCollection (cognitive 20) · ×1
  • cli.reviewRecoveryCollection (cognitive 20) internal/cli/review_next_transition.go:1176 — cli.reviewRecoveryCollection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.decodeOpenCodeTaskHostOutput (cognitive 20) · ×1
  • cli.decodeOpenCodeTaskHostOutput (cognitive 20) internal/cli/review_opencode_transport.go:738 — cli.decodeOpenCodeTaskHostOutput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewIntegrationConsentResult.Validate (cognitive 20) · ×1
  • ReviewIntegrationConsentResult.Validate (cognitive 20) internal/cli/review_consent_contract.go:299 — ReviewIntegrationConsentResult.Validate has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (9 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · reviewTransitionSelector.recoveryArguments (cognitive 20) · ×1
  • reviewTransitionSelector.recoveryArguments (cognitive 20) internal/cli/review_next_transition.go:1227 — reviewTransitionSelector.recoveryArguments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewTargetStatusProjection.Validate (cognitive 20) · ×1
  • ReviewTargetStatusProjection.Validate (cognitive 20) internal/cli/review_status_contract.go:1913 — ReviewTargetStatusProjection.Validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antigravityrules.splitBody (cognitive 20) · ×1
  • antigravityrules.splitBody (cognitive 20) internal/components/antigravityrules/render.go:182 — antigravityrules.splitBody has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 5 (8 pts), boolean chains 2 (nesting depth added 9). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · filemerge.rejectDuplicateJSONKeys (cognitive 20) · ×1
  • filemerge.rejectDuplicateJSONKeys (cognitive 20) REDACTED:320 — filemerge.rejectDuplicateJSONKeys has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 328). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · uninstall.engramOperations (cognitive 20) · ×1
  • uninstall.engramOperations (cognitive 20) internal/components/uninstall/service.go:1511 — uninstall.engramOperations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ActivationPlan.Rollback (cognitive 20) · ×1
  • ActivationPlan.Rollback (cognitive 20) internal/opencode/background.go:787 — ActivationPlan.Rollback has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · releasepolicy.validateSnapshotFile (cognitive 20) · ×1
  • releasepolicy.validateSnapshotFile (cognitive 20) internal/releasepolicy/policy.go:508 — releasepolicy.validateSnapshotFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactReviewInput (cognitive 20) · ×1
  • reviewtransaction.validateCompactReviewInput (cognitive 20) internal/reviewtransaction/compact.go:1797 — reviewtransaction.validateCompactReviewInput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.SanctionedCompactRecoveryExits (cognitive 20) · ×1
  • reviewtransaction.SanctionedCompactRecoveryExits (cognitive 20) internal/reviewtransaction/compact_inspect.go:199 — reviewtransaction.SanctionedCompactRecoveryExits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.publishPrivateRARImmutable (cognitive 20) · ×1
  • reviewtransaction.publishPrivateRARImmutable (cognitive 20) internal/reviewtransaction/rar_path_safety.go:309 — reviewtransaction.publishPrivateRARImmutable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.ValidateTargetedValidationRequest (cognitive 20) · ×1
  • reviewtransaction.ValidateTargetedValidationRequest (cognitive 20) internal/reviewtransaction/targeted_validation_request.go:208 — reviewtransaction.ValidateTargetedValidationRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.verificationDocumentContentActivity (cognitive 20) · ×1
  • reviewtransaction.verificationDocumentContentActivity (cognitive 20) internal/reviewtransaction/verification_contract.go:1093 — reviewtransaction.verificationDocumentContentActivity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RARAuthorityRepository.resolve (cognitive 20) · ×1
  • RARAuthorityRepository.resolve (cognitive 20) internal/reviewtransaction/rar_authority_repository.go:476 — RARAuthorityRepository.resolve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 6. 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.
D2 · Cognitive Complexity · SnapshotBuilder.renameAwareSavings (cognitive 20) · ×1
  • SnapshotBuilder.renameAwareSavings (cognitive 20) internal/reviewtransaction/risk.go:1073 — SnapshotBuilder.renameAwareSavings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userSetAsideAgentTools (cognitive 20) · ×1
  • shellinstaller.userSetAsideAgentTools (cognitive 20) internal/shellinstaller/user_agent_tools_unix.go:123 — shellinstaller.userSetAsideAgentTools has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userReuseWalk (cognitive 20) · ×1
  • shellinstaller.userReuseWalk (cognitive 20) internal/shellinstaller/user_install_scope_unix.go:52 — shellinstaller.userReuseWalk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userReadMainArchive (cognitive 20) · ×1
  • shellinstaller.userReadMainArchive (cognitive 20) internal/shellinstaller/user_main_custody_unix.go:65 — shellinstaller.userReadMainArchive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userNativeExecutionCheck (cognitive 20) · ×1
  • shellinstaller.userNativeExecutionCheck (cognitive 20) internal/shellinstaller/user_native_guard_linux.go:92 — shellinstaller.userNativeExecutionCheck has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userPNPMRelocation (cognitive 20) · ×1
  • shellinstaller.userPNPMRelocation (cognitive 20) REDACTED:170 — shellinstaller.userPNPMRelocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeInstallerRuntime.Prepare (cognitive 20) · ×1
  • NativeInstallerRuntime.Prepare (cognitive 20) internal/shellinstaller/user_native_bootstrap_unix.go:18 — NativeInstallerRuntime.Prepare has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, loops 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · NativeInstallerRuntime.produceForDestination (cognitive 20) · ×1
  • NativeInstallerRuntime.produceForDestination (cognitive 20) internal/shellinstaller/user_native_install_linux.go:18 — NativeInstallerRuntime.produceForDestination has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, loops 1 (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.
D2 · Cognitive Complexity · Model.optionCount (cognitive 20) · ×1
  • Model.optionCount (cognitive 20) internal/tui/model.go:3979 — Model.optionCount has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderShellReady (cognitive 20) · ×1
  • screens.RenderShellReady (cognitive 20) internal/tui/screens/shell_experience.go:84 — screens.RenderShellReady has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderShellManage (cognitive 20) · ×1
  • screens.RenderShellManage (cognitive 20) internal/tui/screens/shell_manage.go:17 — screens.RenderShellManage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3, boolean chains 2 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderShellWelcomeMinimum (cognitive 20) · ×1
  • screens.renderShellWelcomeMinimum (cognitive 20) internal/tui/screens/welcome.go:198 — screens.renderShellWelcomeMinimum has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · pi.repairPiEngramPackages (cognitive 19) · ×1
  • pi.repairPiEngramPackages (cognitive 19) internal/agents/pi/adapter.go:704 — pi.repairPiEngramPackages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.selfUpdate (cognitive 19) · ×1
  • app.selfUpdate (cognitive 19) internal/app/selfupdate.go:86 — app.selfUpdate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.RestoreManagedBackup (cognitive 19) · ×1
  • cli.RestoreManagedBackup (cognitive 19) internal/cli/codex_home.go:16 — cli.RestoreManagedBackup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewProviderMaterializeEvidence (cognitive 19) · ×1
  • cli.reviewProviderMaterializeEvidence (cognitive 19) internal/cli/review_provider_roles.go:378 — cli.reviewProviderMaterializeEvidence has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compatibilitySkillsRefreshStep.Run (cognitive 19) · ×1
  • compatibilitySkillsRefreshStep.Run (cognitive 19) internal/cli/compatibility_skills.go:161 — compatibilitySkillsRefreshStep.Run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.permissionRules (cognitive 19) · ×1
  • legacyassets.permissionRules (cognitive 19) internal/components/legacyassets/opencode_settings.go:232 — legacyassets.permissionRules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActivationPlan.rollbackProfiles (cognitive 19) · ×1
  • ActivationPlan.rollbackProfiles (cognitive 19) internal/opencode/background_profile.go:291 — ActivationPlan.rollbackProfiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startupPathModel.enterBlocks (cognitive 19) · ×1
  • startupPathModel.enterBlocks (cognitive 19) internal/opencode/background_readiness.go:544 — startupPathModel.enterBlocks has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (7 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · providercontractbundle.canonicalOrchestrationEntries (cognitive 19) · ×1
  • providercontractbundle.canonicalOrchestrationEntries (cognitive 19) internal/providercontractbundle/bundle.go:179 — providercontractbundle.canonicalOrchestrationEntries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.artifactReferenceTokens (cognitive 19) · ×1
  • reviewtransaction.artifactReferenceTokens (cognitive 19) internal/reviewtransaction/artifact_admission.go:1025 — reviewtransaction.artifactReferenceTokens has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateClassifiedRepairResidue (cognitive 19) · ×1
  • reviewtransaction.validateClassifiedRepairResidue (cognitive 19) internal/reviewtransaction/classified_authority_replay.go:334 — reviewtransaction.validateClassifiedRepairResidue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.parseFindingLocation (cognitive 19) · ×1
  • reviewtransaction.parseFindingLocation (cognitive 19) internal/reviewtransaction/compact.go:1977 — reviewtransaction.parseFindingLocation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.classifyCompactTargetRelation (cognitive 19) · ×1
  • reviewtransaction.classifyCompactTargetRelation (cognitive 19) internal/reviewtransaction/compact_target_relation.go:45 — reviewtransaction.classifyCompactTargetRelation has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · reviewtransaction.BuildCorrectionPlanRequest (cognitive 19) · ×1
  • reviewtransaction.BuildCorrectionPlanRequest (cognitive 19) internal/reviewtransaction/correction_plan_request.go:41 — reviewtransaction.BuildCorrectionPlanRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.inspectHistoricalLegacyAlias (cognitive 19) · ×1
  • reviewtransaction.inspectHistoricalLegacyAlias (cognitive 19) internal/reviewtransaction/legacy_alias_repair.go:175 — reviewtransaction.inspectHistoricalLegacyAlias has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.ensureMaintenanceLockPath (cognitive 19) · ×1
  • reviewtransaction.ensureMaintenanceLockPath (cognitive 19) internal/reviewtransaction/store_lock.go:294 — reviewtransaction.ensureMaintenanceLockPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.targetStatusForCandidate (cognitive 19) · ×1
  • reviewtransaction.targetStatusForCandidate (cognitive 19) internal/reviewtransaction/target_status.go:782 — reviewtransaction.targetStatusForCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactState.CompleteCorrection (cognitive 19) · ×1
  • CompactState.CompleteCorrection (cognitive 19) internal/reviewtransaction/compact.go:2220 — CompactState.CompleteCorrection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · SnapshotBuilder.ClassifyVerificationApplicability (cognitive 19) · ×1
  • SnapshotBuilder.ClassifyVerificationApplicability (cognitive 19) internal/reviewtransaction/verification_contract.go:853 — SnapshotBuilder.ClassifyVerificationApplicability has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 2). 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.
D2 · Cognitive Complexity · Transaction.FreezeFindings (cognitive 19) · ×1
  • Transaction.FreezeFindings (cognitive 19) internal/reviewtransaction/transaction.go:469 — Transaction.FreezeFindings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userCarryAgentStateEntries (cognitive 19) · ×1
  • shellinstaller.userCarryAgentStateEntries (cognitive 19) internal/shellinstaller/user_agent_state.go:34 — shellinstaller.userCarryAgentStateEntries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userCarryTree (cognitive 19) · ×1
  • shellinstaller.userCarryTree (cognitive 19) internal/shellinstaller/user_agent_state.go:72 — shellinstaller.userCarryTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userPlanAgentToolsRestore (cognitive 19) · ×1
  • shellinstaller.userPlanAgentToolsRestore (cognitive 19) internal/shellinstaller/user_agent_tools_unix.go:217 — shellinstaller.userPlanAgentToolsRestore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userAcquireCodeGraphArchives (cognitive 19) · ×1
  • shellinstaller.userAcquireCodeGraphArchives (cognitive 19) internal/shellinstaller/user_codegraph_library_unix.go:77 — shellinstaller.userAcquireCodeGraphArchives has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userContext7Update (cognitive 19) · ×1
  • shellinstaller.userContext7Update (cognitive 19) internal/shellinstaller/user_experience_private_unix.go:73 — shellinstaller.userContext7Update has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3 (nesting depth added 8). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 74). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · shellinstaller.userTools (cognitive 19) · ×1
  • shellinstaller.userTools (cognitive 19) internal/shellinstaller/user_install_flow_unix.go:941 — shellinstaller.userTools has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userProvisionAssets (cognitive 19) · ×1
  • shellinstaller.userProvisionAssets (cognitive 19) internal/shellinstaller/user_install_flow_unix.go:975 — shellinstaller.userProvisionAssets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.RunUserEntry (cognitive 19) · ×1
  • shellinstaller.RunUserEntry (cognitive 19) REDACTED:447 — shellinstaller.RunUserEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userPNPMPayloadInventory (cognitive 19) · ×1
  • shellinstaller.userPNPMPayloadInventory (cognitive 19) internal/shellinstaller/user_pnpm_seal_unix.go:40 — shellinstaller.userPNPMPayloadInventory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 48). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · shellinstaller.userStageWindowsAdvancedChoices (cognitive 19) · ×1
  • shellinstaller.userStageWindowsAdvancedChoices (cognitive 19) internal/shellinstaller/user_experience_stage_windows.go:97 — shellinstaller.userStageWindowsAdvancedChoices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (19 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderCommunityToolResultDetails (cognitive 19) · ×1
  • screens.renderCommunityToolResultDetails (cognitive 19) internal/tui/screens/community_tool_result.go:41 — screens.renderCommunityToolResultDetails has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.RenderCommunityTools (cognitive 19) · ×1
  • screens.RenderCommunityTools (cognitive 19) internal/tui/screens/community_tools.go:12 — screens.RenderCommunityTools has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update.fetchBetaModulePath (cognitive 19) · ×1
  • update.fetchBetaModulePath (cognitive 19) internal/update/github.go:117 — update.fetchBetaModulePath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update.fetchLatestReleaseMatchingPattern (cognitive 19) · ×1
  • update.fetchLatestReleaseMatchingPattern (cognitive 19) internal/update/github.go:181 — update.fetchLatestReleaseMatchingPattern has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentbuilder.uninstallFromAdapter (cognitive 18) · ×1
  • agentbuilder.uninstallFromAdapter (cognitive 18) internal/agentbuilder/uninstall.go:166 — agentbuilder.uninstallFromAdapter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.runSkillRegistryRefresh (cognitive 18) · ×1
  • app.runSkillRegistryRefresh (cognitive 18) internal/app/app.go:439 — app.runSkillRegistryRefresh has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.validateReviewTransitionSelectorFlagCounts (cognitive 18) · ×1
  • cli.validateReviewTransitionSelectorFlagCounts (cognitive 18) internal/cli/review_facade.go:2885 — cli.validateReviewTransitionSelectorFlagCounts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.RunReviewMode (cognitive 18) · ×1
  • cli.RunReviewMode (cognitive 18) internal/cli/review_mode.go:46 — cli.RunReviewMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 5, match/switch 2. Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · ReviewGateDeniedError.Error (cognitive 18) · ×1
  • ReviewGateDeniedError.Error (cognitive 18) internal/cli/review.go:221 — ReviewGateDeniedError.Error has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentguidance.ApplyOpenCodeBackgroundPolicy (cognitive 18) · ×1
  • agentguidance.ApplyOpenCodeBackgroundPolicy (cognitive 18) internal/components/agentguidance/opencode_background.go:21 — agentguidance.ApplyOpenCodeBackgroundPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · engram.restoreAntigravityPluginAssets (cognitive 18) · ×1
  • engram.restoreAntigravityPluginAssets (cognitive 18) internal/components/engram/inject.go:383 — engram.restoreAntigravityPluginAssets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.codexTOMLTableBool (cognitive 18) · ×1
  • engram.codexTOMLTableBool (cognitive 18) internal/components/engram/inject.go:1084 — engram.codexTOMLTableBool has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.mergeJSONDefaultsForPathBody (cognitive 18) · ×1
  • filemerge.mergeJSONDefaultsForPathBody (cognitive 18) REDACTED:174 — filemerge.mergeJSONDefaultsForPathBody has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.ensureAtomicParentDir (cognitive 18) · ×1
  • filemerge.ensureAtomicParentDir (cognitive 18) internal/components/filemerge/writer.go:410 — filemerge.ensureAtomicParentDir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.readClaudeFile (cognitive 18) · ×1
  • telemetryruntime.readClaudeFile (cognitive 18) internal/components/telemetryruntime/claude.go:63 — telemetryruntime.readClaudeFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetryruntime.readCodexTranscriptTail (cognitive 18) · ×1
  • telemetryruntime.readCodexTranscriptTail (cognitive 18) internal/components/telemetryruntime/codex.go:91 — telemetryruntime.readCodexTranscriptTail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.readCodexAssignment (cognitive 18) · ×1
  • telemetryruntime.readCodexAssignment (cognitive 18) internal/components/telemetryruntime/codex.go:140 — telemetryruntime.readCodexAssignment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.DiscoverCodexModels (cognitive 18) · ×1
  • model.DiscoverCodexModels (cognitive 18) internal/model/codex_model.go:128 — model.DiscoverCodexModels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startupPathModel.resolve (cognitive 18) · ×1
  • startupPathModel.resolve (cognitive 18) internal/opencode/background_readiness.go:190 — startupPathModel.resolve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · planner.TopologicalSort (cognitive 18) · ×1
  • planner.TopologicalSort (cognitive 18) internal/planner/order.go:13 — planner.TopologicalSort has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.reconcileClassifiedAuthorityRepairRecord (cognitive 18) · ×1
  • reviewtransaction.reconcileClassifiedAuthorityRepairRecord (cognitive 18) internal/reviewtransaction/classified_authority_replay.go:275 — reviewtransaction.reconcileClassifiedAuthorityRepairRecord has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.AcknowledgeApprovedCompactAuthority (cognitive 18) · ×1
  • reviewtransaction.AcknowledgeApprovedCompactAuthority (cognitive 18) internal/reviewtransaction/compact_burn.go:147 — reviewtransaction.AcknowledgeApprovedCompactAuthority has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · reviewtransaction.ImportCompactTransport (cognitive 18) · ×1
  • reviewtransaction.ImportCompactTransport (cognitive 18) internal/reviewtransaction/compact_store.go:2550 — reviewtransaction.ImportCompactTransport has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.isOperationalMarkdownPath (cognitive 18) · ×1
  • reviewtransaction.isOperationalMarkdownPath (cognitive 18) internal/reviewtransaction/risk.go:1251 — reviewtransaction.isOperationalMarkdownPath has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), boolean chains 4, loops 2 (3 pts), if/else 1 (2 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PreparedCandidateInspector.Inspect (cognitive 18) · ×1
  • PreparedCandidateInspector.Inspect (cognitive 18) internal/reviewtransaction/frozen_candidate_context.go:344 — PreparedCandidateInspector.Inspect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VerificationPlan.validateStructure (cognitive 18) · ×1
  • VerificationPlan.validateStructure (cognitive 18) internal/reviewtransaction/verification_contract.go:521 — VerificationPlan.validateStructure has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userValidateInstallStage (cognitive 18) · ×1
  • shellinstaller.userValidateInstallStage (cognitive 18) internal/shellinstaller/user_install_stage_unix.go:28 — shellinstaller.userValidateInstallStage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userCompareMainSource (cognitive 18) · ×1
  • shellinstaller.userCompareMainSource (cognitive 18) internal/shellinstaller/user_main_source_unix.go:100 — shellinstaller.userCompareMainSource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 7. Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 114). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · shellinstaller.userWindowsCompareMain (cognitive 18) · ×1
  • shellinstaller.userWindowsCompareMain (cognitive 18) internal/shellinstaller/user_artifacts_windows.go:40 — shellinstaller.userWindowsCompareMain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 45). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · shellinstaller.userWindowsPruneReplacedBackups (cognitive 18) · ×1
  • shellinstaller.userWindowsPruneReplacedBackups (cognitive 18) internal/shellinstaller/user_backup_retention_windows.go:116 — shellinstaller.userWindowsPruneReplacedBackups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userWindowsVerifyArchive (cognitive 18) · ×1
  • shellinstaller.userWindowsVerifyArchive (cognitive 18) internal/shellinstaller/user_launch_windows.go:21 — shellinstaller.userWindowsVerifyArchive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · userPNPMInventoryReader.file (cognitive 18) · ×1
  • userPNPMInventoryReader.file (cognitive 18) REDACTED:83 — userPNPMInventoryReader.file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetry.SendRuntimeWithDeliveryID (cognitive 18) · ×1
  • telemetry.SendRuntimeWithDeliveryID (cognitive 18) internal/telemetry/runtime_send.go:34 — telemetry.SendRuntimeWithDeliveryID has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · telemetrycollector.fetchGithubReleaseDownloads (cognitive 18) · ×1
  • telemetrycollector.fetchGithubReleaseDownloads (cognitive 18) internal/telemetrycollector/downloads.go:143 — telemetrycollector.fetchGithubReleaseDownloads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.startInstallation (cognitive 18) · ×1
  • Model.startInstallation (cognitive 18) internal/tui/model.go:4903 — Model.startInstallation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts) (nesting depth added 7). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 4912). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · screens.RenderShellUpdate (cognitive 18) · ×1
  • screens.RenderShellUpdate (cognitive 18) internal/tui/screens/shell_update.go:10 — screens.RenderShellUpdate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · screens.RenderUninstallConfirm (cognitive 18) · ×1
  • screens.RenderUninstallConfirm (cognitive 18) internal/tui/screens/uninstall.go:223 — screens.RenderUninstallConfirm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update.RenderCLI (cognitive 18) · ×1
  • update.RenderCLI (cognitive 18) internal/update/render.go:10 — update.RenderCLI has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · upgrade.extractBinaryFromTarGz (cognitive 18) · ×1
  • upgrade.extractBinaryFromTarGz (cognitive 18) internal/update/upgrade/download.go:338 — upgrade.extractBinaryFromTarGz has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex.compareSemanticVersion (cognitive 17) · ×1
  • codex.compareSemanticVersion (cognitive 17) internal/agents/codex/runtime_version.go:135 — codex.compareSemanticVersion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backup.isPathUnderRoot (cognitive 17) · ×1
  • backup.isPathUnderRoot (cognitive 17) internal/backup/restore.go:39 — backup.isPathUnderRoot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.ResolveOpenCodeBackground (cognitive 17) · ×1
  • cli.ResolveOpenCodeBackground (cognitive 17) internal/cli/opencode_background.go:44 — cli.ResolveOpenCodeBackground has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.ResolvePiBackground (cognitive 17) · ×1
  • cli.ResolvePiBackground (cognitive 17) internal/cli/pi_background.go:62 — cli.ResolvePiBackground has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.reviewStatusRecoverySuccessor (cognitive 17) · ×1
  • cli.reviewStatusRecoverySuccessor (cognitive 17) internal/cli/review_facade.go:1836 — cli.reviewStatusRecoverySuccessor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.authorizeReviewStart (cognitive 17) · ×1
  • cli.authorizeReviewStart (cognitive 17) internal/cli/review_mode.go:827 — cli.authorizeReviewStart has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.reviewProviderAdmitRaw (cognitive 17) · ×1
  • cli.reviewProviderAdmitRaw (cognitive 17) internal/cli/review_provider.go:113 — cli.reviewProviderAdmitRaw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.RunReviewCaptureValidation (cognitive 17) · ×1
  • cli.RunReviewCaptureValidation (cognitive 17) internal/cli/review_provider_role_capture.go:258 — cli.RunReviewCaptureValidation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cli.openCodeSDKRunApprovedManager (cognitive 17) · ×1
  • cli.openCodeSDKRunApprovedManager (cognitive 17) internal/cli/run.go:1825 — cli.openCodeSDKRunApprovedManager has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. 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.
D2 · Cognitive Complexity · cli.verificationComponentPaths (cognitive 17) · ×1
  • cli.verificationComponentPaths (cognitive 17) internal/cli/run.go:4753 — cli.verificationComponentPaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runTelemetryStateCommand (cognitive 17) · ×1
  • cli.runTelemetryStateCommand (cognitive 17) internal/cli/telemetry.go:136 — cli.runTelemetryStateCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · unixCompatibilityDirectoryWriter.Write (cognitive 17) · ×1
  • unixCompatibilityDirectoryWriter.Write (cognitive 17) internal/cli/compatibility_writer_unix.go:60 — unixCompatibilityDirectoryWriter.Write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2. Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · codeGraphGuidanceSyncStep.Run (cognitive 17) · ×1
  • codeGraphGuidanceSyncStep.Run (cognitive 17) REDACTED:1359 — codeGraphGuidanceSyncStep.Run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · agentguidance.renderOrchestrator (cognitive 17) · ×1
  • agentguidance.renderOrchestrator (cognitive 17) internal/components/agentguidance/orchestrator.go:197 — agentguidance.renderOrchestrator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · agenthooks.pruneClaudeLegacySkillRegistryHooks (cognitive 17) · ×1
  • agenthooks.pruneClaudeLegacySkillRegistryHooks (cognitive 17) internal/components/agenthooks/skill_registry.go:32 — agenthooks.pruneClaudeLegacySkillRegistryHooks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communitytool.verifyPiMCPWithProbe (cognitive 17) · ×1
  • communitytool.verifyPiMCPWithProbe (cognitive 17) internal/components/communitytool/pi_codegraph.go:502 — communitytool.verifyPiMCPWithProbe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communitytool.inspectPiCodeGraph (cognitive 17) · ×1
  • communitytool.inspectPiCodeGraph (cognitive 17) internal/components/communitytool/pi_codegraph.go:715 — communitytool.inspectPiCodeGraph has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engram.injectAntigravityMutationsUnderLock (cognitive 17) · ×1
  • engram.injectAntigravityMutationsUnderLock (cognitive 17) internal/components/engram/inject.go:664 — engram.injectAntigravityMutationsUnderLock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · persona.preflightJSONCAgentCleanup (cognitive 17) · ×1
  • persona.preflightJSONCAgentCleanup (cognitive 17) internal/components/persona/inject.go:812 — persona.preflightJSONCAgentCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · opencode.ResolveRuntimeConfigForHome (cognitive 17) · ×1
  • opencode.ResolveRuntimeConfigForHome (cognitive 17) internal/opencode/config.go:45 — opencode.ResolveRuntimeConfigForHome has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.referenceOutsideRepository (cognitive 17) · ×1
  • reviewtransaction.referenceOutsideRepository (cognitive 17) internal/reviewtransaction/artifact_admission.go:936 — reviewtransaction.referenceOutsideRepository has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.validateCompactResultReopens (cognitive 17) · ×1
  • reviewtransaction.validateCompactResultReopens (cognitive 17) internal/reviewtransaction/compact.go:2060 — reviewtransaction.validateCompactResultReopens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.quarantineCompactStoreEntry (cognitive 17) · ×1
  • reviewtransaction.quarantineCompactStoreEntry (cognitive 17) internal/reviewtransaction/compact_reclaim.go:229 — reviewtransaction.quarantineCompactStoreEntry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · reviewtransaction.ensureCanonicalReviewQuarantineRoot (cognitive 17) · ×1
  • reviewtransaction.ensureCanonicalReviewQuarantineRoot (cognitive 17) internal/reviewtransaction/compact_reclaim.go:294 — reviewtransaction.ensureCanonicalReviewQuarantineRoot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.forensicHistoricalCompactRecord (cognitive 17) · ×1
  • reviewtransaction.forensicHistoricalCompactRecord (cognitive 17) internal/reviewtransaction/compact_store.go:2002 — reviewtransaction.forensicHistoricalCompactRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.RebuildCommittedBaseDiffCorrectionCandidate (cognitive 17) · ×1
  • reviewtransaction.RebuildCommittedBaseDiffCorrectionCandidate (cognitive 17) internal/reviewtransaction/snapshot.go:992 — reviewtransaction.RebuildCommittedBaseDiffCorrectionCandidate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2. 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.
D2 · Cognitive Complexity · reviewtransaction.storeResetLineages (cognitive 17) · ×1
  • reviewtransaction.storeResetLineages (cognitive 17) internal/reviewtransaction/store_reset.go:543 — reviewtransaction.storeResetLineages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.storeResetExecute (cognitive 17) · ×1
  • reviewtransaction.storeResetExecute (cognitive 17) internal/reviewtransaction/store_reset.go:643 — reviewtransaction.storeResetExecute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.explicitReviewingCompactCandidate (cognitive 17) · ×1
  • reviewtransaction.explicitReviewingCompactCandidate (cognitive 17) internal/reviewtransaction/target_status.go:684 — reviewtransaction.explicitReviewingCompactCandidate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.buildTargetedValidationRequest (cognitive 17) · ×1
  • reviewtransaction.buildTargetedValidationRequest (cognitive 17) internal/reviewtransaction/targeted_validation_request.go:53 — reviewtransaction.buildTargetedValidationRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. 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.
D2 · Cognitive Complexity · reviewtransaction.ValidateVerificationResultRef (cognitive 17) · ×1
  • reviewtransaction.ValidateVerificationResultRef (cognitive 17) internal/reviewtransaction/verification_contract.go:649 — reviewtransaction.ValidateVerificationResultRef has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transaction.CompleteFix (cognitive 17) · ×1
  • Transaction.CompleteFix (cognitive 17) internal/reviewtransaction/transaction.go:711 — Transaction.CompleteFix has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userManagerVersion (cognitive 17) · ×1
  • shellinstaller.userManagerVersion (cognitive 17) REDACTED:153 — shellinstaller.userManagerVersion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8 (nesting depth added 2). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.userMainSnapshotUsing (cognitive 17) · ×1
  • shellinstaller.userMainSnapshotUsing (cognitive 17) internal/shellinstaller/user_main_snapshot.go:79 — shellinstaller.userMainSnapshotUsing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · shellinstaller.userRemoveLauncherPath (cognitive 17) · ×1
  • shellinstaller.userRemoveLauncherPath (cognitive 17) internal/shellinstaller/user_shell_launcher_path_unix.go:251 — shellinstaller.userRemoveLauncherPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userShellLauncherNote (cognitive 17) · ×1
  • shellinstaller.userShellLauncherNote (cognitive 17) internal/shellinstaller/user_shell_launcher_unix.go:71 — shellinstaller.userShellLauncherNote has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userSealInheritedDescriptors (cognitive 17) · ×1
  • shellinstaller.userSealInheritedDescriptors (cognitive 17) internal/shellinstaller/user_supervise_darwin.go:197 — shellinstaller.userSealInheritedDescriptors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · system.resolvePlatformProfile (cognitive 17) · ×1
  • system.resolvePlatformProfile (cognitive 17) internal/system/detect.go:161 — system.resolvePlatformProfile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetry.NormalizeClaude (cognitive 17) · ×1
  • telemetry.NormalizeClaude (cognitive 17) internal/telemetry/runtime_claude.go:253 — telemetry.NormalizeClaude has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetry.openCodeBounded (cognitive 17) · ×1
  • telemetry.openCodeBounded (cognitive 17) internal/telemetry/runtime_opencode.go:271 — telemetry.openCodeBounded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderCodexCustomPhaseList (cognitive 17) · ×1
  • screens.renderCodexCustomPhaseList (cognitive 17) internal/tui/screens/codex_model_picker.go:566 — screens.renderCodexCustomPhaseList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · styles.parseRose (cognitive 17) · ×1
  • styles.parseRose (cognitive 17) internal/tui/styles/rose.go:51 — styles.parseRose has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode-review-transport.compareSemver (cognitive 17) · ×1
  • opencode-review-transport.compareSemver (cognitive 17) internal/assets/opencode/plugins/opencode-review-transport.ts:127 — opencode-review-transport.compareSemver has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 9). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentbuilder.Uninstall (cognitive 16) · ×1
  • agentbuilder.Uninstall (cognitive 16) internal/agentbuilder/uninstall.go:30 — agentbuilder.Uninstall has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Snapshotter.Create (cognitive 16) · ×1
  • Snapshotter.Create (cognitive 16) internal/backup/snapshot.go:32 — Snapshotter.Create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.excludeCodeGraphIndexLocally (cognitive 16) · ×1
  • cli.excludeCodeGraphIndexLocally (cognitive 16) internal/cli/codegraph.go:58 — cli.excludeCodeGraphIndexLocally has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, match/switch 1 (2 pts), loops 1 (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.
D2 · Cognitive Complexity · cli.doctorLauncherChain (cognitive 16) · ×1
  • cli.doctorLauncherChain (cognitive 16) internal/cli/doctor.go:374 — cli.doctorLauncherChain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.hasPiMCPAdapter (cognitive 16) · ×1
  • cli.hasPiMCPAdapter (cognitive 16) internal/cli/pi_mcp_diagnostic.go:60 — cli.hasPiMCPAdapter has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 2 (5 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · cli.reviewDerivedCommittedRangeSnapshot (cognitive 16) · ×1
  • cli.reviewDerivedCommittedRangeSnapshot (cognitive 16) internal/cli/review_facade.go:1773 — cli.reviewDerivedCommittedRangeSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewLensContextBudgetProbe (cognitive 16) · ×1
  • cli.reviewLensContextBudgetProbe (cognitive 16) internal/cli/review_lens_context.go:301 — cli.reviewLensContextBudgetProbe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.reviewStatusStartOptionCounts (cognitive 16) · ×1
  • cli.reviewStatusStartOptionCounts (cognitive 16) internal/cli/review_start_preflight.go:65 — cli.reviewStatusStartOptionCounts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewTransitionSubmission.validateProviderRoleCapture (cognitive 16) · ×1
  • ReviewTransitionSubmission.validateProviderRoleCapture (cognitive 16) internal/cli/review_status_contract.go:1573 — ReviewTransitionSubmission.validateProviderRoleCapture has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, loops 1 (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.
D2 · Cognitive Complexity · ReviewIntegrationOperationResult.Validate (cognitive 16) · ×1
  • ReviewIntegrationOperationResult.Validate (cognitive 16) internal/cli/review_operation_contract.go:1717 — ReviewIntegrationOperationResult.Validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antigravityrules.MigrateLegacyPrompt (cognitive 16) · ×1
  • antigravityrules.MigrateLegacyPrompt (cognitive 16) internal/components/antigravityrules/publish.go:149 — antigravityrules.MigrateLegacyPrompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · antigravityrules.Render (cognitive 16) · ×1
  • antigravityrules.Render (cognitive 16) internal/components/antigravityrules/render.go:106 — antigravityrules.Render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communitytool.stripKnownUpstreamCodeGraphLines (cognitive 16) · ×1
  • communitytool.stripKnownUpstreamCodeGraphLines (cognitive 16) internal/components/communitytool/codegraph_guidance.go:448 — communitytool.stripKnownUpstreamCodeGraphLines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communitytool.probePiCodeGraphMCPWithTransport (cognitive 16) · ×1
  • communitytool.probePiCodeGraphMCPWithTransport (cognitive 16) internal/components/communitytool/pi_codegraph.go:587 — communitytool.probePiCodeGraphMCPWithTransport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1 (nesting depth added 2). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · communitytool.releaseStalePiChildren (cognitive 16) · ×1
  • communitytool.releaseStalePiChildren (cognitive 16) internal/components/communitytool/pi_codegraph.go:948 — communitytool.releaseStalePiChildren has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.StripLegacyATLBlock (cognitive 16) · ×1
  • filemerge.StripLegacyATLBlock (cognitive 16) internal/components/filemerge/section.go:148 — filemerge.StripLegacyATLBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filemerge.writeFileAtomic (cognitive 16) · ×1
  • filemerge.writeFileAtomic (cognitive 16) internal/components/filemerge/writer.go:106 — filemerge.writeFileAtomic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.retiredSDDAssetItems (cognitive 16) · ×1
  • legacyassets.retiredSDDAssetItems (cognitive 16) internal/components/legacyassets/sdd_assets.go:101 — legacyassets.retiredSDDAssetItems has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (4 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacyassets.removeSDDOrchestratorBlock (cognitive 16) · ×1
  • legacyassets.removeSDDOrchestratorBlock (cognitive 16) internal/components/legacyassets/sdd_runtime_files.go:131 — legacyassets.removeSDDOrchestratorBlock has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), loops 2, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencodeplugin.installGentleLogo (cognitive 16) · ×1
  • opencodeplugin.installGentleLogo (cognitive 16) internal/components/opencodeplugin/plugin.go:157 — opencodeplugin.installGentleLogo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.SendClaude (cognitive 16) · ×1
  • telemetryruntime.SendClaude (cognitive 16) internal/components/telemetryruntime/claude.go:18 — telemetryruntime.SendClaude has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetryruntime.checkManagedPath (cognitive 16) · ×1
  • telemetryruntime.checkManagedPath (cognitive 16) internal/components/telemetryruntime/managed.go:72 — telemetryruntime.checkManagedPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · telemetryruntime.strictObjectKeys (cognitive 16) · ×1
  • telemetryruntime.strictObjectKeys (cognitive 16) internal/components/telemetryruntime/opencode.go:226 — telemetryruntime.strictObjectKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.shellVariableName (cognitive 16) · ×1
  • opencode.shellVariableName (cognitive 16) internal/opencode/background_readiness.go:765 — opencode.shellVariableName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode.splitShellCommands (cognitive 16) · ×1
  • opencode.splitShellCommands (cognitive 16) internal/opencode/background_readiness.go:810 — opencode.splitShellCommands has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (5 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · opencode.candidateConfigDirs (cognitive 16) · ×1
  • opencode.candidateConfigDirs (cognitive 16) internal/opencode/config.go:154 — opencode.candidateConfigDirs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalogFileReader.monitorSize (cognitive 16) · ×1
  • catalogFileReader.monitorSize (cognitive 16) internal/opencode/catalog.go:687 — catalogFileReader.monitorSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewerprovider.codexReviewerLoopbackBaseURL (cognitive 16) · ×1
  • reviewerprovider.codexReviewerLoopbackBaseURL (cognitive 16) internal/reviewerprovider/codex_adapter.go:140 — reviewerprovider.codexReviewerLoopbackBaseURL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. 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.
D2 · Cognitive Complexity · CodexAdapter.Review (cognitive 16) · ×1
  • CodexAdapter.Review (cognitive 16) internal/reviewerprovider/codex_adapter.go:42 — CodexAdapter.Review has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.artifactRepositoryPathReference (cognitive 16) · ×1
  • reviewtransaction.artifactRepositoryPathReference (cognitive 16) internal/reviewtransaction/artifact_admission.go:982 — reviewtransaction.artifactRepositoryPathReference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 1 (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.
D2 · Cognitive Complexity · reviewtransaction.reconstructAuthorityDispositionPlanForResume (cognitive 16) · ×1
  • reviewtransaction.reconstructAuthorityDispositionPlanForResume (cognitive 16) internal/reviewtransaction/authority_repair.go:1108 — reviewtransaction.reconstructAuthorityDispositionPlanForResume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.NewCompactState (cognitive 16) · ×1
  • reviewtransaction.NewCompactState (cognitive 16) internal/reviewtransaction/compact.go:759 — reviewtransaction.NewCompactState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.readPrivateRARFile (cognitive 16) · ×1
  • reviewtransaction.readPrivateRARFile (cognitive 16) internal/reviewtransaction/rar_path_safety.go:260 — reviewtransaction.readPrivateRARFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · reviewtransaction.validateReviewRepositoryContextRecord (cognitive 16) · ×1
  • reviewtransaction.validateReviewRepositoryContextRecord (cognitive 16) internal/reviewtransaction/repository_locator.go:598 — reviewtransaction.validateReviewRepositoryContextRecord has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.parseRawDiffModes (cognitive 16) · ×1
  • reviewtransaction.parseRawDiffModes (cognitive 16) internal/reviewtransaction/snapshot.go:666 — reviewtransaction.parseRawDiffModes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.canonicalGitDirectory (cognitive 16) · ×1
  • reviewtransaction.canonicalGitDirectory (cognitive 16) internal/reviewtransaction/snapshot.go:1131 — reviewtransaction.canonicalGitDirectory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reviewtransaction.inventoryVersion (cognitive 16) · ×1
  • reviewtransaction.inventoryVersion (cognitive 16) internal/reviewtransaction/status.go:233 — reviewtransaction.inventoryVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reviewtransaction.transactionsEqual (cognitive 16) · ×1
  • reviewtransaction.transactionsEqual (cognitive 16) internal/reviewtransaction/store.go:693 — reviewtransaction.transactionsEqual has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 2 (nesting depth added 2). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 694). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CompactState.ActiveAdmittedLensResult (cognitive 16) · ×1
  • CompactState.ActiveAdmittedLensResult (cognitive 16) internal/reviewtransaction/compact.go:1361 — CompactState.ActiveAdmittedLensResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userBeginAgentRollback (cognitive 16) · ×1
  • shellinstaller.userBeginAgentRollback (cognitive 16) REDACTED:54 — shellinstaller.userBeginAgentRollback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.userEntryExperience (cognitive 16) · ×1
  • shellinstaller.userEntryExperience (cognitive 16) internal/shellinstaller/user_experience_selection.go:18 — shellinstaller.userEntryExperience has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.privateNativeFile (cognitive 16) · ×1
  • shellinstaller.privateNativeFile (cognitive 16) REDACTED:32 — shellinstaller.privateNativeFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · shellinstaller.privateKernel (cognitive 16) · ×1
  • shellinstaller.privateKernel (cognitive 16) internal/shellinstaller/user_runtime_primitives_linux.go:131 — shellinstaller.privateKernel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.RemoveUserShellLauncher (cognitive 16) · ×1
  • shellinstaller.RemoveUserShellLauncher (cognitive 16) internal/shellinstaller/user_shell_launcher_unix.go:187 — shellinstaller.RemoveUserShellLauncher has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shellinstaller.privateACL (cognitive 16) · ×1
  • shellinstaller.privateACL (cognitive 16) REDACTED:231 — shellinstaller.privateACL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 1 (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.
D2 · Cognitive Complexity · shellinstaller.userStageVerify (cognitive 16) · ×1
  • shellinstaller.userStageVerify (cognitive 16) internal/shellinstaller/user_install_darwin.go:283 — shellinstaller.userStageVerify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · telemetry.openCodeError (cognitive 16) · ×1
  • telemetry.openCodeError (cognitive 16) internal/telemetry/runtime_opencode.go:234 — telemetry.openCodeError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tui.readCurrentAssignmentsFn (cognitive 16) · ×1
  • tui.readCurrentAssignmentsFn (cognitive 16) internal/tui/model.go:122 — tui.readCurrentAssignmentsFn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.handleEffortNav (cognitive 16) · ×1
  • screens.handleEffortNav (cognitive 16) internal/tui/screens/model_picker.go:645 — screens.handleEffortNav has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · screens.renderModelSelect (cognitive 16) · ×1
  • screens.renderModelSelect (cognitive 16) internal/tui/screens/model_picker.go:914 — screens.renderModelSelect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · screens.RenderReview (cognitive 16) · ×1
  • screens.RenderReview (cognitive 16) internal/tui/screens/review.go:17 — screens.RenderReview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderShellExperienceConfigWide (cognitive 16) · ×1
  • screens.renderShellExperienceConfigWide (cognitive 16) internal/tui/screens/shell_experience_config.go:40 — screens.renderShellExperienceConfigWide has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screens.renderUpgradeResult (cognitive 16) · ×1
  • screens.renderUpgradeResult (cognitive 16) internal/tui/screens/upgrade.go:125 — screens.renderUpgradeResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · styles.renderRoseLine (cognitive 16) · ×1
  • styles.renderRoseLine (cognitive 16) internal/tui/styles/rose.go:101 — styles.renderRoseLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · upgrade.Download (cognitive 16) · ×1
  • upgrade.Download (cognitive 16) internal/update/upgrade/download.go:92 — upgrade.Download has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 pts) (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.
D2 · Cognitive Complexity · windowsCompatibilityDirectoryWriter.Write (cognitive 16) · ×1
  • windowsCompatibilityDirectoryWriter.Write (cognitive 16) REDACTED:249 — windowsCompatibilityDirectoryWriter.Write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · backfill-victoriametrics.main (cognitive 16) · ×1
  • backfill-victoriametrics.main (cognitive 16) deploy/telemetry/scripts/backfill-victoriametrics.py:500 — backfill-victoriametrics.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · opencode-review-transport.startRelay (cognitive 16) · ×1
  • opencode-review-transport.startRelay (cognitive 16) internal/assets/opencode/plugins/opencode-review-transport.ts:200 — opencode-review-transport.startRelay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 5). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 219, 247, 250). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D22 · Internal API Consistency · `scripts.ReadUserAssets` returns a map (`map[K]V`) where its 4 siblings return a slice (`[]T`) · ×1
  • `scripts.ReadUserAssets` returns a map (`map[K]V`) where its 4 siblings return a slice (`[]T`) scripts/user_helpers.go:27 — 4 of 5 collection-returning members of `package scripts` return a slice (`[]T`) (4 of 5). Siblings: scripts.ReadNativeInstallerSource (scripts/native_installer_source_linux.go:13); scripts.ReadReviewedSuppliers (scripts/user_helpers.go:17); scripts.ReadUserHelper (scripts/user_helpers.go:21); scripts.ReadWindowsUserHelper (scripts/user_windows_helpers.go:15). Return a slice (`[]T`). [rule A4]
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: factory.go → validate.go, setup.go, config_scan.go internal/agents/factory.go — `internal/agents/factory.go` changes together with 3 other files — `internal/cli/validate.go`, `internal/components/engram/setup.go`, `internal/system/config_scan.go` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 34 shared lines) · ×1
  • Near-duplicate member family (4 members, 34 shared lines) REDACTED:679 — REDACTED:679-740 | REDACTED:776-836 | REDACTED:908-976 | REDACTED:1008-1072 — These 4 members are variants of one another: a block of 34 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared lines) REDACTED:192 — REDACTED:192-292 | internal/shellinstaller/user_root_service_linux.go:36-120 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) internal/agents/claude/adapter.go:51 — internal/agents/claude/adapter.go:51-66 | internal/agents/codex/adapter.go:45-60 | internal/agents/copilotcli/adapter.go:38-51 | internal/agents/gemini/adapter.go:45-60 | internal/agents/hermes/adapter.go:46-61 | internal/agents/kilocode/adapter.go:48-63 | internal/agents/kimi/adapter.go:66-84 | internal/agents/openclaw/adapter.go:46-61 | internal/agents/opencode/adapter.go:54-69 | internal/agents/pi/adapter.go:286-300 | internal/agents/qwen/adapter.go:49-64 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) REDACTED:249 — REDACTED:249-311 | internal/cli/compatibility_writer_unix.go:60-127 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) internal/tui/screens/uninstall.go:91 — internal/tui/screens/uninstall.go:91-130 | internal/tui/screens/uninstall.go:132-172 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 43+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 43+ corresponding lines) REDACTED:41 — REDACTED:41-99 | REDACTED:18-73 | REDACTED:27-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) internal/shellinstaller/user_agent_state.go:72 — internal/shellinstaller/user_agent_state.go:72-108 | internal/shellinstaller/user_install_scope_unix.go:52-88 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) internal/reviewtransaction/rar_path_safety.go:103 — internal/reviewtransaction/rar_path_safety.go:103-173 | internal/reviewtransaction/rar_path_safety.go:175-221 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) internal/cli/opencode_background.go:44 — internal/cli/opencode_background.go:44-93 | internal/cli/pi_background.go:62-113 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) internal/cli/run.go:2603 — internal/cli/run.go:2603-2653 | internal/components/agentguidance/inject.go:416-459 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) internal/shellinstaller/user_agent_state.go:127 — internal/shellinstaller/user_agent_state.go:127-162 | internal/shellinstaller/user_agent_state.go:166-204 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) REDACTED:76 — REDACTED:76-105 | REDACTED:111-141 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) REDACTED:400 — REDACTED:400-442 | REDACTED:396-439 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) internal/components/uninstall/service.go:1602 — internal/components/uninstall/service.go:1602-1640 | internal/components/uninstall/service.go:1646-1676 | internal/components/uninstall/service.go:1678-1711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) internal/reviewtransaction/store.go:927 — internal/reviewtransaction/store.go:927-959 | internal/shellinstaller/user_launch_pin_cache_unix.go:111-145 | internal/shellinstaller/user_shell_apply_unix.go:118-150 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) internal/tui/screens/claude_model_picker.go:397 — internal/tui/screens/claude_model_picker.go:397-420 | internal/tui/screens/kiro_model_picker.go:194-215 | internal/tui/screens/persona.go:24-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) internal/reviewtransaction/rar_path_safety.go:231 — internal/reviewtransaction/rar_path_safety.go:231-258 | REDACTED:940-971 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) internal/cli/review_stop_hook.go:358 — internal/cli/review_stop_hook.go:358-384 | internal/cli/review_stop_hook.go:389-416 | internal/cli/review_stop_hook.go:429-463 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) internal/system/install_deps.go:139 — internal/system/install_deps.go:139-156 | internal/system/install_deps.go:158-176 | internal/system/install_deps.go:178-205 | internal/system/install_deps.go:216-233 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) internal/shellinstaller/user_install_cleanup_unix.go:28 — internal/shellinstaller/user_install_cleanup_unix.go:28-50 | internal/shellinstaller/user_install_cleanup_windows.go:27-50 | internal/shellinstaller/user_shell_registry_windows.go:345-364 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) internal/reviewtransaction/verification_contract.go:1045 — internal/reviewtransaction/verification_contract.go:1045-1062 | internal/reviewtransaction/verification_contract.go:1070-1088 | internal/reviewtransaction/verification_contract.go:1197-1214 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) internal/components/uninstall/service.go:1967 — internal/components/uninstall/service.go:1967-1988 | internal/components/uninstall/service.go:2073-2091 | internal/components/uninstall/service.go:2095-2116 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) internal/reviewtransaction/candidate_decline.go:83 — internal/reviewtransaction/candidate_decline.go:83-94 | internal/reviewtransaction/rar_authority_repository.go:678-689 | internal/reviewtransaction/rar_plan_authority.go:593-604 | internal/reviewtransaction/rdd_mode.go:1087-1098 | internal/reviewtransaction/verification_contract.go:1464-1474 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) internal/tui/model.go:4146 — internal/tui/model.go:4146-4161 | internal/tui/model.go:4163-4178 | internal/tui/model.go:4180-4195 | internal/tui/model.go:4197-4212 | internal/tui/model.go:4228-4243 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) internal/components/engram/inject.go:1263 — internal/components/engram/inject.go:1263-1275 | REDACTED:420-432 | internal/components/permissions/inject.go:276-288 | internal/components/theme/inject.go:202-216 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) internal/app/app.go:76 — internal/app/app.go:76-89 | internal/app/selfupdate.go:207-216 | internal/tui/model.go:3600-3610 | internal/update/cooldown.go:126-138 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 4+ corresponding lines) internal/backup/restore.go:192 — internal/backup/restore.go:192-195 | internal/cli/codex_home.go:111-117 | internal/components/uninstall/service.go:869-872 | internal/reviewtransaction/repository_locator.go:1121-1125 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) internal/update/homebrew.go:10 — internal/update/homebrew.go:10-14 | internal/update/upgrade/homebrew.go:11-15 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) internal/cli/review_status_contract.go:1659 — internal/cli/review_status_contract.go:1659-1669 | internal/opencode/background.go:181-191 | internal/reviewtransaction/snapshot.go:701-711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) REDACTED:555 — REDACTED:555-620 | internal/components/uninstall/cleaners.go:268-333 — before extracting anything, compare `REDACTED` and `internal/components/uninstall/cleaners.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) REDACTED:623 — REDACTED:623-673 | internal/components/uninstall/cleaners.go:336-386 — before extracting anything, compare `REDACTED` and `internal/components/uninstall/cleaners.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (38 lines × 3) · ×1
  • Duplicated block (38 lines × 3) REDACTED:781 — REDACTED:781-818 | REDACTED:914-951 | REDACTED:1013-1050 — 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 `REDACTED:781` 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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) REDACTED:46 — REDACTED:46-80 | REDACTED:20-54 — 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 `REDACTED:46` 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 (30 lines × 3) · ×1
  • Duplicated block (30 lines × 3) internal/reviewtransaction/compact_reviewer_capture.go:927 — internal/reviewtransaction/compact_reviewer_capture.go:927-956 | internal/reviewtransaction/compact_unachievable_lens.go:51-80 | internal/reviewtransaction/compact_unachievable_lens.go:164-193 — 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/reviewtransaction/compact_reviewer_capture.go:927` 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) internal/reviewtransaction/rar_path_safety_unix.go:330 — internal/reviewtransaction/rar_path_safety_unix.go:330-358 | REDACTED:944-971 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:944` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) internal/components/uninstall/service.go:1573 — internal/components/uninstall/service.go:1573-1600 | internal/components/uninstall/service.go:1823-1850 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26 lines × 4) · ×1
  • Duplicated block (26 lines × 4) REDACTED:785 — REDACTED:785-810 | REDACTED:860-885 | REDACTED:918-943 | REDACTED:1017-1042 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:785` 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 (20–25 lines × 2) · ×1
  • Duplicated block (20–25 lines × 2) internal/components/persona/inject.go:182 — internal/components/persona/inject.go:182-206 | internal/components/persona/inject.go:383-402 — 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.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) internal/backup/restore.go:429 — internal/backup/restore.go:429-451 | internal/backup/restore.go:490-510 — 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/backup/restore.go:429` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) internal/update/homebrew.go:22 — internal/update/homebrew.go:22-44 | internal/update/upgrade/homebrew.go:23-45 — before extracting anything, compare `internal/update/homebrew.go` and `internal/update/upgrade/homebrew.go` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (13–22 lines × 3) · ×1
  • Duplicated block (13–22 lines × 3) internal/components/persona/inject.go:183 — internal/components/persona/inject.go:183-204 | internal/components/persona/inject.go:385-400 | internal/components/persona/inject.go:565-577 — 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 (21 lines × 4) · ×1
  • Duplicated block (21 lines × 4) REDACTED:580 — REDACTED:580-600 | REDACTED:630-650 | internal/components/uninstall/cleaners.go:293-313 | internal/components/uninstall/cleaners.go:343-363 — before extracting anything, compare `REDACTED` and `internal/components/uninstall/cleaners.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (13–19 lines × 2) · ×1
  • Duplicated block (13–19 lines × 2) internal/components/agentguidance/inject.go:417 — internal/components/agentguidance/inject.go:417-435 | internal/components/agentguidance/strict_tdd.go:48-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, 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.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) internal/opencode/background_remove_unix.go:76 — internal/opencode/background_remove_unix.go:76-94 | internal/opencode/background_remove_windows.go:84-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17–18 lines × 4) · ×1
  • Duplicated block (17–18 lines × 4) REDACTED:704 — REDACTED:704-720 | REDACTED:803-820 | REDACTED:936-953 | REDACTED:1035-1052 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:704` 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 × 4) · ×1
  • Duplicated block (17 lines × 4) REDACTED:684 — REDACTED:684-700 | REDACTED:780-796 | REDACTED:913-929 | REDACTED:1012-1028 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:684` 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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) internal/shellinstaller/user_launch_pin_cache_unix.go:131 — internal/shellinstaller/user_launch_pin_cache_unix.go:131-145 | internal/shellinstaller/user_shell_apply_unix.go:135-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/shellinstaller/user_launch_pin_cache_unix.go:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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.
D4 · Code Duplication · Duplicated block (9–15 lines × 2) · ×1
  • Duplicated block (9–15 lines × 2) internal/cli/review_lens_context.go:782 — internal/cli/review_lens_context.go:782-796 | internal/cli/review_provider_roles.go:407-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cli/review_lens_context.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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) REDACTED:2093 — REDACTED:2093-2107 | REDACTED:2413-2425 — 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 `REDACTED:2093` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) internal/reviewtransaction/rar_path_safety.go:241 — internal/reviewtransaction/rar_path_safety.go:241-253 | internal/reviewtransaction/rar_path_safety_unix.go:341-353 | REDACTED:955-966 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, 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. 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) REDACTED:747 — REDACTED:747-757 | internal/update/upgrade/download.go:354-366 — 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 `REDACTED:747` 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 (9–12 lines × 4) · ×1
  • Duplicated block (9–12 lines × 4) internal/agents/conductor/adapter.go:57 — internal/agents/conductor/adapter.go:57-66 | internal/agents/cursor/adapter.go:43-54 | internal/agents/trae/adapter.go:53-61 | internal/agents/windsurf/adapter.go:51-59 — 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/agents/conductor/adapter.go:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) internal/tui/screens/upgrade.go:166 — internal/tui/screens/upgrade.go:166-177 | internal/tui/screens/upgrade_sync.go:161-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/screens/upgrade.go:166` 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 (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) internal/cli/validate.go:240 — internal/cli/validate.go:240-250 | internal/tui/model.go:4409-4418 — 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/cli/validate.go:240` 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 (9–10 lines × 11) · ×1
  • Duplicated block (9–10 lines × 11) internal/agents/claude/adapter.go:57 — internal/agents/claude/adapter.go:57-66 | internal/agents/codex/adapter.go:51-60 | internal/agents/copilotcli/adapter.go:43-51 | internal/agents/gemini/adapter.go:51-60 | internal/agents/hermes/adapter.go:52-61 | internal/agents/kilocode/adapter.go:54-63 | internal/agents/kimi/adapter.go:75-84 | internal/agents/openclaw/adapter.go:52-61 | internal/agents/opencode/adapter.go:60-69 | internal/agents/pi/adapter.go:291-300 | internal/agents/qwen/adapter.go:55-64 — `internal/agents/claude/adapter.go` and `internal/agents/kilocode/adapter.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 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/agents/claude/adapter.go:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) internal/components/persona/inject.go:197 — internal/components/persona/inject.go:197-206 | internal/components/persona/inject.go:249-257 | internal/components/persona/inject.go:394-402 — 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) internal/components/agenthooks/claude.go:21 — internal/components/agenthooks/claude.go:21-35 | internal/components/agenthooks/codex_telemetry.go:23-37 | internal/components/agenthooks/skill_registry.go:97-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/components/agenthooks/claude.go:21` 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 (4–5 lines × 6) · ×1
  • Duplicated block (4–5 lines × 6) internal/cli/shell_install.go:318 — internal/cli/shell_install.go:318-322 | internal/cli/shell_install.go:325-329 | internal/cli/shell_install.go:332-338 | internal/cli/shell_install.go:339-343 | internal/cli/shell_install.go:347-350 | internal/cli/shell_install.go:353-357 — all 6 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/cli/shell_install.go:347` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/cli/shell_install.go:323` calls `report` and `internal/cli/shell_install.go:338` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 15) · ×1
  • Duplicated block (7 lines × 15) internal/agents/antigravity/adapter.go:208 — internal/agents/antigravity/adapter.go:208-215 | internal/agents/claude/adapter.go:248-255 | internal/agents/codex/adapter.go:175-182 | internal/agents/conductor/adapter.go:164-171 | internal/agents/cursor/adapter.go:157-164 | internal/agents/gemini/adapter.go:166-173 | internal/agents/hermes/adapter.go:156-163 | internal/agents/kilocode/adapter.go:162-169 | internal/agents/kimi/adapter.go:319-325 | internal/agents/openclaw/adapter.go:153-160 | internal/agents/opencode/adapter.go:334-341 | internal/agents/pi/adapter.go:822-828 | internal/agents/qwen/adapter.go:171-178 | internal/agents/trae/adapter.go:195-201 | internal/agents/windsurf/adapter.go:198-204 — `internal/agents/claude/adapter.go` and `internal/agents/kilocode/adapter.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 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.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) internal/agents/codex/adapter.go:14 — internal/agents/codex/adapter.go:14-24 | internal/agents/copilotcli/adapter.go:15-26 | internal/agents/gemini/adapter.go:14-24 | internal/agents/hermes/adapter.go:15-25 | internal/agents/openclaw/adapter.go:15-25 | internal/agents/qwen/adapter.go:14-28 — `internal/agents/codex/adapter.go` and `internal/agents/gemini/adapter.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 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.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) internal/app/app.go:1132 — internal/app/app.go:1132-1141 | internal/app/app.go:1169-1178 | internal/app/app.go:1182-1191 | internal/cli/run.go:5148-5157 | internal/cli/run.go:5161-5170 | internal/model/antigravity_model.go:56-65 — there are 6 copies across 3 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 6 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) internal/cli/review.go:182 — internal/cli/review.go:182-190 | internal/cli/review.go:445-453 | internal/cli/review.go:465-473 | internal/cli/review.go:503-511 | internal/cli/review.go:564-572 | internal/cli/review.go:702-710 | internal/cli/review_facade.go:1905-1913 | internal/cli/review_facade.go:2303-2311 | internal/cli/review_reclaim.go:24-32 | internal/cli/review_reopen_results.go:43-51 — there are 10 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 10 sites; resolving a subset leaves the remainder to drift apart. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cli/review.go:701` calls `Var` and `internal/cli/review.go:181` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) internal/agents/codex/adapter.go:76 — internal/agents/codex/adapter.go:76-80 | internal/agents/gemini/adapter.go:76-80 | internal/agents/qwen/adapter.go:80-84 — `internal/agents/codex/adapter.go` and `internal/agents/gemini/adapter.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 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/agents/codex/adapter.go:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) bench/axis_compatibility.go:161 — bench/axis_compatibility.go:161-197 | bench/journeys.go:227-264 | bench/journeys_correction_unavailable.go:52-170 | bench/journeys_finding_id_prefix.go:73-144 | bench/journeys_intended_untracked.go:409-489 | bench/journeys_issue3587.go:31-82 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) bench/journeys_issue_3557.go:59 — bench/journeys_issue_3557.go:59-107 | bench/journeys_issue_3561.go:67-121 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) bench/journeys_issue_3557.go:15 — bench/journeys_issue_3557.go:15-48 | bench/journeys_issue_3561.go:12-56 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) bench/journeys_capture_evidence_v5.go:96 — bench/journeys_capture_evidence_v5.go:96-109 | bench/journeys_wave1.go:340-355 | bench/journeys_wave1.go:1091-1103 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) bench/axis_compatibility.go:182 — bench/axis_compatibility.go:182-189 | bench/journeys.go:248-255 | bench/journeys_intended_untracked.go:469-473 | bench/journeys_issue3587.go:54-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/axis_compatibility.go:182` 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) bench/journeys.go:402 — bench/journeys.go:402-410 | bench/journeys_frozen_lineage_resume.go:145-151 | bench/journeys_issue_3065.go:176-181 | bench/journeys_wave1.go:470-477 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `bench/journeys.go:402` 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) bench/journeys_edge.go:179 — bench/journeys_edge.go:179-186 | bench/journeys_edge.go:385-392 | bench/journeys_edge.go:415-422 | bench/journeys_edge.go:541-548 | bench/journeys_edge.go:553-560 — all 5 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 `bench/journeys_edge.go:179` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `bench/journeys_edge.go:539` calls `Join` and `bench/journeys_edge.go:551` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) bench/journeys_issue_3065.go:132 — bench/journeys_issue_3065.go:132-139 | bench/journeys_wave1.go:358-365 | bench/journeys_wave1.go:727-734 — 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. 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: runtimeState (LCOM4 4) internal/cli/run.go:808 — runtimeState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 8 typed · 31 plain JS — the untyped files are e2e/complete-generated-lock-sri.test.mjs, e2e/frozen-global-materialization.test.mjs, e2e/frozen-user-lock-acquisition.test.mjs, e2e/normalize-private-optional-platform-closure.test.mjs, e2e/shared-recovery.test.mjs, e2e/shared-settings-durability.test.mjs (+25 more).
R10 · Code Duplication · Duplicated block with local edits (47 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (47 matched lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:57 — scripts/provision-gentle-shell-private-global.mjs:57 · scripts/provision-gentle-shell-windows.mjs:47 — the two spans are one implementation copied and then locally edited — 484 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (44 lines × 2 locations) · ×1
  • Duplicated block (44 lines × 2 locations) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:89 — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:89 · internal/assets/opencode/plugins/opencode-review-transport.ts:190 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:140 — internal/assets/opencode/plugins-v2/opencode-review-transport.ts:140 · internal/assets/opencode/plugins/opencode-review-transport.ts:235 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (11 matched lines × 2 locations) internal/assets/opencode/plugins-v2/telemetry-runtime.ts:60 — internal/assets/opencode/plugins-v2/telemetry-runtime.ts:60 · internal/assets/opencode/plugins/telemetry-runtime.ts:50 — the two spans are one implementation copied and then locally edited — 101 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) scripts/provision-gentle-shell-private-global.mjs:489 — scripts/provision-gentle-shell-private-global.mjs:489 · scripts/provision-gentle-shell-private-global.mjs:666 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (5 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (5 matched lines × 2 locations) scripts/normalize-private-optional-platform-closure.mjs:8 — scripts/normalize-private-optional-platform-closure.mjs:8 · scripts/provision-gentle-shell-private-global.mjs:479 — the two spans are one implementation copied and then locally edited — 89 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function run (cyclomatic 38, cognitive 51) · ×1
  • Complex function run (cyclomatic 38, cognitive 51) internal/assets/opencode/plugins-v2/telemetry-runtime.ts:26 — run has cyclomatic complexity 38 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalize (cyclomatic 27, cognitive 34) · ×1
  • Complex function normalize (cyclomatic 27, cognitive 34) scripts/normalize-private-optional-platform-closure.mjs:24 — normalize has cyclomatic complexity 27 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function nativeState (cyclomatic 25, cognitive 25) · ×1
  • Complex function nativeState (cyclomatic 25, cognitive 25) scripts/provision-gentle-shell-private-global.mjs:689 — nativeState has cyclomatic complexity 25 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function readReviewedList (cyclomatic 23, cognitive 17) · ×1
  • Complex function readReviewedList (cyclomatic 23, cognitive 17) scripts/provision-gentle-shell-private-global.mjs:112 — readReviewedList has cyclomatic complexity 23 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function reviewedSuppliers (cyclomatic 22, cognitive 15) · ×1
  • Complex function reviewedSuppliers (cyclomatic 22, cognitive 15) scripts/provision-gentle-shell-windows.mjs:96 — reviewedSuppliers has cyclomatic complexity 22 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function event (cyclomatic 20, cognitive 14) · ×1
  • Complex function event (cyclomatic 20, cognitive 14) internal/assets/opencode/plugins/telemetry-runtime.ts:23 — event has cyclomatic complexity 20 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 19, cognitive 17) · ×1
  • Complex function (anonymous) (cyclomatic 19, cognitive 17) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:241 — (anonymous) has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 18, cognitive 26) · ×1
  • Complex function (anonymous) (cyclomatic 18, cognitive 26) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:118 — (anonymous) has cyclomatic complexity 18 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function assertCanonicalPackages (cyclomatic 18, cognitive 18) · ×1
  • Complex function assertCanonicalPackages (cyclomatic 18, cognitive 18) scripts/provision-gentle-shell-private-global.mjs:361 — assertCanonicalPackages has cyclomatic complexity 18 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function fixture (cyclomatic 18, cognitive 17) · ×1
  • Complex function fixture (cyclomatic 18, cognitive 17) e2e/frozen-user-lock-acquisition.test.mjs:38 — fixture has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function compare (cyclomatic 17, cognitive 19) · ×1
  • Complex function compare (cyclomatic 17, cognitive 19) scripts/provision-gentle-shell-private-global.mjs:956 — compare has cyclomatic complexity 17 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function rootAuthorities (cyclomatic 17, cognitive 9) · ×1
  • Complex function rootAuthorities (cyclomatic 17, cognitive 9) scripts/provision-gentle-shell-windows.mjs:146 — rootAuthorities has cyclomatic complexity 17 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function fixture (cyclomatic 16, cognitive 24) · ×1
  • Complex function fixture (cyclomatic 16, cognitive 24) e2e/frozen-global-materialization.test.mjs:26 — fixture has cyclomatic complexity 16 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function graphFastPath (cyclomatic 16, cognitive 15) · ×1
  • Complex function graphFastPath (cyclomatic 16, cognitive 15) scripts/provision-gentle-shell-private-global.mjs:634 — graphFastPath has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function packages (cyclomatic 15, cognitive 27) · ×1
  • Complex function packages (cyclomatic 15, cognitive 27) scripts/provision-gentle-shell-windows.mjs:453 — packages has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 15, cognitive 24) · ×1
  • Complex function (anonymous) (cyclomatic 15, cognitive 24) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:276 — (anonymous) has cyclomatic complexity 15 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function sourceMembers (cyclomatic 15, cognitive 22) · ×1
  • Complex function sourceMembers (cyclomatic 15, cognitive 22) scripts/provision-gentle-shell-private-global.mjs:921 — sourceMembers has cyclomatic complexity 15 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function mainOverlayComposition (cyclomatic 14, cognitive 15) · ×1
  • Complex function mainOverlayComposition (cyclomatic 14, cognitive 15) scripts/provision-gentle-shell-windows.mjs:408 — mainOverlayComposition has cyclomatic complexity 14 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function restore (cyclomatic 14, cognitive 13) · ×1
  • Complex function restore (cyclomatic 14, cognitive 13) scripts/provision-gentle-shell-private-global.mjs:297 — restore has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 13, cognitive 16) · ×1
  • Complex function (anonymous) (cyclomatic 13, cognitive 16) internal/assets/opencode/plugins/opencode-review-transport.ts:219 — (anonymous) has cyclomatic complexity 13 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function refreshVariantsCache (cyclomatic 13, cognitive 14) · ×1
  • Complex function refreshVariantsCache (cyclomatic 13, cognitive 14) internal/assets/opencode/plugins/model-variants.ts:34 — refreshVariantsCache has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function decodeReviewSessionID (cyclomatic 12, cognitive 13) · ×1
  • Complex function decodeReviewSessionID (cyclomatic 12, cognitive 13) internal/assets/opencode/plugins/opencode-review-transport.ts:13 — decodeReviewSessionID has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function completeLock (cyclomatic 12, cognitive 13) · ×1
  • Complex function completeLock (cyclomatic 12, cognitive 13) scripts/complete-generated-lock-sri.mjs:34 — completeLock has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function tool.execute.after (cyclomatic 12, cognitive 12) · ×1
  • Complex function tool.execute.after (cyclomatic 12, cognitive 12) internal/assets/opencode/plugins/opencode-review-transport.ts:361 — tool.execute.after has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 11, cognitive 11) · ×1
  • Complex function (anonymous) (cyclomatic 11, cognitive 11) internal/assets/opencode/plugins-v2/opencode-review-transport.ts:218 — (anonymous) has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function graphStampsEqual (cyclomatic 11, cognitive 11) · ×1
  • Complex function graphStampsEqual (cyclomatic 11, cognitive 11) scripts/provision-gentle-shell-private-global.mjs:614 — graphStampsEqual has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function npmCommand (cyclomatic 11, cognitive 10) · ×1
  • Complex function npmCommand (cyclomatic 11, cognitive 10) scripts/provision-gentle-shell-windows.mjs:252 — npmCommand has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R7 · Dead Code · Dead file (~70 LoC) · ×1
  • Dead file (~70 LoC) scripts/crosslane/pirelay.mts — no import path from any entry point (21 application, 0 tooling, 33 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~66 LoC) · ×1
  • Dead file (~66 LoC) scripts/crosslane/harness.mts — no import path from any entry point (21 application, 0 tooling, 33 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Minor — 141 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate internal/reviewtransaction/authority_repair.go:282 — `!entry.IsDir() || validateLineageID(entry.Name()) != nil` appears character-identically in 2 files — internal/reviewtransaction/authority_repair.go, internal/reviewtransaction/compact_store.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/shellinstaller/user_artifacts_windows.go:61 — `!exists || entry.IsDir() != (file == nil || file.FileInfo().IsDir())` appears character-identically in 2 files — internal/shellinstaller/user_artifacts_windows.go, internal/shellinstaller/user_main_source_unix.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/components/agentguidance/inject.go:289 — `!filepath.IsAbs(corePath) || filepath.Dir(corePath) != configDir` appears character-identically in 2 files — internal/components/agentguidance/inject.go, internal/components/agentguidance/orchestrator_module_uninstall.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/opencode/background_remove_unix.go:80 — `!opened.Mode().IsRegular() || !os.SameFile(initial, opened)` appears character-identically in 2 files — internal/opencode/background_remove_unix.go, internal/opencode/background_remove_windows.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/rar_path_safety_unix.go:353 — `!os.SameFile(before, opened) || !os.SameFile(opened, current) || !rarRepositoryOpenDirectorySafe(file, opened)` appears character-identically in 2 files — internal/reviewtransaction/rar_path_safety_unix.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/shellinstaller/user_agent_state_unix.go:13 — `!privateHierarchyPath(from) || !privateHierarchyPath(to)` appears character-identically in 2 files — internal/shellinstaller/user_agent_state_unix.go, internal/shellinstaller/user_install_scope_unix.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:306 — `!readBackExists || !bytes.Equal(readBack, content)` appears character-identically in 2 files — REDACTED, internal/cli/compatibility_writer_unix.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/cli/review_capabilities.go:471 — `!strings.HasPrefix(value, "sha256:") || len(value) != len("sha256:")+64` appears character-identically in 2 files — internal/cli/review_capabilities.go, internal/reviewtransaction/receipt.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:156 — `a == b || strings.HasPrefix(a, b+"/") || strings.HasPrefix(b, a+"/")` appears character-identically in 2 files — REDACTED, internal/shellinstaller/user_os_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:164 — `adapter.Agent() == model.AgentOpenCode && selectedSettingsPath != ""` appears character-identically in 2 files — REDACTED, internal/components/persona/inject.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:755 — `adapter.Agent() == model.AgentOpenCode || adapter.Agent() == model.AgentKilocode` appears character-identically in 4 files — REDACTED, REDACTED, internal/components/permissions/inject.go, internal/components/uninstall/service.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/cli/review_provider_runtime.go:30 — `agent != model.AgentClaudeCode && agent != model.AgentCodex` appears character-identically in 2 files — internal/cli/review_provider_runtime.go, internal/components/agentguidance/orchestrator_modules.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/components/agentguidance/inject.go:311 — `agent == model.AgentOpenCode || agent == model.AgentKilocode` appears character-identically in 3 files — internal/components/agentguidance/inject.go, internal/components/agentguidance/strict_tdd.go, internal/components/opencoderuntimeplugins/inventory.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:573 — `ch == '*' && i+1 < len(raw) && raw[i+1] == '/'` appears character-identically in 2 files — REDACTED, internal/components/uninstall/cleaners.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/crosslane/hostpi.go:186 — `code != 0 || operationState(plan) != "correction_required"` appears character-identically in 2 files — scripts/crosslane/hostpi.go, scripts/crosslane/opencode.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/tui/shell_experience.go:152 — `config.reconfigure && (config.mode == "separate" || config.mode == "agent")` appears character-identically in 2 files — internal/tui/shell_experience.go, internal/tui/shell_platform_windows.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/repository_context_seal.go:118 — `ctx == nil || ctx.Err() != nil || validateReviewRepositoryContextBinding(binding) != nil` appears character-identically in 2 files — internal/reviewtransaction/repository_context_seal.go, internal/reviewtransaction/repository_locator.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/authority_disposition_plan.go:94 — `edge.PredecessorLineageID == lineage || edge.SuccessorLineageID == lineage` appears character-identically in 2 files — internal/reviewtransaction/authority_disposition_plan.go, internal/reviewtransaction/compact_inspect.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/cli/codex_service_tier.go:39 — `err != nil && !errors.Is(err, os.ErrNotExist)` appears character-identically in 3 files — internal/cli/codex_service_tier.go, internal/cli/review_mode.go, internal/tui/model.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/cli/review_artifact.go:387 — `err != nil && !reviewLastCapturedLensClosureSuperseded(store, currentRecord)` appears character-identically in 3 files — internal/cli/review_artifact.go, internal/cli/review_opencode_transport.go, internal/cli/review_provider_role_capture.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/candidate_decline.go:120 — `err != nil || !bytes.Equal(payload, canonical)` appears character-identically in 4 files — internal/reviewtransaction/candidate_decline.go, internal/reviewtransaction/rar_authority_repository.go, internal/reviewtransaction/rar_plan_authority.go, internal/reviewtransaction/rdd_mode.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/correction_scope.go:194 — `err != nil || !equalStrings(canonicalCandidate, paths)` appears character-identically in 2 files — internal/reviewtransaction/correction_scope.go, internal/reviewtransaction/snapshot.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/correction_scope.go:199 — `err != nil || !equalStrings(canonicalGenesis, genesis)` appears character-identically in 2 files — internal/reviewtransaction/correction_scope.go, internal/reviewtransaction/snapshot.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/compact.go:1570 — `err != nil || !equalStrings(fixFindingIDs, state.FixFindingIDs)` appears character-identically in 3 files — internal/reviewtransaction/compact.go, internal/reviewtransaction/correction_plan_request.go, internal/reviewtransaction/targeted_validation_request.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/reviewtransaction/correction_plan_request.go:57 — `err != nil || !equalStrings(viewFixFindingIDs, view.FixFindingIDs) || !equalStrings(viewFixFindingIDs, fixFindingIDs)` appears character-identically in 2 files — internal/reviewtransaction/correction_plan_request.go, internal/reviewtransaction/targeted_validation_request.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on error · ×33
  • Silent fallback default on error bench/main.go:413 — `binaryVersion` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error bench/record.go:51 — `envelopeName` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/codegraph.go:174 — `canonicalCodeGraphRestrictedPath` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/codegraph.go:182 — `codeGraphHomeDir` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/doctor.go:302 — `doctorInvokedGentleAIClause` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_asset_provenance.go:85 — `checkManagedReviewerAssets` turns a non-nil `err` into `return managedAssetProvenance{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_audit_actor.go:49 — `reviewGitConfigValue` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_defect_report.go:295 — `reviewGenerateToolFaultDefectReport` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_provider_roles.go:73 — `reviewProviderRoleTaskSchema` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_provider_runtime.go:67 — `savedCodexReviewModel` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_provider_runtime.go:89 — `savedClaudeReviewAssignment` turns a non-nil `err` into `return model.ClaudePhaseAssignment{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/review_rejected_result.go:95 — `reviewRejectedResultClause` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/cli/run.go:1777 — `openCodeSDKPeerConflictHint` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error REDACTED:694 — `engramInstallDir` turns a non-nil `err` into `return "/usr/local/bin"` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/components/engram/healthprobe.go:76 — `stdioTimeoutFromConfig` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/components/telemetryruntime/claude.go:23 — `SendClaude` turns a non-nil `err` into `return "discarded"` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/components/telemetryruntime/codex.go:23 — `SendCodex` turns a non-nil `err` into `return "discarded"` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/components/telemetryruntime/codex.go:142 — `readCodexAssignment` turns a non-nil `err` into `return telemetry.CodexAssignment{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/components/telemetryruntime/opencode.go:71 — `SendOpenCode` turns a non-nil `err` into `return "discarded"` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/opencode/models.go:12 — `DefaultSettingsPath` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/reviewtransaction/artifact_admission.go:220 — `safeAdmissionLocation` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/reviewtransaction/compact_inspect.go:463 — `sortCompactInspection` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/reviewtransaction/risk.go:1167 — `frozenRenamePairs` turns a non-nil `err` into `return nil, true` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/shellinstaller/user_main_source_cache_unix.go:124 — `userMustMainSourceStamps` turns a non-nil `err` into `return map[string]userStampRecord{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/shellinstaller/user_selection_windows.go:38 — `userConfirmation` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • + 8 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×32
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
P2 · Observability · Console output used as the logging channel · ×8
  • Console output used as the logging channel internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts:78 — `internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:98 — `internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/assets/opencode/plugins/model-variants.ts:28 — `internal/assets/opencode/plugins/model-variants.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/assets/opencode/plugins/model-variants.ts:64 — `internal/assets/opencode/plugins/model-variants.ts` reports through `console.*` at line 64 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/assets/opencode/plugins/model-variants.ts:74 — `internal/assets/opencode/plugins/model-variants.ts` reports through `console.*` at line 74 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/assets/opencode/plugins/skill-registry.ts:154 — `internal/assets/opencode/plugins/skill-registry.ts` reports through `console.*` at line 154 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/assets/opencode/plugins/skill-registry.ts:165 — `internal/assets/opencode/plugins/skill-registry.ts` reports through `console.*` at line 165 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel internal/assets/opencode/plugins/skill-registry.ts:172 — `internal/assets/opencode/plugins/skill-registry.ts` reports through `console.*` at line 172 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
D24 · Comment Value · redundant comment · ×6
  • redundant comment internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:233 — "Create a session for metadata generation" repeats the code it sits on: 4 of its 4 words (create, session, metadata, generation) are already in `const session = await client.session.create({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:574 — "Generate readable ID" repeats the code it sits on: 3 of its 3 words (generate, readable, id) are already in `const id = generateReadableId()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:1439 — "Get running delegations for this session tree" repeats the code it sits on: 4 of its 5 words (get, running, delegations, session) are already in `const running = manager`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts:213 — "Create a session for metadata generation" repeats the code it sits on: 4 of its 4 words (create, session, metadata, generation) are already in `const session = await client.session.create({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts:513 — "Generate readable ID" repeats the code it sits on: 3 of its 3 words (generate, readable, id) are already in `const id = generateReadableId()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment internal/components/opencoderuntimeplugins/testdata/released/v1.7.19/plugins/background-agents.ts:1363 — "Get running delegations for this session tree" repeats the code it sits on: 4 of its 5 words (get, running, delegations, session) are already in `const running = manager`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 162 significant file(s) lose their only recent owner: internal/reviewtransaction/transaction.go, bench/journeys_edge.go, internal/reviewtransaction/authority_repair.go, internal/components/agentguidance/routing.go, internal/reviewtransaction/store_reset.go, internal/cli/review.go, bench/axis_damaged_store_closure.go, internal/reviewtransaction/store.go (+154 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 19 significant file(s) lose their only recent owner: REDACTED, internal/tui/shell_install.go, internal/cli/shell_install.go, internal/shellinstaller/user_artifacts_windows.go, REDACTED, internal/shellinstaller/user_experience.go, REDACTED, internal/shellinstaller/user_runtime_primitives_linux.go (+11 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: bench/journeys_issue_3565.go, internal/cli/pi_mcp_diagnostic.go, REDACTED, internal/components/persona/resources.go. Pair on, review, or document these before any departure.
D8 · Code Coverage · Tests reach code only in some runs · ×2
  • Tests reach code only in some runs: internal/reviewtransaction/compact_reviewer_capture.go internal/reviewtransaction/compact_reviewer_capture.go:520 — 4 line(s) (520, 523, 664, 667) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: internal/tui/model.go internal/tui/model.go:360 — 1 line(s) (360) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
X9 · Subsumed condition operand · Subsumed condition operand · ×2
  • Subsumed condition operand internal/cli/run_integration_test.go:1896 — `strings.Contains(cmd, "apt-get install -y golang")` can never decide this `||` — every value satisfying `strings.Contains(cmd, "apt-get install -y golang")` also satisfies `strings.Contains(cmd, "apt-get install -y go")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand internal/cli/run_integration_test.go:1783 — `strings.Contains(cmd, "git")` can never decide this `&&` — every value satisfying `strings.Contains(cmd, "https://github.com/Gentleman-Programming/gentleman-guardian-angel.git")` also satisfies `strings.Contains(cmd, "git")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
AX6 · Interface segregation · Fat interface · ×1
  • Fat interface: Adapter (22 methods) internal/agents/interface.go:16 — `Adapter` declares 22 methods: `Agent`, `Tier`, `Detect`, `InstallCommand`, `GlobalConfigDir`, `SystemPromptDir`, `SystemPromptFile`, `SkillsDir`, `SettingsPath`, `SystemPromptStrategy`, `MCPStrategy`, `MCPConfigPath`, `SupportsOutputStyles`, `OutputStyleDir`, `SupportsSlashCommands`, `CommandsDir`, `SupportsSubAgents`, `SubAgentsDir`, `EmbeddedSubAgentsDir`, `SupportsSkills`, `SupportsSystemPrompt`, `SupportsMCP`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (188 single-owned of 563 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 563 of the 805 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: internal/cli/review_correction_context.go, bench/journeys_issue2906.go, bench/journeys_issue3813.go.
D21 · Naming Consistency · `isInPATH` spells `PATH` where 579 names in the project spell it `Path` · ×1
  • `isInPATH` spells `PATH` where 579 names in the project spell it `Path` internal/cli/run.go:747 — 579 of 580 names in project github.com/gentleman-programming/gentle-ai/v4 spell the token `Path` (579 of 580; unit: names in project github.com/gentleman-programming/gentle-ai/v4 containing `Path`). Peers: agentbuilder.Uninstall(registryPath) (internal/agentbuilder/uninstall.go:30); Adapter.statPath (internal/agents/antigravity/adapter.go:19); Adapter.SettingsPath (internal/agents/antigravity/adapter.go:131); Adapter.MCPConfigPath (internal/agents/antigravity/adapter.go:147); claude.LookPathOverride (internal/agents/claude/adapter.go:18). Rename to `isInPath`. [rule N6]
D21 · Naming Consistency · `codeGraphPnpmGlobalBin` spells `Pnpm` where 25 names in the project spell it `PNPM` · ×1
  • `codeGraphPnpmGlobalBin` spells `Pnpm` where 25 names in the project spell it `PNPM` internal/components/communitytool/tool.go:90 — 25 of 27 names in project github.com/gentleman-programming/gentle-ai/v4 spell the token `PNPM` (25 of 27; unit: names in project github.com/gentleman-programming/gentle-ai/v4 containing `PNPM`). Peers: github.com/gentleman-programming/gentle-ai/v4/internal/shellinstaller.userPNPMInventoryReader (REDACTED:20); shellinstaller.newUserPNPMInventoryReader (REDACTED:27); shellinstaller.userLaunchPNPM (internal/shellinstaller/user_pnpm_launch_linux.go:15); github.com/gentleman-programming/gentle-ai/v4/internal/shellinstaller.userPNPMManifest (internal/shellinstaller/user_pnpm_manifest.go:5); shellinstaller.userReadPNPMManifest (internal/shellinstaller/user_pnpm_manifest_linux.go:14). Rename to `codeGraphPNPMGlobalBin`. [rule N6]
D21 · Naming Consistency · `defaultPnpmGlobalBin` spells `Pnpm` where 25 names in the project spell it `PNPM` · ×1
  • `defaultPnpmGlobalBin` spells `Pnpm` where 25 names in the project spell it `PNPM` internal/components/communitytool/tool.go:627 — 25 of 27 names in project github.com/gentleman-programming/gentle-ai/v4 spell the token `PNPM` (25 of 27; unit: names in project github.com/gentleman-programming/gentle-ai/v4 containing `PNPM`). Peers: github.com/gentleman-programming/gentle-ai/v4/internal/shellinstaller.userPNPMInventoryReader (REDACTED:20); shellinstaller.newUserPNPMInventoryReader (REDACTED:27); shellinstaller.userLaunchPNPM (internal/shellinstaller/user_pnpm_launch_linux.go:15); github.com/gentleman-programming/gentle-ai/v4/internal/shellinstaller.userPNPMManifest (internal/shellinstaller/user_pnpm_manifest.go:5); shellinstaller.userReadPNPMManifest (internal/shellinstaller/user_pnpm_manifest_linux.go:14). Rename to `defaultPNPMGlobalBin`. [rule N6]
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 1 of 563 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 563 of the 805 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: internal/agents/kilocode/adapter.go. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D34 · Knowledge Freshness · Orphaned file · ×1
  • Orphaned file internal/agents/kilocode/adapter.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:4 — 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 was searched, so you can tell an absence from a miss: the 12 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback · No rollback/health safety · ×1
  • No rollback/health safety REDACTED:554 — Deployment automation exists and the service already exposes health probe endpoints (healthz/livez/readyz or a container healthcheck), but no manifest in this repository wires them into readiness/liveness probes, a rolling-update strategy, lifecycle hooks or a migration job — a bad release is harder to detect and reverse. If that wiring lives in a separate ops/Helm repository, document the pointer here so release safety is evidenced.
R7 · Dead Code · Unused module-local declaration 'rootNames' · ×1
  • Unused module-local declaration 'rootNames' e2e/frozen-global-materialization.test.mjs:23 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'treeDigest' · ×1
  • Unused module-local declaration 'treeDigest' scripts/provision-gentle-shell-windows.mjs:210 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X2 · Cancellation propagation · Not all functions that make a request accept a context.Context · ×1
  • Not all functions that make a request accept a context.Context — Only 20/24 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.
Minor — 6 finding(s)
D12 · Dependency Hygiene · Outdated · ×5
  • Outdated: github.com/BurntSushi/toml — `github.com/BurntSushi/toml` is required at v1.5.0 in REDACTED, but v1.6.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/BurntSushi/toml@v1.6.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/charmbracelet/x/ansi — `github.com/charmbracelet/x/ansi` is required at v0.11.6 in REDACTED, but v0.11.9 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/charmbracelet/x/ansi@v0.11.9 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/santhosh-tekuri/jsonschema/v6 — `github.com/santhosh-tekuri/jsonschema/v6` is required at v6.0.2 in REDACTED, but v6.0.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/santhosh-tekuri/jsonschema/v6@v6.0.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.47.0 in REDACTED, but v0.50.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.50.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: modernc.org/sqlite — `modernc.org/sqlite` is required at v1.58.0 in REDACTED, but v1.62.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get modernc.org/sqlite@v1.62.0 && go mod tidy` and commit the updated REDACTED and go.sum.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names internal/components/opencoderuntimeplugins/testdata/released/v1.33.2/plugins/background-agents.ts:512 — 0 of 0 documented parameters and 2 of 60 summaries in `gentleman-ai-installer` only repeat the member or parameter name (e.g. "DELEGATION MANAGER" for `DelegationManager`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-b6d3f8867e1c457695ae0ed206a4fea5/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-b6d3f8867e1c457695ae0ed206a4fea5/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-b6d3f8867e1c457695ae0ed206a4fea5/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=4711" --report-format json --report-path /tmp/watchdog-gitleaks-b6d3f8867e1c457695ae0ed206a4fea5/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-b6d3f8867e1c457695ae0ed206a4fea5/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .72artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .8artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `internal/tui/screens/review.go` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — 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.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — 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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — 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.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — 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.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e6cf-37b9-732b-8a7f-aa0dbe19c989 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md