Public report of cocofhu/grasp, 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:43 UTC · Survey ID cd_471a187480554bb790d6e8937ffd8412

cocofhu/grasp

Measured 17 November 2026, 00:41 UTC, at code version b2541df

First survey, so nothing to compare with yet
CAI score 49.3out of 100 Weak
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: 269,562 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 4.0 person-years · Weakest lens: Accessibility, 42.4

Findings by how serious they are

213 critical 1743 serious 226 minor

15 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:41 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 ▸

93of 93 dimensions measured by tools.
2149of 2182 findings point to an exact file and line, so you can open each one in the code. The other 33 concern the repository as a whole, such as missing documentation.
93dimensions across 8 lenses, read from 269,562 lines of product code in 5 projects.
Chapters

Executive summary

cocofhu/grasp falls short of our standard for production, in part because it has controls that only work with a mouse. It scores 49.3 out of 100 and is rated Weak, and 126 of its 213 critical findings are security problems.

Accessibility, at 42.4, is the weakest lens and counts most in the score. The best first step is fixing focus, motion and contrast, worth about 4.7 points. Making the controls keyboard-usable comes next, worth about 4.6 points. Raising Accessibility to 70 would lift the score to about 55.1.

Ninety-four pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Twenty settings leave the servers or containers unsafe, and nineteen controls can't be used without a mouse. Making the controls work with a keyboard, pinning each tool to an exact version and correcting the unsafe settings would close these risks. Limiting each secret to its own step would fix the five secrets exposed to more of the pipeline than needed, and the three places where the code runs text as code or as a command need a direct call instead. The 27 form fields without a label need a label.

The product code is 269,562 lines, about €590,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.
Accessibility 42.4 · counts for 45%Domain Modelling 51.4 · counts for 25%Production Readiness 52.4 · counts for 14%Security and Compliance 55.9 · counts for 8%Code Health 65.1 · counts for 4%Performance 72.9 · counts for 2%Architecture 74.4 · counts for 1%Maturity 79.8 · counts for 1%

If Accessibility rose from 42.4 to 70, the lowest score rated Strong, the score would rise from 49.3 to about 55.1.

Code composition: what the lines of code are
Product code 49%Tests 51%
Rebuild cost: about €590,000 · Estimate
Cost to rebuild€200,000 to €980,000, for 3,256 to 10,328 hours of work, about 4.0 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.7 at a score of 49. 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: 269,562 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
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Raises the score by about 4.7 points · Medium effort · Visual & motion safety
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 4.6 points · Medium effort · Keyboard semantics
3
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Raises the score by about 1.7 points · Medium effort · Forms & labels

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.

Where the investment is most exposed · Value at risk
This code would cost about €590,000 to build again, about 4.0 person-years of work. Its weakest lens is Accessibility, at 42.4 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
One cause behind 58 Domain Modelling findings · Common cause
58 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Other code can change an object's data directly, so it can put an order into a state the rules forbid. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Encapsulated state (22 findings) · Rich vs anemic model (35 findings) · Strongly-typed ids (1 finding)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1. Of all the actions in this report, it raises the score most for the work it takes: about 4.7 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 6.1 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 10% on every change. The history of the code shows how much it changes: about 741,358 lines over the last 90 days, which is about 3,006,619 lines a year. At that pace, the extra work comes to an estimated 350.2 to 2101 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.

236 modules, with 217 dependencies between them. 2 loops run through 6 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 196 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 github.com/cocofhu/grasp/internal/browser2 github.com/cocofhu/grasp/internal/config3 github.com/cocofhu/grasp/internal/modelrouting4 github.com/cocofhu/grasp/internal/models5 github.com/cocofhu/grasp/internal/pagebridge6 sandbox-gateway/internal/config7 sandbox-gateway/internal/driver8 sandbox-gateway/internal/models9 web.src.components.canvas.composables.useConnectionRules10 web.src.lib.composables11 web.src.lib.shared.loadLocaleMessages12 web.src.lib.shared.regionPolicy13 web.src.lib.workflow.nodeOutlets14 github.com/cocofhu/grasp/internal/auth15 github.com/cocofhu/grasp/internal/blob16 github.com/cocofhu/grasp/internal/chatsession17 github.com/cocofhu/grasp/internal/codexoauth18 github.com/cocofhu/grasp/internal/gateshare19 github.com/cocofhu/grasp/internal/mcp20 sandbox-gateway/internal/service21 web.src.lib.api.apiTypes22 github.com/cocofhu/grasp/internal/runtime23 sandbox-gateway/internal/api24 web.src.lib.agent25 web.src.lib.shared.types26 web.src.lib.solo27 github.com/cocofhu/grasp/internal/engine28 web.src.components.canvas.composables.canvasContext29 web.src.components.canvas.composables.graphOps30 web.src.components.token-analytics31 web.src.lib.artifacts32 web.src.lib.inbox33 web.src.lib.run34 web.src.lib.shared35 web.src.lib.workflow36 web.src.lib.workspace37 github.com/cocofhu/grasp/internal/services38 web.src.components.canvas.composables39 github.com/cocofhu/grasp/cmd/server40 github.com/cocofhu/grasp/internal/handlers
1 github.com/cocofhu/grasp/internal/browser
2 github.com/cocofhu/grasp/internal/config
3 github.com/cocofhu/grasp/internal/modelrouting
4 github.com/cocofhu/grasp/internal/models
5 github.com/cocofhu/grasp/internal/pagebridge
6 sandbox-gateway/internal/config
7 sandbox-gateway/internal/driver
8 sandbox-gateway/internal/models
9 web.src.components.canvas.composables.useConnectionRules
10 web.src.lib.composables
11 web.src.lib.shared.loadLocaleMessages
12 web.src.lib.shared.regionPolicy
13 web.src.lib.workflow.nodeOutlets
14 github.com/cocofhu/grasp/internal/auth12
15 github.com/cocofhu/grasp/internal/blob11
16 github.com/cocofhu/grasp/internal/chatsession5
17 github.com/cocofhu/grasp/internal/codexoauth1
18 github.com/cocofhu/grasp/internal/gateshare2513
19 github.com/cocofhu/grasp/internal/mcp214
20 sandbox-gateway/internal/service1102
21 web.src.lib.api.apiTypes24
22 github.com/cocofhu/grasp/internal/runtime45312
23 sandbox-gateway/internal/api412
24 web.src.lib.agent216
25 web.src.lib.shared.types1
26 web.src.lib.solo9
27 github.com/cocofhu/grasp/internal/engine70126311145
28 web.src.components.canvas.composables.canvasContext2
29 web.src.components.canvas.composables.graphOps1
30 web.src.components.token-analytics1
31 web.src.lib.artifacts1
32 web.src.lib.inbox124
33 web.src.lib.run11445
34 web.src.lib.shared2213
35 web.src.lib.workflow211
36 web.src.lib.workspace111
37 github.com/cocofhu/grasp/internal/services111512228720171
38 web.src.components.canvas.composables61123
39 github.com/cocofhu/grasp/cmd/server112
40 github.com/cocofhu/grasp/internal/handlers32642121133654
Uses a module listed above itPart of a loopThe module itself
1 github.com/cocofhu/grasp/internal/browser2 github.com/cocofhu/grasp/internal/config3 github.com/cocofhu/grasp/internal/modelrouting4 github.com/cocofhu/grasp/internal/models5 github.com/cocofhu/grasp/internal/pagebridge6 sandbox-gateway/internal/config7 sandbox-gateway/internal/driver8 sandbox-gateway/internal/models9 web.src.components.canvas.composables.useConnectionRules10 web.src.lib.composables11 web.src.lib.shared.loadLocaleMessages12 web.src.lib.shared.regionPolicy13 web.src.lib.workflow.nodeOutlets14 github.com/cocofhu/grasp/internal/auth15 github.com/cocofhu/grasp/internal/blob16 github.com/cocofhu/grasp/internal/chatsession17 github.com/cocofhu/grasp/internal/codexoauth18 github.com/cocofhu/grasp/internal/gateshare19 github.com/cocofhu/grasp/internal/mcp20 sandbox-gateway/internal/service21 web.src.lib.api.apiTypes22 github.com/cocofhu/grasp/internal/runtime23 sandbox-gateway/internal/api24 web.src.lib.agent25 web.src.lib.shared.types26 web.src.lib.solo27 github.com/cocofhu/grasp/internal/engine28 web.src.components.canvas.composables.canvasContext29 web.src.components.canvas.composables.graphOps30 web.src.components.token-analytics31 web.src.lib.artifacts32 web.src.lib.inbox33 web.src.lib.run34 web.src.lib.shared35 web.src.lib.workflow36 web.src.lib.workspace37 github.com/cocofhu/grasp/internal/services38 web.src.components.canvas.composables39 github.com/cocofhu/grasp/cmd/server40 github.com/cocofhu/grasp/internal/handlersgithub.com/cocofhu/grasp/internal/browser1github.com/cocofhu/grasp/internal/config2github.com/cocofhu/grasp/internal/modelrouting3github.com/cocofhu/grasp/internal/models4github.com/cocofhu/grasp/internal/pagebridge5sandbox-gateway/internal/config6sandbox-gateway/internal/driver7sandbox-gateway/internal/models8web.src.components.canvas.composables.useConnectionRules9web.src.lib.composables10web.src.lib.shared.loadLocaleMessages11web.src.lib.shared.regionPolicy12web.src.lib.workflow.nodeOutlets13github.com/cocofhu/grasp/internal/auth14github.com/cocofhu/grasp/internal/blob15github.com/cocofhu/grasp/internal/chatsession16github.com/cocofhu/grasp/internal/codexoauth17github.com/cocofhu/grasp/internal/gateshare18github.com/cocofhu/grasp/internal/mcp19sandbox-gateway/internal/service20web.src.lib.api.apiTypes21github.com/cocofhu/grasp/internal/runtime22sandbox-gateway/internal/api23web.src.lib.agent24web.src.lib.shared.types25web.src.lib.solo26github.com/cocofhu/grasp/internal/engine27web.src.components.canvas.composables.canvasContext28web.src.components.canvas.composables.graphOps29web.src.components.token-analytics30web.src.lib.artifacts31web.src.lib.inbox32web.src.lib.run33web.src.lib.shared34web.src.lib.workflow35web.src.lib.workspace36github.com/cocofhu/grasp/internal/services37web.src.components.canvas.composables38github.com/cocofhu/grasp/cmd/server39github.com/cocofhu/grasp/internal/handlers40121151251321411022445312412216197012631114521111241144522132111111115122287201716112311232642121133654+196 more modules (most-connected shown)

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

At a glance — Architecture · 74.4 · Adequate · gated by D26 ·

At a glance — Maturity · 79.8 · Strong ·

At a glance — Readiness · 52.4 · Adequate · gated by P7, P8 ·

At a glance — Security · 55.9 · Adequate · gated by D29, D31, D36 ·

At a glance — Domain Modelling · 51.4 · Adequate · gated by DM2, DM5 ·

At a glance — Accessibility · 42.4 · Weak · gated by AC4, AC6 ·

At a glance — Performance · 72.9 · Strong ·

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 — Injection140High / Critical
A02:2025 — Security Misconfiguration75High / Critical
A03:2025 — Software Supply Chain Failures9Medium
A07:2025 — Authentication Failures5Medium

Roadmap

Top priorities: Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.

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

Do thisHelpsEffortDimension
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+4.7 ptsMediumVisual & motion safety
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+4.6 ptsMediumKeyboard semantics
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.7 ptsMediumForms & labels
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+1.7 ptsMediumText alternatives
Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).+1.5 ptsMediumEncapsulated state
Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.+1.3 ptsMediumStrongly-typed ids
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.+1.1 ptsMediumRich vs anemic model
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+0.8 ptsMediumPage structure

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedIaC & Container Security: High IaC: REDACTED

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 — 213

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 — 1743

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 — 226

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

Could not be resolved — 15

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 93 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, 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 — 93 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D16D17D19D20D21D23D24D26D27D28D29D30D31D34D35D36D37D40D41D42D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX4AX6DM1DM10DM11DM2DM4DM5DM7DM9M1M2M3M4P1P2P3P4P5P6P7P8PF1PF3R1R10R11R2R3R4R5R6R7R8R9X1X12X15X16X17X18X2X21X24X25X28X29X3X30X4X5

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, 2149 of 2182 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 01a1e6f3-6738-7194-ac56-3014ca12f768.

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.

  • D8 Code Coverage — 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. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for web/ could not reach registry.npmmirror.com, which the analyzer sandbox's egress allowlist does not carry (npm error 403 403 Forbidden - GET https://registry.npmmirror.com/vite/-/vite-6.4.5.tgz), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a coverage step in CI (`go test ./... -count=1 -coverprofile`) shows coverage is measured in your own CI.
  • 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 6,129 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 724 test source file(s) (.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.
  • D11 Test Reliability — 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. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for web/ could not reach registry.npmmirror.com, which the analyzer sandbox's egress allowlist does not carry (npm error 403 403 Forbidden - GET https://registry.npmmirror.com/vite/-/vite-6.4.5.tgz), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
  • D11 Test Reliability — 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. Test reliability for the vitest suite in web/ was NOT MEASURED: the dependency install for web/ could not reach registry.npmmirror.com, which the analyzer sandbox's egress allowlist does not carry (npm error 403 403 Forbidden - GET https://registry.npmmirror.com/vite/-/vite-6.4.5.tgz), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • 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 a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its npm package dependencies. Nothing was read about its Go 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.
  • D21 Naming Consistency — 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — 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. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • 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.
  • D27 Navigability — 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. Tracing effort is measured over resolved call sites, and all 775 sampled here came from .go files. This repository's .ts source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
  • 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. `sandbox-gateway/sandbox/web/static/js/third_party/marked-15.0.6.esm.js`, `server/internal/engine/review_session.go`, `web/e2e/clarify-image-preview-main.ts`, `web/e2e/message-reliability-main.ts`, `web/src/components/canvas/composables/outlets.ts`, … (+7 more) 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.
  • AC2 Forms & labels — 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. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
  • AC6 Visual & motion safety — 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. 229 further occurrence(s) are not listed individually; the score already reflects all 269.
  • 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 DockerCompose (REDACTED). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.server.environment.GRASP_PUBLIC_ADVERTISE: required variable GRASP_PUBLIC_ADVERTISE is missing a value: Set the browser-facing HTTPS origin; runtime evidence skipped.
  • 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.
  • DM8 Value-object opportunities — 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 finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
  • DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • DM9 Scattered domain decisions — 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. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
  • 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, Vue components 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, Vue components 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 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
  • 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.
  • R10 Code Duplication — 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. 148 further occurrence(s) are not listed individually; the score already reflects all 188.
  • R2 Cyclomatic Complexity — 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. 354 further occurrence(s) are not listed individually; the score already reflects all 394.
  • R3 Large Files — 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. 41 further occurrence(s) are not listed individually; the score already reflects all 81.
  • 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 — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • 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. 34 further occurrence(s) are not listed individually; the score already reflects all 74.
  • X12 Unreachable branch — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X16 Unfloored truncation loop — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X17 Uncapped recursion over a caller-supplied document — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X18 Disposal-pattern correctness — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X21 Side-effecting pattern guard — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X24 Document value interpolated into markup unescaped — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X24 Document value interpolated into markup unescaped — 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. 8 further occurrence(s) are not listed individually; the score already reflects all 48.
  • X25 Inert configuration knob — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X26 Unsynchronised callback handoff — 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.
  • X27 Collection changed while being enumerated — 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 — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • 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. 365 further occurrence(s) are not listed individually; the score already reflects all 405.
  • X7 Silent fallback defaults — 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. 8 further occurrence(s) are not listed individually; the score already reflects all 48.

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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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 REDACTED Scanning: REDACTED 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.
  • 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • 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.
  • D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
  • D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
  • D42 Runtime Threat Enforcement: Runtime enforcement is read from committed policy files — a Tetragon/Falco/Kyverno stack installed cluster-wide (Helm release, platform add-on) with no in-repo trace can't be credited, and a committed policy is declared intent, not proof the engine is running and blocking in the live cluster.
  • 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 REDACTED (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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • 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 Complexity3.9 / 10Weak✓ 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 3.9 / 10 · rule-coverage 100% · ceiling Prevented

335 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was useGatesInbox.useGatesInbox.connectActiveRunWs at 124. A further 6 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 useGateApproval.useGateApproval.sameReactImages at 20 — 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 methods was excluded, so the exclusion is disclosed nowhere in the file itself: server/internal/router/router.go (router.New at 19), server/internal/gateshare/ua.go (gateshare.SummarizeUA at 17), web/src/lib/inbox/usePendingGates.ts (usePendingGates.refresh at 17), server/internal/config/gateways.go (config.validateGatewayConnection at 16). 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.

useGatesInbox.useGatesInbox.connectActiveRunWs (cyclomatic 124)web/src/lib/inbox/useGatesInbox.ts:2352
useSoloChat.useSoloChat.onFrame (cyclomatic 83)web/src/lib/solo/useSoloChat.ts:609
overlay.createOverlay (cyclomatic 81)web/src/liveoverlay/overlay.ts:150
useGatesInbox.useGatesInbox.onClarifySend (cyclomatic 73)web/src/lib/inbox/useGatesInbox.ts:3322
useGatesInbox.useGatesInbox (cyclomatic 67)web/src/lib/inbox/useGatesInbox.ts:107

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

What to do

  1. Bring the 7 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with useGatesInbox.useGatesInbox.connectActiveRunWs (cyclomatic 124), useSoloChat.useSoloChat.onFrame (cyclomatic 83), overlay.createOverlay (cyclomatic 81). — 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 7 together lifts Cyclomatic Complexity from 3.9 to about 5.3/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

443 method(s) exceeded the cognitive complexity threshold of 15; the worst was useGatesInbox.useGatesInbox.connectActiveRunWs at 175.

useGatesInbox.useGatesInbox.connectActiveRunWs (cognitive 175)web/src/lib/inbox/useGatesInbox.ts:2352
useGatesInbox.useGatesInbox.onClarifySend (cognitive 122)web/src/lib/inbox/useGatesInbox.ts:3322
filestore.Migrate (cognitive 111)server/internal/filestore/migration.go:27
useSoloChat.useSoloChat.onFrame (cognitive 105)web/src/lib/solo/useSoloChat.ts:609
Engine.reactReply (cognitive 99)server/internal/engine/resume.go:380

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

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with useGatesInbox.useGatesInbox.connectActiveRunWs (cognitive 175), useGatesInbox.useGatesInbox.onClarifySend (cognitive 122). — 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 2 together lifts Cognitive Complexity from 2.0 to about 2.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes8.8 / 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.8 / 10 · rule-coverage 100% · ceiling Prevented

102 god class(es) detected.

FunctionTooLong: useGatesInbox.useGatesInbox · ×36web/src/lib/inbox/useGatesInbox.ts:107
FileTooLong: inbox/useGatesInbox.ts · ×29web/src/lib/inbox/useGatesInbox.ts
MethodTooLong: SandboxService.AlignSoloModelRoute · ×12server/internal/services/sandbox_solo_route.go:83
TooManyMethods: Engine · ×10server/internal/engine/engine.go:24
ClassTooLong: useGatesInbox · ×10web/src/lib/inbox/useGatesInbox.ts:1

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

What to do

  1. Resolve the 36 FunctionTooLong finding(s) in God Classes — start with useGatesInbox.ts (3), useSoloChat.ts (2), useRunDetail.ts. — One of this dimension's main actionable groups (36 warning-level).
  2. Resolve the 29 FileTooLong finding(s) in God Classes — start with REDACTED (2), useGatesInbox.ts, useRunDetail.ts. — One of this dimension's main actionable groups (29 warning-level).
  3. Resolve the 12 MethodTooLong finding(s) in God Classes — start with sandbox_solo_route.go, global_token_stats.go, resume.go. — One of this dimension's main actionable groups (12 warning-level).

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

D4 · Code Duplication8.8 / 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 8.8 / 10 · rule-coverage 100% · ceiling Verified

158 duplicated block group(s) detected. 2.9 % of the production lines (7,923 of 269,562) are in a reported copy. A further 162 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 29 of the 320 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. Measured on part of this repository only: .ts (29% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (9 lines × 2) · ×17sandbox-gateway/gateway/internal/service/recovery.go:158
Duplicated block (7 lines × 2) · ×16server/internal/handlers/sandbox_proxy_auth.go:137
Duplicated block (6 lines × 2) · ×13server/cmd/doctor/main.go:155
Edited copy of a member (7 corresponding lines) · ×12server/internal/handlers/model_configurations.go:63
Duplicated block (5 lines × 2) · ×12server/internal/engine/review_session.go:1015

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

What to do

  1. Resolve the 17 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with workspace.go (2), recovery.go, preview.go. — One of this dimension's main actionable groups (17 warning-level).
  2. Resolve the 16 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with acp_ensure.go (2), codex_device_flow.go (2), sandbox_proxy_auth.go. — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 13 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with store.go (2), gate.go (2), REDACTED. — One of this dimension's main actionable groups (13 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

4 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 3 of the 4 (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.8 / 10Stronggated by 3 serious findings✓ 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.8 / 10 · rule-coverage 100% · ceiling Verified

3 of 165 classes have LCOM4 above 3.

Low cohesion: Handlers (LCOM4 10) · ×3server/internal/handlers/handlers.go:25

What to do

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

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

D10 · Test Quality10.0 / 10Stronggated by 11 serious findings✓ 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

6 skipped (6 with a documented reason), 3 zero-assertion, 8 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 6129 tests. Measured on the JavaScript/TypeScript suite only — at least 724 test source file(s) (.go) went unread, so its test quality is unmeasured and is not in these counts.

Fixed-sleep synchronisation: offers references from the + menu and turns pasted links into #n for the picked repo · ×8web/src/views/DashboardView.references.test.ts:149
No assertions: restores idle sessions and flushes without busy seed · ×3web/src/lib/run/useRunDetailWs.test.ts:155
Mock-dominated test: reports read errors, aborts and synchronous failures without accepting them as finished files · ×6web/src/lib/shared/attachments.test.ts:68
Skipped (documented): (unnamed test) · ×6web/src/views/SandboxConsoleView.lazyMount.test.ts:71

What to do

  1. Resolve the 8 Fixed-sleep synchronisation finding(s) in Test Quality — start with WorkspaceCredentialsPanel.test.ts (5), DashboardView.references.test.ts (2), SoloSessionPane.references.test.ts. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 6 Mock-dominated test finding(s) in Test Quality — start with attachments.test.ts, previewVncChannel.test.ts, useArtifactPreview.coverage.test.ts. — One of this dimension's main actionable groups (6 recommendation-level).
  3. Resolve the 3 No assertions finding(s) in Test Quality — start with useRunDetailWs.test.ts, useRunLive.test.ts, AgentFilesPanel.interactions.test.ts. — One of this dimension's main actionable groups (3 warning-level).

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

D12 · Dependency Hygiene8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Verified

22 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 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/aws/aws-sdk-go-v2 · ×22

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

D13 · REDACTED 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

REDACTED scan ran and found no leaked secrets. 3 password hash(es) are listed to check and are not counted as leaked credentials.

REDACTED

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.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 184 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 184 package(s) this repository's committed lockfile installs for a consumer — its 21 production, optional and peer dependency(ies), across 1 product package.json manifest(s), and everything those install in turn. Its 18 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. 1 of them publish no licence this pass can read on registry.npmjs.org — an absent field, `UNLICENSED`, or a `SEE LICENSE IN <file>` pointer into a tarball this pass does not download; that is missing data, not a violation, and none of them is charged. Third-party code that ships WITHOUT a manifest entry was read too: 1 component(s) whose licence travels in the tree (vendored or copied-in directories, licence comments preserved in committed bundles, compiled wasm modules) and 0 bundled package(s) named only by a bundle's module path, graded on the registry; 0 use a banned licence. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's npm package dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum), 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 Hotspots9.7 / 10Stronggated by 161 serious findings✓ 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 9.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: web/src/lib/inbox/useGatesInbox.ts (60×124=7440); REDACTED (81×57=4617); web/src/lib/inbox/useClarifyChat.ts (67×59=3953) Repeated repair below the complexity floor: web/src/components/run/AgentTimeline.vue (13 of 22 changes were fixes); server/internal/services/sandbox_solo_recovery.go (12 of 18 changes were fixes); server/internal/sandbox/events.go (8 of 14 changes were fixes)

Hotspot: web/src/lib/inbox/useGatesInbox.ts · ×132web/src/lib/inbox/useGatesInbox.ts:2352
Repeated repair: web/src/components/run/AgentTimeline.vue · ×29web/src/components/run/AgentTimeline.vue:207

What to do

  1. Resolve the 132 Hotspot finding(s) in Churn × Complexity Hotspots — start with config.go (3), preview.go (3), REDACTED (2). — One of this dimension's main actionable groups (132 warning-level).
  2. Resolve the 29 Repeated repair finding(s) in Churn × Complexity Hotspots — start with AgentTimeline.vue, sandbox_solo_recovery.go, events.go. — One of this dimension's main actionable groups (29 warning-level).

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

D16 · Bus Factor7.7 / 10Strong✓ Tool-verified

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

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

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

121 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is web/src/lib/inbox/useClarifyChat.ts. Counted over 512 of the 760 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
Further sole-owners (lower concentration)

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 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 171725 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. 353 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundserver/cmd/server/file_migration.go:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with file_migration.go. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming Consistency8.8 / 10Strong✓ 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 8.8 / 10 · rule-coverage 100% · ceiling Verified

7 naming inconsistencies among 598 declarations measured against a convention their peers follow.

`callID` spells `ID` where 23 names in the project spell it `Id` · ×2sandbox-gateway/scripts/mock-agent-model.mjs:163
`ImageDataUrl` spells `Url` where 80 names in the project spell it `URL`server/internal/engine/annotation_artifact.go:54
`skipVCS` spells `VCS` where 13 names in the project spell it `Vcs`server/internal/version/version.go:17
`openCodeModelID` spells `ID` where 421 names in the project spell it `Id`web/src/lib/agent/fixedEffort.ts:25
`previewShareURL` spells `URL` where 41 names in the project spell it `Url`web/src/lib/inbox/appPreviewShare.ts:35

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

What to do

  1. Resolve the 2 `callID` spells `ID` where 23 names in the project spell it `Id` finding(s) in Naming Consistency — start with mock-agent-model.mjs (2). — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 1 `ImageDataUrl` spells `Url` where 80 names in the project spell it `URL` finding(s) in Naming Consistency — start with annotation_artifact.go. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `skipVCS` spells `VCS` where 13 names in the project spell it `Vcs` finding(s) in Naming Consistency — start with version.go. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d21_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: gateway, sandbox.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value10.0 9.4 / 10Exemplary✓ 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 9.4 / 10 · rule-coverage 94% · ceiling Documented

1 of 1852 judged comments only repeat the code they sit on (0.1 %). 126 comment(s) in another language or script were not judged.

redundant commentweb/src/components/run/ReactConnectingState.test.ts:174

✓ On the Gold path — maintain.

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

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

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

3 of 5 build units (Go, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×3REDACTED:1

What to do

  1. Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (2), package.json. — One of this dimension's main actionable groups (3 recommendation-level).

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

D27 · Navigability9.4 / 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 9.4 / 10 · rule-coverage 100% · ceiling Documented

20 % of calls cross a namespace and 4 % go through an interface, but 64 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .go source only — this repository's .ts was not sampled for call sites, so this score covers part of the tree, not all of it.

✓ 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: REDACTED 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

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

REDACTED

✓ On the Gold path — maintain.

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

D29 · Static Analysis (SAST)0.3 / 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.3 / 10 · rule-coverage 100% · ceiling Documented

140 finding(s): 0 critical, 106 high, 22 medium, 12 low. 94 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 53 file(s) — `.github/scripts/coverage-badge-color.sh` (line 8), `sandbox-gateway/sandbox/Dockerfile` (lines 53–54, lines 102–103, lines 142–143, …), `sandbox-gateway/sandbox/internal/previewinject/live-overlay.js`, `sandbox-gateway/sandbox/internal/previewinject/page-control.js`, `sandbox-gateway/sandbox/internal/previewinject/preview-pick.js`, … (+48 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 5 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

+ 16 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, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  3. No action in Static Analysis (SAST) — all 94 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 (94 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities9.4 / 10Stronggated by 5 serious 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 9.4 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security0.0 / 10Critical✓ Tool-verified

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

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

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

75 finding(s): 0 critical, 20 high, 49 medium, 6 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 49 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (35), REDACTED (7), REDACTED (3). — One of this dimension's main actionable groups (49 warning-level).
  2. Resolve the 20 High IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (20 issue-level).
  3. Resolve the 6 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 recommendation-level).

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

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

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 512 of the 760 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Adequategated by 2 critical 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: useClarifyChat.ts↔useGateApproval.ts 82%; REDACTED↔descriptor.go 60%; REDACTED↔sandbox_agent.go 55%

Boundary-crossing change coupling: REDACTED ↔ descriptor.go · ×2REDACTED:1
Change coupling: useClarifyChat.ts ↔ useGateApproval.ts · ×2web/src/lib/inbox/useClarifyChat.ts:1

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 2 Change coupling finding(s) in Change Coupling — start with useClarifyChat.ts, AgentMetaPanel.vue. — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

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

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. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D40 · Network Egress Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.

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

0/2 network-egress controls present (network policy, egress restriction).

No network policy

What to do

  1. Resolve the 1 No network policy finding(s) in Network Egress Confinement. — One of this dimension's main actionable groups (1 recommendation-level).

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

D41 · Kernel & Syscall Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.

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

0/2 workload(s) run every container under a seccomp profile; 0/2 declare an AppArmor/SELinux profile.

No seccomp profile · ×2REDACTED:49

What to do

  1. Resolve the 2 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).

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

D42 · Runtime Threat Enforcement8.0 / 10Strong✓ Tool-verified

What it measures: Whether the Kubernetes deployment wires runtime threat enforcement — a detection engine (Tetragon/Falco) and/or an admission-control policy gate (Kyverno / OPA Gatekeeper / PodSecurity). Presence of committed policy, not a runtime guarantee.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a runtime threat-detection engine (Tetragon TracingPolicy / Falco) and an admission-control policy (Kyverno / OPA Gatekeeper / PodSecurity). Reward-leaning; NotApplicable without workloads. Deterministic.

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

1/2 runtime-enforcement controls present (threat detection, admission control).

Detailed fixes: d42_recommendation.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 3 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.

AC1 · Text alternatives6.0 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — web/src/components/dashboard/HomeParticleMeshBackground.vue:166

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.9 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×18) — web/src/components/agent/AgentFilesPanel.vue:197, web/src/components/agent/AgentIconPicker.vue:180, web/src/components/agent/AgentMcpPanel.vue:130, …
  • This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×11) — web/src/components/agent/AgentRuntimeBindings.vue:99, web/src/components/agent/AgentRuntimeBindings.vue:108, web/src/components/agent/AgentWorkspaceHistoryPanel.vue:272, …
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×9) — web/src/components/agent/AgentWorkspaceHistoryPanel.vue:273, web/src/components/canvas/inspector/VariablesField.vue:34, web/src/components/canvas/inspector/VariablesField.vue:41, …
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×2) — web/src/components/ui/AppDrawer.vue:33, web/src/components/ui/AppSwitch.vue:39

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure7.5 / 10Strong✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — web/index.html:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×2) — web/src/views/RunDetailView.vue:424, web/src/views/TokenAnalyticsView.vue:1135

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics2.4 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×5) — web/src/components/agent/AgentCreateWizard.vue:64, web/src/components/canvas/edges/FlowEdge.vue:234, web/src/components/run/CommentPinInspectCard.vue:195, …
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×14) — web/src/components/agent/AgentFilesPanel.vue:345, web/src/components/agent/AgentFilesPanel.vue:463, web/src/components/agent/ExplorerContextMenu.vue:62, …
  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×7) — web/src/components/agent/AgentIconPicker.vue:166, web/src/components/agent/AgentSwitcher.vue:92, web/src/components/canvas/chrome/QuickAdd.vue:85, …
  • This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. (×4) — web/src/components/canvas/NodePalette.vue:143, web/src/components/canvas/WorkflowVersionDrawer.vue:88, web/src/components/dashboard/HomeYumeCharacter.vue:380, …
  • This <aside role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — web/src/components/canvas/WorkflowVersionDrawer.vue:64
  • This <path> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus. — web/src/components/canvas/edges/FlowEdge.vue:153
  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus. (×4) — web/src/components/canvas/edges/FlowEdge.vue:163, web/src/components/chat/ChatMessageRail.vue:283, web/src/components/chat/ChatMessageRail.vue:290, …
  • This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabindex="0" in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabindex="0"="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it. (×2) — web/src/components/solo/ReferencePicker.vue:392, web/src/components/solo/ReferencePicker.vue:408
  • This <th> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — web/src/views/RunListView.vue:733
  • This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabindex="0", no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabindex="0"="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — web/src/views/TokenAnalyticsView.vue:1269

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.5 / 10Strong✓ Tool-verified

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden. (×13) — web/src/components/agent/AgentFilesPanel.vue:364, web/src/components/canvas/NodePalette.vue:138, web/src/components/canvas/WorkflowCanvas.vue:959, …
  • The combobox role requires aria-expanded to convey its state. Add it. — web/src/components/canvas/chrome/QuickAdd.vue:97

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety2.2 / 10Critical✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×15) — web/src/components/agent/AgentCapabilitiesPanel.vue:310, web/src/components/agent/AgentFilesPanel.vue:197, web/src/components/agent/AgentMcpPanel.vue:130, …
  • <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — web/src/components/agent/MarkdownViewToggle.vue:21, web/src/components/ui/ChatImageThumb.vue:200
  • <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — web/src/components/run/AcpStatusPill.vue:25, REDACTED:1227
  • <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — web/src/components/run/CommentPinInspectCard.vue:257, web/src/components/run/GateProductEditor.vue:662
  • <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — REDACTED:1181, web/src/views/TokenAnalyticsView.vue:692
  • <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — web/src/components/run/StructuredProductPanel.vue:357
  • <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — web/src/components/run/product/TestResultView.vue:295
  • <icon> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — web/src/components/solo/SoloSessionList.vue:68
  • <appspinner> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — web/src/components/ui/WorkflowFilter.vue:134
  • <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — web/src/views/TokenAnalyticsView.vue:915
  • `.approve-confirm` sets color: #fff on background-color: #7b61ff — 4.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/site/css/home.css:1620
  • `.demo-ui__btn.is-primary` sets color: #fff on background-color: #7b61ff — 4.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/site/css/home.css:1856
  • `.approve-btn` sets color: #fff on background-color: #16a34a — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/site/css/home.css:1946
  • `.workflow-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/views/WorkflowsView.vue:320
  • `.chat-composer .chat-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/chat.css:161
  • `.input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/styles/global.css:308
  • `.git-host-field__input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — REDACTED:94
  • `.search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/components/workspace/WorkspaceAuditPanel.vue:1151
  • `.artifact-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/components/run/ArtifactList.vue:385
  • `.team-field input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/components/onboarding/OnboardingTeamCard.vue:298
  • `.is-resizing .conversation-sash` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — web/src/components/chat/ConversationWorkspace.vue:380
  • `.cc-turn-usage:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — sandbox-gateway/sandbox/web/static/css/app.css:1044

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition6.2 / 10Adequate✓ 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 singletons5.8 / 10Adequate✓ 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.

  • `Engine` is shared by every request (`autoRunsMap` is called per request from the Gin handler `Handlers.ResumeRun`, on the one `Engine` value that handler's shared receiver holds) but writes its fields outside any lock (autoRuns; e.g. `autoRuns` in `autoRunsMap` at line 91). Unsynchronised concurrent writes are a data race in Go: an update is lost or a value tears, and a concurrent map write aborts the process. — server/internal/engine/engine.go:24

What to do

  • Go: guard the state handlers share with a sync.Mutex held for the whole update (`mu.Lock(); defer mu.Unlock()`), make counters sync/atomic types (atomic.Int64) and caches a sync.Map, or keep per-request data in locals and the request context. `go test -race` over a handler test confirms the race and then its fix.
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 segregation10.0 / 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.

DM1 · Aggregate boundaries10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.

Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.

Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.

DM10 · One transaction, one aggregate10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.

Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.

DM11 · Constructible invalid state10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.

Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.

DM2 · Strongly-typed ids3.0 / 10Weak✓ Tool-verified

Other · Domain Modelling — How much of the domain uses strongly-typed ids vs raw Guid/string/int — adoption curve, not all-or-nothing.

Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.

Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.

  • `LiveEvent.SID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — server/internal/models/live.go:202

What to do

  • Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.
DM4 · Rich vs anemic model4.3 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `Connection` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/modelrouting/types.go:81
  • `ArtifactDelivery` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/artifact_delivery.go:21
  • `AuditEvent` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/audit.go:7
  • `ChatPendingTurn` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/chat_pending.go:9
  • `EmbedTicket` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/embed.go:16
  • `EmbedSession` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/embed.go:33
  • `GateShareLink` is an aggregate/entity with 19 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/gate_share_link.go:15
  • `GateShareVisitorConversation` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/gate_share_link.go:43
  • `GateShareNonce` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/gate_share_nonce.go:8
  • `GateSharePreviewTicket` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/gate_share_preview_ticket.go:8
  • `LiveSession` is an aggregate/entity with 21 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/live.go:112
  • `Credential` is an aggregate/entity with 20 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:41
  • `Workspace` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:67
  • `WorkflowDef` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:88
  • `WorkflowVersion` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:129
  • `RunVariable` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:385
  • `Artifact` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:398
  • `ArtifactVersion` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:427
  • `Gate` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:448
  • `ReactConversation` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:487
  • `Sandbox` is an aggregate/entity with 30 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:875
  • `Session` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:958
  • `WorkflowAPIKey` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:971
  • `Setting` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:985
  • `RunPreviewPort` is an aggregate/entity with 15 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:992
  • `PreviewIssue` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/models.go:1024
  • `NotificationRead` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/notification.go:7
  • `NotificationBaseline` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/notification.go:21
  • `Project` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/solo.go:11
  • `SoloSession` is an aggregate/entity with 37 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/solo.go:70
  • `SoloBackup` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/solo.go:144
  • `RunReference` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/solo.go:198
  • `SoloMessage` is an aggregate/entity with 20 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/solo.go:212
  • `TokenUsageEvent` is an aggregate/entity with 21 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/token_usage_event.go:31
  • `TokenUsageReport` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — server/internal/models/token_usage_event.go:59

What to do

  • Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
DM5 · Encapsulated state1.6 / 10Critical✓ Tool-verified

Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

  • `Sandbox` exposes publicly writable state (ID, Name, Status, Image, Namespace, Error, and 10 more). — sandbox-gateway/gateway/internal/models/sandbox.go:32
  • `GateShareVisitorConversation` exposes publicly writable state (ID, LinkID, Lane, RunID, NodeID, ChatID, and 4 more). — server/internal/models/gate_share_link.go:43
  • `LiveSession` exposes publicly writable state (ID, RunID, NodeID, Owner, Mode, Action, and 15 more). — server/internal/models/live.go:112
  • `LiveEvent` exposes publicly writable state (Op, SID, Scope, Action, Prompt, Count, and 11 more). — server/internal/models/live.go:200
  • `Credential` exposes publicly writable state (ID, Purpose, Issuer, ToolID, SecretKind, Host, and 14 more). — server/internal/models/models.go:41
  • `Workspace` exposes publicly writable state (ID, Name, Description, UnknownModelDisplayName, CreatedAt, UpdatedAt). — server/internal/models/models.go:67
  • `WorkflowDef` exposes publicly writable state (Defaults, ID, Name, Description, Version, PublishedVersion, and 6 more). — server/internal/models/models.go:88
  • `Run` exposes publicly writable state (ID, WorkflowID, WorkflowName, WorkflowVersion, Status, Trigger, and 23 more). — server/internal/models/models.go:145
  • `StateRun` exposes publicly writable state (Files, HasFileDeliveries, ID, RunID, NodeID, NodeType, and 21 more). — server/internal/models/models.go:313
  • `RunVariable` exposes publicly writable state (ID, RunID, Name, Type, Value, REDACTED). — server/internal/models/models.go:385
  • `Artifact` exposes publicly writable state (ID, RunID, NodeID, WorkflowID, WorkflowName, Name, and 12 more). — server/internal/models/models.go:398
  • `ArtifactVersion` exposes publicly writable state (ID, ArtifactID, RunID, NodeID, Revision, Kind, and 6 more). — server/internal/models/models.go:427
  • `Gate` exposes publicly writable state (ID, RunID, NodeID, Iteration, WorkflowID, WorkflowName, and 8 more). — server/internal/models/models.go:448
  • `ReactConversation` exposes publicly writable state (HasFileDeliveries, ID, RunID, NodeID, Iteration, Done, and 12 more). — server/internal/models/models.go:487
  • `Sandbox` exposes publicly writable state (ModelBindingFingerprint, GitBindingsFingerprint, ID, Name, Profile, Purpose, and 24 more). — server/internal/models/models.go:875
  • `RunPreviewPort` exposes publicly writable state (ID, RunID, NodeID, ItemKey, Kind, Port, and 9 more). — server/internal/models/models.go:992
  • `Project` exposes publicly writable state (ID, Name, Description, RepoURL, DefaultBranch, RepoDirName, and 7 more). — server/internal/models/solo.go:11
  • `SoloSession` exposes publicly writable state (ID, UserID, Title, AgentName, ProjectID, ProjectSnapshot, and 31 more). — server/internal/models/solo.go:70
  • `SoloMessage` exposes publicly writable state (TurnID, Files, ID, SessionID, Role, Content, and 14 more). — server/internal/models/solo.go:212
  • `TokenUsageEvent` exposes publicly writable state (ID, ReportID, CreatedAt, Source, Phase, Status, and 15 more). — server/internal/models/token_usage_event.go:31
  • `TokenUsageReport` exposes publicly writable state (Committed, ID, CreatedAt, Source, Phase, Status, and 8 more). — server/internal/models/token_usage_event.go:59
  • `TeamService` exposes publicly writable state (Workspace, Skills). — server/internal/services/team.go:62

What to do

  • Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
DM7 · Repository granularity10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.

Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.

Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.

DM9 · Scattered domain decisions10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

M1 · Documentation (README)9.1 / 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 documentation5.0 / 10Adequate✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • `README.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `gateway`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — README.md:121

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • Update README.md so it draws the parts the code has today: add gateway.
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 · Observability7.2 / 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.

  • Only 3/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling8.0 / 10Strong✓ 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.

  • `docs/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — docs/package.json:12

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
P4 · Deployment & Rollback8.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.

What to do

  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P5 · DR & Backup7.0 / 10Strong✓ 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).
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 resilience3.0 / 10Weak✓ Tool-verified

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.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — server/internal/handlers/preview-pick.js:2124

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
P8 · Schema migrations3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

  • GORM AutoMigrate builds the schema from the model at startup and keeps no migration history, so there is no reviewed, repeatable upgrade path for an existing production database — a renamed column is dropped and re-added rather than migrated. Adopt a versioned migration tool such as golang-migrate, goose or Atlas, so every schema change is a versioned file applied the same way in every environment. (×2) — server/internal/database/database.go:253, sandbox-gateway/gateway/internal/database/database.go:29

What to do

  • Replace GORM AutoMigrate with a versioned migration tool such as golang-migrate, goose or Atlas so the production schema can evolve safely and reproducibly.
PF1 · Benchmark discipline9.0 / 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 hygiene6.0 / 10Adequate✓ 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.

  • `fs.writeFileSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — sandbox-gateway/scripts/mock-agent-model.mjs:451
  • `fs.readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — sandbox-gateway/scripts/mock-agent-model.mjs:479
  • `fs.writeSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — sandbox-gateway/scripts/mock-chat-model.mjs:242, sandbox-gateway/scripts/mock-chat-model.mjs:243

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety9.9 / 10Exemplary✓ 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.

R10 · Code Duplication7.5 / 10Strong✓ 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.

  • 63 duplicated blocks under web/src/ have copies in at least two of the sibling directories components, lib, views — 41 of them are reported below, and 22 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 63 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 63 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 63 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/components/run/ExecutionStatsPanel.vue:16
  • 31 duplicated blocks under web/src/components/ have copies in at least two of the sibling directories agent, canvas, chat, dashboard, run, shell (+5 more sibling(s) not listed) — 20 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 31 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 31 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 31 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/components/ui/AppSelect.vue:55
  • 19 duplicated blocks under web/src/lib/ have copies in at least two of the sibling directories agent, composables, inbox, run, shared, solo (+1 more sibling(s) not listed) — 17 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/lib/inbox/useGatesInbox.ts:3585
  • web/src/components/ui/AppSelect.vue:55 · web/src/components/workspace/AuditFilterDropdown.vue:46 — the two spans are one implementation copied and then locally edited — 1556 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. — web/src/components/ui/AppSelect.vue:55
  • web/src/components/agent/AgentTemplateSelect.vue:18 · web/src/components/dashboard/HomeWorkflowSelect.vue:6 — the two spans are one implementation copied and then locally edited — 930 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. — web/src/components/agent/AgentTemplateSelect.vue:18
  • web/src/lib/inbox/embedDemoPreview.ts:8 · web/src/lib/inbox/embedImagePreview.ts:14 — the two spans are one implementation copied and then locally edited — 553 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. — web/src/lib/inbox/embedDemoPreview.ts:8
  • web/src/components/run/ExecutionStatsPanel.vue:16 · web/src/lib/run/useExecutionStats.ts:602 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — web/src/components/run/ExecutionStatsPanel.vue:16
  • web/src/components/workspace/CodexDeviceLoginCard.vue:9 · web/src/components/workspace/GitHubDeviceLoginCard.vue:9 — the two spans are one implementation copied and then locally edited — 665 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. — web/src/components/workspace/CodexDeviceLoginCard.vue:9
  • web/src/views/EmbedNodeDemoView.vue:14 · web/src/views/EmbedNodeImageView.vue:18 — the two spans are one implementation copied and then locally edited — 424 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. — web/src/views/EmbedNodeDemoView.vue:14
  • web/src/components/agent/AgentChatTester.vue:920 · web/src/lib/solo/acpTurn.ts:52 — the two spans are one implementation copied and then locally edited — 729 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. — web/src/components/agent/AgentChatTester.vue:920
  • web/src/lib/run/useRunDetail.ts:1698 · web/src/views/RunDetailView.vue:146 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — web/src/lib/run/useRunDetail.ts:1698
  • web/src/lib/solo/useSessionModelCatalog.ts:26 · web/src/lib/solo/useSoloLauncher.ts:33 — the two spans are one implementation copied and then locally edited — 412 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. — web/src/lib/solo/useSessionModelCatalog.ts:26
  • web/src/components/ui/StatusFilter.vue:15 · web/src/components/ui/TagFilter.vue:22 — the two spans are one implementation copied and then locally edited — 295 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. — web/src/components/ui/StatusFilter.vue:15
  • web/src/components/run/gateApproval/GateApprovalContentFit.vue:67 · web/src/components/run/gateApproval/GateApprovalMobileFill.vue:58 — 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. — web/src/components/run/gateApproval/GateApprovalContentFit.vue:67
  • web/src/components/run/RunClarifyPanel.vue:74 · web/src/components/run/RunReviewPanel.vue:66 — the two spans are one implementation copied and then locally edited — 290 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. — web/src/components/run/RunClarifyPanel.vue:74
  • web/src/components/token-analytics/tokenAnalyticsCharts.ts:433 · web/src/views/TokenAnalyticsView.vue:267 — the two spans are one implementation copied and then locally edited — 347 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. — web/src/components/token-analytics/tokenAnalyticsCharts.ts:433
  • web/src/lib/run/runStats.ts:264 · web/src/lib/run/runStats.ts:299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — web/src/lib/run/runStats.ts:264
  • web/src/lib/agent/useAgentStudio.ts:928 · web/src/views/AgentStudioView.vue:74 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — web/src/lib/agent/useAgentStudio.ts:928
  • web/src/components/run/ClarifyChat.vue:367 · web/src/lib/inbox/useClarifyChat.ts:1631 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — web/src/components/run/ClarifyChat.vue:367
  • web/src/views/EmbedNodeArtifactsView.vue:153 · web/src/views/PublicGateApprovalView.vue:507 — the two spans are one implementation copied and then locally edited — 190 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. — web/src/views/EmbedNodeArtifactsView.vue:153
  • web/src/lib/inbox/useGatesInbox.ts:3585 · web/src/lib/run/useRunDetail.ts:844 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/lib/inbox/useGatesInbox.ts:3585
  • web/src/components/run/gateApproval/GateApprovalContentFit.vue:18 · web/src/components/run/gateApproval/GateApprovalDesktopBody.vue:16 — the two spans are one implementation copied and then locally edited — 70 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. — web/src/components/run/gateApproval/GateApprovalContentFit.vue:18
  • web/src/lib/workspace/useWorkflows.ts:173 · web/src/views/DashboardView.vue:413 — 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. — web/src/lib/workspace/useWorkflows.ts:173
  • web/src/components/agent/AgentSidebar.vue:80 · web/src/components/shell/SidebarAccountMenu.vue:68 — the two spans are one implementation copied and then locally edited — 167 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. — web/src/components/agent/AgentSidebar.vue:80
  • REDACTED:224 · REDACTED:334 — 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. — REDACTED:224
  • web/src/views/AgentStudioView.vue:171 · web/src/views/AgentStudioView.vue:197 — the two spans are one implementation copied and then locally edited — 105 tokens are still identical, in the same order in both spans, 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. — web/src/views/AgentStudioView.vue:171
  • web/src/lib/inbox/useGatesInbox.ts:1822 · web/src/lib/run/useRunDetail.ts:284 — 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. — web/src/lib/inbox/useGatesInbox.ts:1822
  • web/src/components/run/NodeOutputPanel.vue:111 · web/src/components/run/NodeOutputPanel.vue:158 — 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. — web/src/components/run/NodeOutputPanel.vue:111
  • web/src/lib/api/clients/agentsClient.ts:141 · web/src/lib/api/clients/agentsClient.ts:171 — 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. — web/src/lib/api/clients/agentsClient.ts:141
  • REDACTED:186 · REDACTED:308 — 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. — REDACTED:186
  • web/src/lib/run/useRunDetail.ts:889 · web/src/lib/run/useRunDetail.ts:945 — 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. — web/src/lib/run/useRunDetail.ts:889
  • web/src/components/dashboard/HomePrioritySelect.vue:92 · web/src/components/dashboard/HomeWorkflowSelect.vue:116 — 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. — web/src/components/dashboard/HomePrioritySelect.vue:92
  • web/src/components/run/editor/ObjectListField.vue:40 · web/src/components/run/editor/StringListField.vue:30 — 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. — web/src/components/run/editor/ObjectListField.vue:40
  • web/src/lib/agent/agentCreateWizard.ts:171 · web/src/lib/agent/agentTeamWizard.ts:38 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/src/lib/agent/agentCreateWizard.ts:171
  • web/src/components/agent/AgentTemplateSelect.vue:140 · web/src/components/dashboard/HomePrioritySelect.vue:101 — 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. — web/src/components/agent/AgentTemplateSelect.vue:140
  • web/src/components/run/ClarifyBootLoader.vue:40 · web/src/components/solo/SoloStartupCard.vue:29 — the two spans are one implementation copied and then locally edited — 115 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. — web/src/components/run/ClarifyBootLoader.vue:40
  • web/src/lib/inbox/sidebarPins.ts:13 · web/src/lib/run/useWorkflowFavorites.ts:36 — 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. — web/src/lib/inbox/sidebarPins.ts:13
  • web/src/lib/run/useWorkflowAskInputs.ts:8 · web/src/lib/workspace/useWorkflows.ts:98 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/lib/run/useWorkflowAskInputs.ts:8
  • web/src/components/run/SandboxStageSurface.vue:131 · web/src/views/SandboxConsoleView.vue:237 — 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. — web/src/components/run/SandboxStageSurface.vue:131
  • web/src/lib/api/clients/agentsClient.ts:13 · web/src/lib/api/clients/artifactsClient.ts:12 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/src/lib/api/clients/agentsClient.ts:13

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.
R11 · Import Boundaries9.7 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • web/src/components/canvas/composables/useAutoLayout.ts:1 imports elkjs/lib/elk.bundled.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/components/canvas/composables/useAutoLayout.ts:1
  • REDACTED:22 imports @novnc/novnc/lib/rfb.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:22
  • web/src/lib/agent/fixedEffort.ts:2 reaches into another package with a relative path (../../../../server/internal/modelrouting/provider_efforts.json) — import the package by name instead. — web/src/lib/agent/fixedEffort.ts:2

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity7.0 / 10Strong✓ 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.

  • onFrame has cyclomatic complexity 108 and cognitive complexity 165; 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. — web/src/lib/inbox/useGatesInbox.ts:2400
  • onFrame has cyclomatic complexity 82 and cognitive complexity 105; 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. — web/src/lib/solo/useSoloChat.ts:609
  • onClarifySend has cyclomatic complexity 70 and cognitive complexity 119; 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. — web/src/lib/inbox/useGatesInbox.ts:3322
  • renderSwitchers has cyclomatic complexity 67 and cognitive complexity 106; 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. — web/src/liveoverlay/overlay.ts:570
  • (anonymous) has cyclomatic complexity 59 and cognitive complexity 54; 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. — web/src/liveoverlay/overlay.ts:1132
  • fetch has cyclomatic complexity 57 and cognitive complexity 72; 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. — web/e2e/workspace-main.ts:50
  • applyReviewFrame has cyclomatic complexity 54 and cognitive complexity 71; 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. — web/src/lib/inbox/useGateApproval.ts:1501
  • recoverClarifySession has cyclomatic complexity 53 and cognitive complexity 46; 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. — web/src/lib/inbox/useGatesInbox.ts:2727
  • fetch has cyclomatic complexity 50 and cognitive complexity 78; 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. — web/e2e/gate-share-link-main.ts:181
  • onDrawer has cyclomatic complexity 47 and cognitive complexity 77; 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. — web/src/liveoverlay/overlay.ts:1317
  • applyRun has cyclomatic complexity 44 and cognitive complexity 48; 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. — web/src/lib/run/useRunLive.ts:305
  • onFrame has cyclomatic complexity 43 and cognitive complexity 62; 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. — web/src/lib/run/useRunLive.ts:505
  • onSend has cyclomatic complexity 42 and cognitive complexity 57; 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. — web/src/views/PublicGateApprovalView.vue:1061
  • onFrame has cyclomatic complexity 38 and cognitive complexity 57; 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. — web/src/lib/run/useRunDetailWs.ts:493
  • validateScenario 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. — sandbox-gateway/scripts/mock-agent-model.mjs:131
  • collectGraphIssues has cyclomatic complexity 37 and cognitive complexity 63; 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. — web/src/components/canvas/composables/useGraphIssues.ts:17
  • resolveAction has cyclomatic complexity 37 and cognitive complexity 62; 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. — sandbox-gateway/scripts/mock-agent-model.mjs:163
  • req has cyclomatic complexity 37 and cognitive complexity 58; 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. — web/src/lib/api/httpCore.ts:81
  • pruneObject has cyclomatic complexity 37 and cognitive complexity 50; 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. — web/src/lib/run/artifactForms.ts:405
  • (anonymous) has cyclomatic complexity 37 and cognitive complexity 48; 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. — web/e2e/inbox-confirm-leave.spec.ts:100
  • loadActiveRun has cyclomatic complexity 36 and cognitive complexity 44; 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. — web/src/lib/inbox/useGatesInbox.ts:2899
  • create has cyclomatic complexity 36 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 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. — web/src/components/workspace/WorkspaceCredentialsPanel.vue:636
  • onClarifySend has cyclomatic complexity 35 and cognitive complexity 46; 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. — web/src/lib/run/useRunDetail.ts:737
  • configuredModelChoices has cyclomatic complexity 35 and cognitive complexity 39; 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. — web/src/lib/solo/configuredModels.ts:62
  • (anonymous) has cyclomatic complexity 35 and cognitive complexity 30; 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. — web/src/components/canvas/composables/useFlowElements.ts:134
  • seed has cyclomatic complexity 35 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 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. — web/src/lib/run/useRunLive.ts:473
  • parseMarks has cyclomatic complexity 34 and cognitive complexity 52; 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. — web/src/lib/inbox/liveVariants.ts:135
  • resolveShortcut has cyclomatic complexity 34 and cognitive complexity 40; 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. — web/src/components/canvas/composables/useCanvasShortcuts.ts:70
  • mergeReconnectHistory has cyclomatic complexity 34 and cognitive complexity 39; 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. — web/src/components/agent/AgentChatTester.vue:695
  • parseEmbedLiveMessage has cyclomatic complexity 34 and cognitive complexity 39; 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. — web/src/lib/inbox/liveVariants.ts:201
  • fetch has cyclomatic complexity 34 and cognitive complexity 38; 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. — web/e2e/notifications-center-main.ts:341
  • submitFinal has cyclomatic complexity 33 and cognitive complexity 35; 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. — web/src/views/PublicGateApprovalView.vue:1005
  • selfIntersects has cyclomatic complexity 32 and cognitive complexity 71; 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. — web/src/components/canvas/composables/canvasHelpers.test.ts:118
  • loadPreview has cyclomatic complexity 32 and cognitive complexity 39; 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. — web/src/views/PublicGateApprovalView.vue:572
  • (anonymous) has cyclomatic complexity 32 and cognitive complexity 36; 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. — web/e2e/preview-review-inbox.spec.ts:89
  • (anonymous) has cyclomatic complexity 31 and cognitive complexity 67; 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. — web/src/lib/composables/useTestScreenshotLoad.ts:130
  • workflowGraphError has cyclomatic complexity 31 and cognitive complexity 43; 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. — web/src/lib/workflow/graphValidation.ts:27
  • startRun has cyclomatic complexity 31 and cognitive complexity 31; 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. — web/src/components/workflow/RunLaunchModal.vue:341
  • rebuildTurnsFromFrames has cyclomatic complexity 30 and cognitive complexity 40; 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. — web/src/components/agent/AgentChatTester.vue:636
  • (anonymous) has cyclomatic complexity 30 and cognitive complexity 32; 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. — web/e2e/clarify-empty-preview.spec.ts:68
R3 · Large Files4.8 / 10Weak✓ 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.

  • web/src/lib/inbox/useGatesInbox.ts has 3675 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/inbox/useGatesInbox.ts:1
  • web/src/lib/inbox/useGateApproval.ts has 2064 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/inbox/useGateApproval.ts:1
  • web/src/components/run/ClarifyChat.vue has 2033 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/run/ClarifyChat.vue:1
  • web/src/components/shell/AppSidebarNav.vue has 1905 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/shell/AppSidebarNav.vue:1
  • web/src/components/run/ReactArtifactStage.vue has 1895 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/run/ReactArtifactStage.vue:1
  • web/src/views/DashboardView.vue has 1835 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/DashboardView.vue:1
  • web/src/views/PublicGateApprovalView.vue has 1705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/PublicGateApprovalView.vue:1
  • web/src/components/workspace/WorkspaceAuditPanel.vue has 1685 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/workspace/WorkspaceAuditPanel.vue:1
  • web/src/lib/run/useRunDetail.ts has 1620 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/run/useRunDetail.ts:1
  • web/src/lib/inbox/useClarifyChat.ts has 1573 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/inbox/useClarifyChat.ts:1
  • web/src/components/workspace/WorkspaceCredentialsPanel.vue has 1568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/workspace/WorkspaceCredentialsPanel.vue:1
  • web/src/views/TokenAnalyticsView.vue has 1552 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/TokenAnalyticsView.vue:1
  • web/src/components/onboarding/OnboardingWizard.vue has 1366 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/onboarding/OnboardingWizard.vue:1
  • web/src/components/agent/AgentChatTester.vue has 1360 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/agent/AgentChatTester.vue:1
  • web/src/liveoverlay/overlay.ts has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/liveoverlay/overlay.ts:1
  • REDACTED has 1278 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • web/src/views/WorkflowEditorView.vue has 1193 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/WorkflowEditorView.vue:1
  • web/src/lib/solo/useSoloChat.ts has 1151 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/solo/useSoloChat.ts:1
  • web/src/views/RunDetailView.vue has 1029 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/RunDetailView.vue:1
  • web/src/lib/shared/types.ts has 1016 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/shared/types.ts:1
  • web/src/views/AgentStudioView.vue has 1012 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/AgentStudioView.vue:1
  • web/src/components/canvas/WorkflowCanvas.vue has 974 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/canvas/WorkflowCanvas.vue:1
  • web/src/views/RunListView.vue has 957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/RunListView.vue:1
  • web/src/components/run/ExecutionStatsPanel.vue has 941 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/run/ExecutionStatsPanel.vue:1
  • web/src/components/ui/HtmlPreview.vue has 925 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/ui/HtmlPreview.vue:1
  • web/src/lib/agent/useAgentStudio.ts has 915 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/agent/useAgentStudio.ts:1
  • web/src/components/agent/CliModelSelect.vue has 885 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/agent/CliModelSelect.vue:1
  • web/src/components/solo/SoloSessionPane.vue has 826 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/solo/SoloSessionPane.vue:1
  • web/src/components/workspace/ModelConfigurationManager.vue has 821 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/workspace/ModelConfigurationManager.vue:1
  • REDACTED has 816 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • web/src/lib/run/useRunLive.ts has 804 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/run/useRunLive.ts:1
  • web/src/components/run/ClarifyMessageThread.vue has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/run/ClarifyMessageThread.vue:1
  • web/src/components/run/ArtifactPreview.vue has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/run/ArtifactPreview.vue:1
  • web/src/lib/run/reactArtifactPreview.ts has 762 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/run/reactArtifactPreview.ts:1
  • web/src/components/run/GateProductEditor.vue has 739 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/run/GateProductEditor.vue:1
  • web/src/components/dashboard/HomeYumeCharacter.vue has 726 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/dashboard/HomeYumeCharacter.vue:1
  • web/src/views/SandboxListView.vue has 702 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/views/SandboxListView.vue:1
  • web/src/components/solo/ReferencePicker.vue has 692 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/solo/ReferencePicker.vue:1
  • web/src/components/workflow/RunLaunchModal.vue has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/workflow/RunLaunchModal.vue:1
  • web/src/lib/agent/useAgentFilesPanel.ts has 669 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/agent/useAgentFilesPanel.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.9 / 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.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×7) — web/scripts/measure-lcp.mjs:1, web/scripts/mermaid-validate-entry.mjs:1, sandbox-gateway/scripts/agent-ws-check.mjs:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
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.9 / 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.

  • 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) — web/src/components/agent/AgentEnvPanel.secretHint.test.ts:23, web/src/views/mobileScrollContract.test.ts:18

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene4.0 / 10Weak✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — web/src/locales/locales.compile.test.ts:12, web/src/components/ui/AppButton.test.ts:150, web/src/components/run/MermaidDiagram.math.test.ts:8

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports8.2 / 10Strong✓ 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.

  • web/src/components/run/editor/DiagramListField.vue → web/src/components/run/editor/ObjectListField.vue → web/src/components/run/editor/FormFields.vue → web/src/components/run/editor/DiagramListField.vue — web/src/components/run/editor/DiagramListField.vue:3

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. 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 `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document2.0 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `contentText` is exported and takes `v: unknown` from its caller, and it calls itself at line 36 (`contentText`) with a piece of `v` (and at line 40) — and nowhere in `contentText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `contentText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/src/lib/run/acpUnpack.ts:36
  • `emptyFieldValue` is exported, takes a document from its caller (line 364) and hands it to `fillObject`, which calls itself at line 391 (`fillObject`) with a piece of `obj` (and at line 393) — and nowhere in `fillObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `fillObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/src/lib/run/artifactForms.ts:391
  • `fromForm` is exported, takes a document from its caller (line 457) and hands it to `pruneObject`, which calls itself at line 435 (`pruneObject`) with a piece of `obj` (and at line 441) — and nowhere in `pruneObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `pruneObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/src/lib/run/artifactForms.ts:435
  • `isIntegrationsQuery` is exported and takes `raw: unknown` from its caller, and it calls itself at line 34 (`isIntegrationsQuery`) with a piece of `raw` — and nowhere in `isIntegrationsQuery` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `isIntegrationsQuery` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/src/data/settingsNav.ts:34

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation8.6 / 10Strong✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context or an AbortSignal (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 34/44 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `loadImageDownload` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/run/useArtifactPreview.ts:272
  • `redeemEmbedTicket` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/inbox/embedChat.ts:169
  • `pollShutdownHealth` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/composables/useShutdownState.ts:54
  • `exportAgent` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/agentsClient.ts:99
  • `exportWorkspaceAgents` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/agentsClient.ts:115
  • `importWorkspaceAgents` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/agentsClient.ts:136
  • `importAgent` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/agentsClient.ts:165
  • `packRunArtifacts` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/artifactsClient.ts:86
  • `deleteArtifact` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/artifactsClient.ts:113
  • `getRunNodeSandbox` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api/clients/runsClient.ts:431

What to do

  • Thread a context.Context or an AbortSignal through functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped5.4 / 10Adequate✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `T(r.className||"")` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — server/internal/handlers/preview-pick.js:92, web/public/preview-pick.js:92
  • `icon` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — server/internal/handlers/preview-pick.js:1604, web/public/preview-pick.js:1604
  • `spec?.body??''` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/agent/AgentIdentityGlyph.vue:10
  • `highlightName(o.name, search.trim())` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/agent/AgentTemplateSelect.vue:332
  • `highlightName(o.subtitle, search.trim())` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/agent/AgentTemplateSelect.vue:337
  • `previewHtml` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — web/src/components/agent/MarkdownSplitEditor.vue:343, web/src/components/agent/MarkdownSplitEditor.vue:385
  • `handoffHtml` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/canvas/edges/FlowEdge.vue:281
  • `highlightName(p.name, search.trim())` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/dashboard/HomeWorkflowSelect.vue:303
  • `renderChatMarkdown(b.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — web/src/components/run/AgentTimeline.vue:280, web/src/components/run/AgentTimeline.vue:319
  • `renderChatMarkdown(tailBlock.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/AgentTimeline.vue:286
  • `renderMarkdown(text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/ArtifactFilePreview.vue:61
  • `jsonState.html` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×4) — web/src/components/run/ArtifactPreview.vue:580, web/src/components/run/ArtifactPreview.vue:631, web/src/components/run/UpstreamRequirementContext.vue:262, …
  • `renderMarkdown(activeContent)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — web/src/components/run/ArtifactPreview.vue:586, web/src/components/run/ArtifactPreview.vue:670
  • `html` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/ChatUserMessage.vue:81
  • `renderChatMarkdown(ask.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/ClarifyHandoffBubble.vue:38
  • `svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/MermaidDiagram.vue:95
  • `renderMarkdown(clarified)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/NodeOutputPanel.vue:344
  • `renderMarkdown(structuredMd)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/NodeOutputPanel.vue:418
  • `renderMarkdown(nodeRun.outputMd || '')` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/NodeOutputPanel.vue:489
  • `renderMarkdown(card.markdown)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — web/src/components/run/OutputResultCardBody.vue:132, web/src/components/run/OutputResultCardBody.vue:143
  • `b` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/StreamMarkdown.vue:12
  • `renderMarkdown(gate.bodyMd)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/run/gateApproval/GateApprovalDesktopBody.vue:303
  • `highlight(row.label)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/ui/AppSelect.vue:481
  • `highlight(row.hint)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/ui/AppSelect.vue:485
  • `markup` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/components/ui/Icon.vue:69
  • `prettyPayload(ev.payload)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×3) — web/src/components/workspace/WorkspaceAuditPanel.vue:803, web/src/components/workspace/WorkspaceAuditPanel.vue:897, web/src/components/workspace/WorkspaceAuditPanel.vue:959
  • `renderChatMarkdown(markdown)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/lib/chat/messagePreview.ts:16
  • `key` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/lib/icons/runtime.ts:18
  • `html` is text this program did not author, and it is written into the text of an element through `outerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/src/lib/inbox/liveVariants.ts:189

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

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.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.4 / 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.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×37) — web/src/views/DashboardView.vue:669, web/src/views/DashboardView.vue:690, web/src/views/EmbedNodeChatView.vue:176, …
  • `catch` 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — web/src/views/PublicGateApprovalView.vue:743
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×2) — web/src/views/RunDetailView.vue:247, web/src/liveoverlay/scan.ts:126

What to do

  • Swallowed exception (empty catch)
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 types9.0 / 10Strong✓ 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.

  • ~2.6 `!` null assertions per 1k TypeScript source lines — 149 assertion(s) across the 56888 source line(s) of the 311 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web/src/lib/inbox/useGatesInbox.ts (13), web/src/lib/inbox/useClarifyChat.ts (11), web/src/components/canvas/composables/edgePath.ts (10). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

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 `?`).

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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 Health65.1Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture74.4Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity79.8StrongStrongest area.
Readiness52.4Adequate — gated by P7, P8Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security55.9Adequate — gated by D29, D31, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling51.4Adequate — gated by DM2, DM5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility42.4Weak — gated by AC4, AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance72.9StrongSolid.
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 — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 3 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 — 40 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.

  • AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • 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 — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.server.environment.GRASP_PUBLIC_ADVERTISE: required variable GRASP_PUBLIC_ADVERTISE is missing a value: Set the browser-facing HTTPS origin; runtime evidence skipped 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.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • 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.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 12 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
  • DM12 Ambient inputs in the domain — no domain-layer types detected — ambient-input check not applicable
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • DM6 Domain ↔ infrastructure boundary — no domain-layer types detected — domain↔infrastructure boundary check not applicable
  • DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 6 event-sourced shape(s) (event folds / event-recording aggregates); a store-then-publish dual write (persist + broker publish in one flow)
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 aggregate(s) with Apply/When folds; 5 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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.
  • 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.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X19 Unrestored process-global state — 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.
  • 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
  • X26 Unsynchronised callback handoff — X26 reached only 46% of this repository's production lines — typescript (132,056 lines), javascript (7,486 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X27 Collection changed while being enumerated — X27 reached only 46% of this repository's production lines — typescript (132,056 lines), javascript (7,486 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 — 213 finding(s)
D29 · Static Analysis (SAST) · 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
  • REDACTED
  • + 69 more in this group — see findings.md.
D31 · IaC & Container Security · High IaC · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×18
  • <input> without a programmatic label web/src/components/agent/AgentFilesPanel.vue:197 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/agent/AgentIconPicker.vue:180 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/agent/AgentMcpPanel.vue:130 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/agent/AgentWorkspaceHistoryPanel.vue:273 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/src/components/agent/CliModelSelect.vue:419 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/canvas/chrome/QuickAdd.vue:97 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:33 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:39 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:40 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:45 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/canvas/nodes/NodeShell.vue:120 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/src/components/run/ClarifyQuestionDeck.vue:94 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/run/GateProductEditor.vue:652 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label REDACTED:1043 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/token-analytics/TokenPricingModal.vue:144 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/token-analytics/TokenPricingModal.vue:153 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/src/components/ui/TagFilter.vue:203 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/src/components/workflow/CopyWorkflowModal.vue:104 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×13
  • Click handler on a non-interactive <div> web/src/components/agent/AgentFilesPanel.vue:345 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/AgentFilesPanel.vue:463 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/ExplorerContextMenu.vue:62 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/ExplorerContextMenu.vue:66 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/ExplorerContextMenu.vue:70 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/ExplorerContextMenu.vue:79 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/ExplorerContextMenu.vue:87 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/agent/ExplorerContextMenu.vue:95 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/run/CommentArtifactSidebar.vue:89 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/run/ReviewShell.vue:143 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/components/workspace/RepoChoiceList.vue:63 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/views/AgentStudioView.vue:952 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/src/views/RunDetailView.vue:406 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC5 · ARIA correctness · aria-hidden hides a focusable element · ×13
  • aria-hidden hides a focusable element web/src/components/agent/AgentFilesPanel.vue:364 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/canvas/NodePalette.vue:138 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/canvas/WorkflowCanvas.vue:959 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/dashboard/HomeWorkflowSelect.vue:316 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element REDACTED:1181 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element REDACTED:1226 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/shell/ShellChromeControls.vue:219 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/shell/StatusMetrics.vue:301 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/components/solo/ReferencePicker.vue:329 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/views/AgentStudioView.vue:288 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/views/AgentStudioView.vue:722 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/views/TokenAnalyticsView.vue:1168 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
  • aria-hidden hides a focusable element web/src/views/WorkflowsView.vue:105 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
AC2 · Forms & labels · <label> that labels no control · ×11
  • <label> that labels no control web/src/components/agent/AgentRuntimeBindings.vue:99 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/agent/AgentRuntimeBindings.vue:108 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/agent/AgentWorkspaceHistoryPanel.vue:272 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/onboarding/OnboardingTeamCard.vue:116 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/run/GateProductEditor.vue:651 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/run/GateProductEditor.vue:661 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/run/GateShareLinkPanel.vue:402 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/run/gateApproval/GateApprovalDesktopBody.vue:325 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/workflow/CopyWorkflowModal.vue:101 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/workflow/RunLaunchModal.vue:459 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/src/components/workflow/RunLaunchModal.vue:471 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · <textarea> without a programmatic label · ×7
  • <textarea> without a programmatic label web/src/components/canvas/inspector/GoalEditor.vue:96 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:52 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/src/components/chat/ChatComposerTextarea.vue:39 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label web/src/components/run/CommentPinInspectCard.vue:257 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/src/components/run/GateProductEditor.vue:662 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label web/src/components/run/GateShareLinkPanel.vue:403 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label web/src/components/ui/ParagraphInput.vue:161 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Focusable <div> isn't keyboard-operable · ×4
  • Focusable <div> isn't keyboard-operable web/src/components/canvas/NodePalette.vue:143 — This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
  • Focusable <div> isn't keyboard-operable web/src/components/canvas/WorkflowVersionDrawer.vue:88 — This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
  • Focusable <div> isn't keyboard-operable web/src/components/dashboard/HomeYumeCharacter.vue:380 — This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
  • Focusable <div> isn't keyboard-operable web/src/views/RunListView.vue:609 — This <div> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×4
  • Hover-only interaction on <div> web/src/components/canvas/edges/FlowEdge.vue:163 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <div> web/src/components/chat/ChatMessageRail.vue:283 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <div> web/src/components/chat/ChatMessageRail.vue:290 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
  • Hover-only interaction on <div> web/src/components/ui/TruncatedTextTooltip.vue:212 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <select> without a programmatic label · ×2
  • <select> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:34 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label web/src/components/canvas/inspector/VariablesField.vue:41 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <button> with no accessible text · ×2
  • <button> with no accessible text web/src/components/ui/AppDrawer.vue:33 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/src/components/ui/AppSwitch.vue:39 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC4 · Keyboard semantics · Clickable role="option" that no keyboard user can reach · ×2
  • Clickable role="option" that no keyboard user can reach web/src/components/solo/ReferencePicker.vue:392 — This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabindex="0" in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabindex="0"="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
  • Clickable role="option" that no keyboard user can reach web/src/components/solo/ReferencePicker.vue:408 — This <div> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabindex="0" in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabindex="0"="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: REDACTED ↔ descriptor.go REDACTED:1 — `REDACTED` (context cmd) and `server/internal/config/descriptor.go` (context internal) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `8c232b12` feat(solo): rolling workspace backups with scheduled archives and ver…; `f8abba1c` fix(server): remove offline execution initialization requirement (#1189); `28941d25` Harden preview isolation without breaking previews or embedding — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ sandbox_agent.go REDACTED:1 — `REDACTED` (context cmd) and `server/internal/services/sandbox_agent.go` (context internal) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 of the 11 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a3d7f6a7` feat(credentials): 让 OpenCode 按 Agent 选用模型厂商密钥; `b4a7c840` fix(opencode): support custom provider model IDs (#553); `84f9991a` fix(agent): merge shared SSH on Open paths and harden SSH fail-fast — run `git show` on any of them.
AC4 · Keyboard semantics · Hover-only interaction on <path> · ×1
  • Hover-only interaction on <path> web/src/components/canvas/edges/FlowEdge.vue:153 — This <path> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
AC4 · Keyboard semantics · Focusable <th> isn't keyboard-operable · ×1
  • Focusable <th> isn't keyboard-operable web/src/views/RunListView.vue:733 — This <th> carries tabindex="0", so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC4 · Keyboard semantics · Clickable role="separator" that no keyboard user can reach · ×1
  • Clickable role="separator" that no keyboard user can reach web/src/views/TokenAnalyticsView.vue:1269 — This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabindex="0", no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabindex="0"="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
AC4 · Keyboard semantics · Click handler on a non-interactive <tr> · ×1
  • Click handler on a non-interactive <tr> web/src/views/WorkflowsView.vue:132 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC5 · ARIA correctness · role="combobox" missing required aria-expanded · ×1
  • role="combobox" missing required aria-expanded web/src/components/canvas/chrome/QuickAdd.vue:97 — The combobox role requires aria-expanded to convey its state. Add it.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '@intlify/message-compiler' · ×1
  • Unlisted import '@intlify/message-compiler' web/src/locales/locales.compile.test.ts:12 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@vue/compiler-sfc' · ×1
  • Unlisted import '@vue/compiler-sfc' web/src/components/ui/AppButton.test.ts:150 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'katex' · ×1
  • Unlisted import 'katex' web/src/components/run/MermaidDiagram.math.test.ts:8 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) web/src/components/run/editor/DiagramListField.vue:3 — web/src/components/run/editor/DiagramListField.vue → web/src/components/run/editor/ObjectListField.vue → web/src/components/run/editor/FormFields.vue → web/src/components/run/editor/DiagramListField.vue
Serious — 1743 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×132
  • Hotspot: web/src/lib/inbox/useGatesInbox.ts web/src/lib/inbox/useGatesInbox.ts:2352 — web/src/lib/inbox/useGatesInbox.ts changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in useGatesInbox.useGatesInbox.connectActiveRunWs at line 2352. 31 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/inbox/useGatesInbox.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.
  • Hotspot: REDACTED REDACTED:56 — REDACTED changed 81 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in main.main at line 56. 22 of those changes were fix/bug commits, and the other 59 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08: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: web/src/lib/inbox/useClarifyChat.ts web/src/lib/inbox/useClarifyChat.ts:122 — web/src/lib/inbox/useClarifyChat.ts changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in useClarifyChat.useClarifyChat at line 122. 36 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/inbox/useClarifyChat.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.
  • Hotspot: web/src/lib/solo/useSoloChat.ts web/src/lib/solo/useSoloChat.ts:609 — web/src/lib/solo/useSoloChat.ts changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in useSoloChat.useSoloChat.onFrame at line 609. 23 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/solo/useSoloChat.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.
  • Hotspot: server/internal/engine/resume.go server/internal/engine/resume.go:380 — server/internal/engine/resume.go changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in Engine.reactReply at line 380. 14 of those changes were fix/bug commits, and the other 24 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/engine/resume.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: web/src/views/PublicGateApprovalView.vue web/src/views/PublicGateApprovalView.vue:1061 — web/src/views/PublicGateApprovalView.vue changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in onSend at line 1061. 18 of those changes were fix/bug commits, and the other 24 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/views/PublicGateApprovalView.vue`: 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: server/internal/runtime/acp_react.go server/internal/runtime/acp_react.go:124 — server/internal/runtime/acp_react.go changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in acpProvider.ReactReply at line 124. 19 of those changes were fix/bug commits, and the other 23 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/runtime/acp_react.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: server/internal/config/config.go server/internal/config/config.go:499 — server/internal/config/config.go changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in config.applyEnvOverrides at line 499. 8 of those changes were fix/bug commits, and the other 31 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/config/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.
  • Hotspot: server/internal/services/sandbox_studio.go server/internal/services/sandbox_studio.go:376 — server/internal/services/sandbox_studio.go changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in SandboxService.ChatWithTimeout at line 376. 2 of those changes were fix/bug commits, and the other 57 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/services/sandbox_studio.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: web/src/components/shell/AppSidebarNav.vue web/src/components/shell/AppSidebarNav.vue:1189 — web/src/components/shell/AppSidebarNav.vue changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in settleRunGroups at line 1189. 23 of those changes were fix/bug commits, and the other 36 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/shell/AppSidebarNav.vue`: 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: server/internal/engine/review_session.go server/internal/engine/review_session.go:713 — server/internal/engine/review_session.go changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in Engine.executeClarifyTurn at line 713. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/engine/review_session.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: server/internal/services/solo.go server/internal/services/solo.go:437 — server/internal/services/solo.go changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in SoloService.Create at line 437. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/services/solo.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: server/internal/runtime/acp_sandbox.go server/internal/runtime/acp_sandbox.go:477 — server/internal/runtime/acp_sandbox.go changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in acpProvider.spec at line 477. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/runtime/acp_sandbox.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: server/internal/services/workspace_credentials.go server/internal/services/workspace_credentials.go:356 — server/internal/services/workspace_credentials.go changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in CredentialService.updateOnce at line 356. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/services/workspace_credentials.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: web/src/lib/run/useRunDetail.ts web/src/lib/run/useRunDetail.ts:62 — web/src/lib/run/useRunDetail.ts changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in useRunDetail.useRunDetail at line 62. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/run/useRunDetail.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.
  • Hotspot: web/src/lib/run/useHomeApproveChat.ts web/src/lib/run/useHomeApproveChat.ts:114 — web/src/lib/run/useHomeApproveChat.ts changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in useHomeApproveChat.useHomeApproveChat at line 114. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/run/useHomeApproveChat.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.
  • Hotspot: web/src/components/agent/AgentChatTester.vue web/src/components/agent/AgentChatTester.vue:636 — web/src/components/agent/AgentChatTester.vue changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in rebuildTurnsFromFrames at line 636. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/agent/AgentChatTester.vue`: 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:251 — REDACTED changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in E2E.run_matrix at line 251. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08: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: server/internal/sandbox/manager.go server/internal/sandbox/manager.go:408 — server/internal/sandbox/manager.go changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in Manager.Create at line 408. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/sandbox/manager.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: web/src/liveoverlay/overlay.ts web/src/liveoverlay/overlay.ts:150 — web/src/liveoverlay/overlay.ts changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in overlay.createOverlay at line 150. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/liveoverlay/overlay.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.
  • Hotspot: web/src/lib/run/useRunLive.ts web/src/lib/run/useRunLive.ts:305 — web/src/lib/run/useRunLive.ts changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in useRunLive.useRunLive.applyRun at line 305. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/run/useRunLive.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.
  • Hotspot: server/internal/services/agent.go server/internal/services/agent.go:412 — server/internal/services/agent.go changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in AgentService.prepareSave at line 412. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/services/agent.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: server/internal/engine/execute.go server/internal/engine/execute.go:298 — server/internal/engine/execute.go changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Engine.executeFrom at line 298. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/engine/execute.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: sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.go sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.go:335 — sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.go changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in engine.Prompt at line 335. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.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: server/internal/engine/live.go server/internal/engine/live.go:132 — server/internal/engine/live.go changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in Engine.ReactLiveWithAttachmentsAs at line 132. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/engine/live.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.
  • + 107 more in this group — see findings.md.
D31 · IaC & Container Security · Medium IaC · ×49
  • 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
  • + 24 more in this group — see findings.md.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×40
  • Untrusted text written into markup unescaped server/internal/handlers/preview-pick.js:92 — `T(r.className||"")` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped server/internal/handlers/preview-pick.js:1604 — `icon` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/public/preview-pick.js:92 — `T(r.className||"")` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/public/preview-pick.js:1604 — `icon` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/agent/AgentIdentityGlyph.vue:10 — `spec?.body??''` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/agent/AgentTemplateSelect.vue:332 — `highlightName(o.name, search.trim())` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/agent/AgentTemplateSelect.vue:337 — `highlightName(o.subtitle, search.trim())` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/agent/MarkdownSplitEditor.vue:343 — `previewHtml` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/agent/MarkdownSplitEditor.vue:385 — `previewHtml` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/canvas/edges/FlowEdge.vue:281 — `handoffHtml` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/dashboard/HomeWorkflowSelect.vue:303 — `highlightName(p.name, search.trim())` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/AgentTimeline.vue:280 — `renderChatMarkdown(b.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/AgentTimeline.vue:286 — `renderChatMarkdown(tailBlock.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/AgentTimeline.vue:319 — `renderChatMarkdown(b.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ArtifactFilePreview.vue:61 — `renderMarkdown(text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ArtifactPreview.vue:580 — `jsonState.html` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ArtifactPreview.vue:586 — `renderMarkdown(activeContent)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ArtifactPreview.vue:631 — `jsonState.html` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ArtifactPreview.vue:670 — `renderMarkdown(activeContent)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ChatUserMessage.vue:81 — `html` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/ClarifyHandoffBubble.vue:38 — `renderChatMarkdown(ask.text)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/MermaidDiagram.vue:95 — `svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/NodeOutputPanel.vue:344 — `renderMarkdown(clarified)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/NodeOutputPanel.vue:418 — `renderMarkdown(structuredMd)` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/src/components/run/NodeOutputPanel.vue:489 — `renderMarkdown(nodeRun.outputMd || '')` is text this program did not author, and it is written into the text of an element through Vue's `v-html` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • + 15 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×39
  • Swallowed exception (empty catch) web/src/views/DashboardView.vue:669 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/DashboardView.vue:690 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/EmbedNodeChatView.vue:176 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/ProjectsView.vue:91 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/PublicGateApprovalView.vue:844 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/PublicGateApprovalView.vue:1120 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/PublicGateApprovalView.vue:1130 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/RunDetailView.vue:247 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/views/RunListView.vue:434 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/SandboxConsoleView.vue:72 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/SandboxConsoleView.vue:169 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/views/SandboxConsoleView.vue:243 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/liveoverlay/describe.ts:91 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/liveoverlay/overlay.ts:414 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/liveoverlay/scan.ts:126 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/liveoverlay/viewStore.ts:31 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/solo/soloPrefs.ts:26 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/solo/soloPrefs.ts:51 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/solo/soloPrefs.ts:63 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/solo/useSoloChat.ts:397 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/solo/useSoloChat.ts:603 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/solo/useSoloChat.ts:817 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/shared/blobMissingCache.ts:21 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/shared/blobMissingCache.ts:39 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/shared/copyToClipboard.ts:19 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 14 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×36
  • FunctionTooLong: useGatesInbox.useGatesInbox web/src/lib/inbox/useGatesInbox.ts:107 — FunctionTooLong — useGatesInbox runs 2604 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2504 over it, 26.04× 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: useRunDetail.useRunDetail web/src/lib/run/useRunDetail.ts:62 — FunctionTooLong — useRunDetail runs 1234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1134 over it, 12.34× 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: useClarifyChat.useClarifyChat web/src/lib/inbox/useClarifyChat.ts:122 — FunctionTooLong — useClarifyChat runs 1063 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 963 over it, 10.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: overlay.createOverlay web/src/liveoverlay/overlay.ts:150 — FunctionTooLong — createOverlay runs 1025 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 925 over it, 10.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: useSoloChat.useSoloChat web/src/lib/solo/useSoloChat.ts:58 — FunctionTooLong — useSoloChat runs 901 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 801 over it, 9.01× 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: useAgentStudio.useAgentStudio web/src/lib/agent/useAgentStudio.ts:32 — FunctionTooLong — useAgentStudio runs 743 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 643 over it, 7.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: useRunLive.useRunLive web/src/lib/run/useRunLive.ts:69 — FunctionTooLong — useRunLive runs 571 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 471 over it, 5.71× 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: useAgentFilesPanel.useAgentFilesPanel web/src/lib/agent/useAgentFilesPanel.ts:32 — FunctionTooLong — useAgentFilesPanel runs 542 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 442 over it, 5.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: mcp.artifactTools server/internal/mcp/tools.go:342 — FunctionTooLong — artifactTools runs 522 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 422 over it, 5.22× 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: useExecutionStats.useExecutionStats web/src/lib/run/useExecutionStats.ts:53 — FunctionTooLong — useExecutionStats runs 432 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 332 over it, 4.32× 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: useRunDetailWs.useRunDetailWs web/src/lib/run/useRunDetailWs.ts:35 — FunctionTooLong — useRunDetailWs runs 422 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× 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: main.main REDACTED:56 — FunctionTooLong — main runs 418 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 318 over it, 4.18× 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: useHomeApproveChat.useHomeApproveChat web/src/lib/run/useHomeApproveChat.ts:114 — FunctionTooLong — useHomeApproveChat runs 392 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 292 over it, 3.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: router.New server/internal/router/router.go:19 — FunctionTooLong — New runs 338 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 238 over it, 3.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.
  • FunctionTooLong: useRunDetailLiveLog.useRunDetailLiveLog web/src/lib/run/useRunDetailLiveLog.ts:38 — FunctionTooLong — useRunDetailLiveLog runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× 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: useWorkflows.useWorkflows web/src/lib/workspace/useWorkflows.ts:20 — FunctionTooLong — useWorkflows runs 316 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 216 over it, 3.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.
  • FunctionTooLong: useCanvasEditor.useCanvasEditor web/src/components/canvas/composables/useCanvasEditor.ts:33 — FunctionTooLong — useCanvasEditor runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× 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: htmlPreviewSandbox.buildInspectScript web/src/lib/shared/htmlPreviewSandbox.ts:162 — FunctionTooLong — buildInspectScript runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: reviewSessionState.createReviewSessionState web/src/lib/chat/reviewSessionState.ts:69 — FunctionTooLong — createReviewSessionState runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: useGatesInbox.useGatesInbox.connectActiveRunWs web/src/lib/inbox/useGatesInbox.ts:2352 — FunctionTooLong — useGatesInbox.connectActiveRunWs runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× 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: useAgentImport.useAgentImport web/src/lib/agent/useAgentImport.ts:16 — FunctionTooLong — useAgentImport runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: useSoloLauncher.useSoloLauncher web/src/lib/solo/useSoloLauncher.ts:27 — FunctionTooLong — useSoloLauncher runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: useGatesInbox.useGatesInbox.onClarifySend web/src/lib/inbox/useGatesInbox.ts:3322 — FunctionTooLong — useGatesInbox.onClarifySend runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.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.
  • FunctionTooLong: useFlowElements.useFlowElements web/src/components/canvas/composables/useFlowElements.ts:98 — FunctionTooLong — useFlowElements 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: useRunDetailSelection.useRunDetailSelection web/src/lib/run/useRunDetailSelection.ts:16 — FunctionTooLong — useRunDetailSelection 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.
  • + 11 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×29
  • Repeated repair: web/src/components/run/AgentTimeline.vue web/src/components/run/AgentTimeline.vue:207 — web/src/components/run/AgentTimeline.vue changed 22 times in last 90 days and 13 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 (anonymous) at line 207), 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(solo): apply a running turn's replay in one batch when switching back (#1256)”; “fix(web): show resumed stream text at once instead of retyping it (#1229)”; “fix(solo): render local screenshots and preserve reply paragraphs (#1172)”; “fix(web): restore Solo chat UX and workflow history loading (#1155)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/AgentTimeline.vue`: 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: server/internal/services/sandbox_solo_recovery.go server/internal/services/sandbox_solo_recovery.go:20 — server/internal/services/sandbox_solo_recovery.go changed 18 times in last 90 days and 12 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 SandboxService.reconcileSoloSandbox at line 20), 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(solo): wait for the bridge after waking a paused sandbox and retry failed wakes (#1243)”; “fix(sandbox): surface solo pause with wake, keep chat route on lost sandbox, auto-reconnect stage panels (#1242)”; “fix(mcp): derive artifact MCP token validity from the scope owner (#797) (#1228)”; “fix(e2b): pause instead of kill at lifetime cap; resume paused Solo sandboxes on use (#1217)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/services/sandbox_solo_recovery.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: server/internal/sandbox/events.go server/internal/sandbox/events.go:350 — server/internal/sandbox/events.go changed 14 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 14 (its worst body is sandbox.applyToolCall at line 350), 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(sandbox): keep the CLI session when resume hits a network error (#1280)”; “fix: reconcile and persist token usage across all agent sources”; “fix: preserve CLI model variants and surface chat failures (#1009)”; “fix: Agent 卡住可终止、正常运行不误杀;测试门禁拒绝占位结论;OOM 原因上报 (#765)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/sandbox/events.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: web/src/components/run/MermaidDiagram.vue web/src/components/run/MermaidDiagram.vue:105 — web/src/components/run/MermaidDiagram.vue 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 15 (its worst body is render at line 105), 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(run): 产物计划图不再闪烁 (#708)”; “fix/plan mermaid serial render (#622)”; “fix(web): clear in-scope right-angle borders with role radius tokens (#496)”; “fix(plan): isolate MermaidDiagram cleanup and render ids for concurrent diagrams”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/MermaidDiagram.vue`: 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: web/src/components/run/llm/RunLlmTranscript.vue web/src/components/run/llm/RunLlmTranscript.vue:85 — web/src/components/run/llm/RunLlmTranscript.vue changed 11 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 7 (its worst body is (anonymous) at line 85), 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(dialogue): drive clarify/review chats from server-side dialogue state (#1080)”; “fix: recover workflow chat and order concurrent session state”; “fix: reconcile accepted chat messages by send identity”; “fix: keep an accepted user message on screen before the live frame”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/llm/RunLlmTranscript.vue`: 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: web/src/lib/inbox/sidebarRunRows.ts web/src/lib/inbox/sidebarRunRows.ts:131 — web/src/lib/inbox/sidebarRunRows.ts changed 9 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 sidebarRunRows.uniqueAutoDestination at line 131), 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(runs): keep every in-progress workflow in the current lists (#1194)”; “fix: keep a confirmed automatic run in 自动过程 after refresh”; “fix(web): keep a confirmed automatic handoff in the auto sidebar group (#992)”; “fix: hold agent boot until the confirm window has left (#989)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/inbox/sidebarRunRows.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: web/src/views/LoginView.vue web/src/views/LoginView.vue:33 — web/src/views/LoginView.vue changed 8 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 3 (its worst body is onSubmit at line 33), 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: session cookie TTL, admin role after login, brand check on docs output (#1137 #1138 #1139) (#1236)”; “fix(web): 浅色首页口号可读,侧栏与登录页补上黑白角色 (#798)”; “fix: 复审开关即时生效、删除登录限流、数据库故障不再显示为空列表 (#753)”; “fix(login): 长回跳路径在提示条内单行截断 (#702)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/views/LoginView.vue`: 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:103 — REDACTED changed 8 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 15 (its worst body is markdown.cjkEmStrong at line 103), 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(web): render bold/italic when CJK punctuation touches the delimiter (#1230)”; “fix(solo): render local screenshots and preserve reply paragraphs (#1172)”; “fix(chat): show @ references in place; open chat links in a new window or the sandbox browser (#1088)”; “fix(web): stop bare URLs from swallowing the following Chinese (#977)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08: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: web/src/lib/run/recentRuns.ts web/src/lib/run/recentRuns.ts:92 — web/src/lib/run/recentRuns.ts changed 8 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 10 (its worst body is recentRuns.recentRunTarget at line 92), 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(sidebar): keep failed runs in history beside newer Solo sessions (#1181)”; “fix(board): count replying waiting_human runs as running on the board and status bar (#1180)”; “fix(web): list ended Solo sessions in sidebar history and pin across row kinds (#1092)”; “fix(sidebar): open the live chat when an automatic visit has not started (#1065)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/run/recentRuns.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: server/internal/runtime/acp_timeline.go server/internal/runtime/acp_timeline.go:125 — server/internal/runtime/acp_timeline.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 10 (its worst body is runtime.mergeTurnEvents at line 125), 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: Agent 卡住可终止、正常运行不误杀;测试门禁拒绝占位结论;OOM 原因上报 (#765)”; “fix(acp): 暂停的会话不再刷 channel full,空闲时不再每 2 秒拨 /ws (#735)”; “fix(runtime): preserve retry errors and authenticate sandbox history (#690)”; “fix(react): keep full Thought text without …(truncated)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/runtime/acp_timeline.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: web/src/components/run/LiveVariantCard.vue web/src/components/run/LiveVariantCard.vue:45 — web/src/components/run/LiveVariantCard.vue changed 7 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 (anonymous) 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(web): show read-only Live cards in the main app chat”; “fix(web): Live 请求生成中显示加载卡片,切换栏不再吞点击 (#813) (#816)”; “fix(chat): 工具转圈动起来、带工具的回复平滑输出、Live 候选卡片执行完再出现 (#742)”; “fix(live): 调参条不再盖住切换条,候选卡片跟在回复后且只在预览页显示 (#732)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/LiveVariantCard.vue`: 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: web/src/components/run/gateApproval/GateApprovalComposer.vue web/src/components/run/gateApproval/GateApprovalComposer.vue:12 — web/src/components/run/gateApproval/GateApprovalComposer.vue changed 7 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 2 (its worst body is (anonymous) at line 12), 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: keep workflow and approval waiters in the queue until their turn begins (#1058)”; “fix: reconcile accepted chat messages by send identity”; “fix: keep an accepted user message on screen before the live frame”; “fix(react): keep pending-queue annotations on re-edit (#487)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/gateApproval/GateApprovalComposer.vue`: 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: web/src/components/ui/AppButton.vue web/src/components/ui/AppButton.vue:20 — web/src/components/ui/AppButton.vue changed 7 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 (anonymous) at line 20), 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: keep disabled next and cancel free of the elevated hover fill (#968)”; “fix(web): unify solid accent button hover fill on brand purple token (#608)”; “fix(web): keep AppButton slot inline icons on one row (#599)”; “fix(web): pin settings buttons to 36px on desktop with 44px mobile touch. (#503)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/ui/AppButton.vue`: 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: web/src/components/run/GateShareLinkPanel.vue web/src/components/run/GateShareLinkPanel.vue:85 — web/src/components/run/GateShareLinkPanel.vue 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 7 (its worst body is (anonymous) at line 85), 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: 远程打开时审批链接不再停在 localhost (#812)”; “fix(web): unify solid accent button hover fill on brand purple token (#608)”; “fix(web): round enlarge CTA and float mobile nav drawer (#498)”; “fix(web): clear in-scope right-angle borders with role radius tokens (#496)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/GateShareLinkPanel.vue`: 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:139 — REDACTED 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 7 (its worst body is auth.ValidateRedirect at line 139), 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(auth): end sessions when an account's password hash changes (#1235)”; “fix: session cookie TTL, admin role after login, brand check on docs output (#1137 #1138 #1139) (#1236)”; “fix(auth): end sessions of accounts removed from auth.users (#1134) (#1231)”; “fix: 复审开关即时生效、删除登录限流、数据库故障不再显示为空列表 (#753)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08: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: sandbox-gateway/sandbox/internal/provider/provider.go sandbox-gateway/sandbox/internal/provider/provider.go:38 — sandbox-gateway/sandbox/internal/provider/provider.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 2 (its worst body is provider.TimeoutStopReason at line 38), 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(sandbox): fence attachment notes and keep attachments across turns (#1123) (#1234)”; “fix: reconcile and persist token usage across all agent sources”; “fix: Agent 卡住可终止、正常运行不误杀;测试门禁拒绝占位结论;OOM 原因上报 (#765)”; “fix(chat): stop confirm-and-advance from hiding behind a hung sandbox turn (#663)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- sandbox-gateway/sandbox/internal/provider/provider.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: sandbox-gateway/sandbox/internal/provider/modelconnection/configs.go sandbox-gateway/sandbox/internal/provider/modelconnection/configs.go:50 — sandbox-gateway/sandbox/internal/provider/modelconnection/configs.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 modelconnection.prepareCodeBuddy at line 50), 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: expose native OpenCode thought events in chat”; “fix: pass catalog model ids into agent launch arguments”; “fix: honor the chat model selected on a custom connection”; “fix: preserve image capabilities for API-connected coding models (#1008)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- sandbox-gateway/sandbox/internal/provider/modelconnection/configs.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: web/src/lib/solo/referenceTokens.ts web/src/lib/solo/referenceTokens.ts:79 — web/src/lib/solo/referenceTokens.ts 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 11 (its worst body is referenceTokens.restoreTokens 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(solo): keep every link when pasting several references (#1211)”; “fix(chat): show @ references in place; open chat links in a new window or the sandbox browser (#1088)”; “fix(web): open the @ picker after IME input and right after Chinese text”; “fix(solo): reuse the workflow pending queue panel with reorder and edit (#1081)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/lib/solo/referenceTokens.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: web/src/components/run/CommentPinInspectCard.vue web/src/components/run/CommentPinInspectCard.vue:84 — web/src/components/run/CommentPinInspectCard.vue 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 10 (its worst body is (anonymous) at line 84), 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(chat): unify IME Enter handling and remove Solo dead code (#1157)”; “fix(web): unify solid accent button hover fill on brand purple token (#608)”; “fix(web): clear in-scope right-angle borders with role radius tokens (#496)”; “fix(web): 锁定取点标注卡深色面并按祖先纯色填叶子截图 (#352)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/run/CommentPinInspectCard.vue`: 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: web/src/components/ui/AppSwitch.vue web/src/components/ui/AppSwitch.vue:30 — web/src/components/ui/AppSwitch.vue 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 3 (its worst body is onKeydown at line 30), 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: animate workflow default clicks inside the open dialog”; “fix(web): tint the enabled AppSwitch track with accent hover (#945)”; “fix(web): clear in-scope right-angle borders with role radius tokens (#496)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/ui/AppSwitch.vue`: 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: sandbox-gateway/sandbox/internal/service/bridge_watchdog.go sandbox-gateway/sandbox/internal/service/bridge_watchdog.go:123 — sandbox-gateway/sandbox/internal/service/bridge_watchdog.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 15 (its worst body is Bridge.watchTurn 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: only stop agent turns on no activity, not total time (#1055)”; “fix(sandbox): 结束让 cursor 回合卡住的后台任务 (#767)”; “fix: Agent 卡住可终止、正常运行不误杀;测试门禁拒绝占位结论;OOM 原因上报 (#765)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- sandbox-gateway/sandbox/internal/service/bridge_watchdog.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: web/src/components/canvas/edges/FlowEdge.vue web/src/components/canvas/edges/FlowEdge.vue:50 — web/src/components/canvas/edges/FlowEdge.vue 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 5 (its worst body is (anonymous) at line 50), 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(web): keep each traced handoff on the run canvas (#818)”; “fix: 运行沙箱租约生命周期 + 测试节点 MCP 失效与分支错误 + 节点 handoff (#796)”; “fix(web): 回退线改走卡片下方的单条折线 (#770)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/canvas/edges/FlowEdge.vue`: 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: web/src/components/ui/LangSelect.vue web/src/components/ui/LangSelect.vue:76 — web/src/components/ui/LangSelect.vue 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 onDocClick at line 76), 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(web): round enlarge CTA and float mobile nav drawer (#498)”; “fix(web): clear in-scope right-angle borders with role radius tokens (#496)”; “fix: teleport sidebar footer tip and lang menu above trigger (#388)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/ui/LangSelect.vue`: 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: server/internal/handlers/react_sessions_dto.go server/internal/handlers/react_sessions_dto.go:23 — server/internal/handlers/react_sessions_dto.go changed 4 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 6 (its worst body is handlers.reactSessionsDTO at line 23), 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(dialogue): drive clarify/review chats from server-side dialogue state (#1080)”; “fix: recover workflow chat and order concurrent session state”; “fix(inbox): drop idle clarify bubbles once the refresh snapshot lands”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- server/internal/handlers/react_sessions_dto.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: web/src/components/ui/PrioritySegmented.vue web/src/components/ui/PrioritySegmented.vue:31 — web/src/components/ui/PrioritySegmented.vue changed 4 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 btnClass at line 31), 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(web): keep the normal priority control visually quiet (#941)”; “fix(web): unify segmented transitions and sidebar navigation (#921)”; “fix(web): clear in-scope right-angle borders with role radius tokens (#496)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 06:08:12 +08:00' --until='2026-11-17 06:08:12 +08:00' --full-history --no-merges -- web/src/components/ui/PrioritySegmented.vue`: 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.
  • + 4 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×29
  • FileTooLong: inbox/useGatesInbox.ts web/src/lib/inbox/useGatesInbox.ts — FileTooLong — 2708 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: useGatesInbox (107-3832). The bar is 500 significant lines; this is 2208 over it, 5.42× 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: run/useRunDetail.ts web/src/lib/run/useRunDetail.ts — FileTooLong — 1284 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: useRunDetail (62-1742). The bar is 500 significant lines; this is 784 over it, 2.57× 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: inbox/useClarifyChat.ts web/src/lib/inbox/useClarifyChat.ts — FileTooLong — 1164 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: useClarifyChat (122-1725). The bar is 500 significant lines; this is 664 over it, 2.33× 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: liveoverlay/overlay.ts web/src/liveoverlay/overlay.ts — FileTooLong — 1133 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: createOverlay (150-1448). The bar is 500 significant lines; this is 633 over it, 2.27× 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: solo/useSoloChat.ts web/src/lib/solo/useSoloChat.ts — FileTooLong — 936 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: useSoloChat (58-1209). The bar is 500 significant lines; this is 436 over it, 1.87× 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: services/global_token_stats.go server/internal/services/global_token_stats.go — FileTooLong — 933 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 433 over it, 1.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: js/home.js docs/site/js/home.js — FileTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 432 over it, 1.86× 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: agent/useAgentStudio.ts web/src/lib/agent/useAgentStudio.ts — FileTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: useAgentStudio (32-994). The bar is 500 significant lines; this is 265 over it, 1.53× 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: mcp/tools.go server/internal/mcp/tools.go — FileTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: artifactTools (342-992). The bar is 500 significant lines; this is 252 over it, 1.50× 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: runtime/acp_react.go server/internal/runtime/acp_react.go — FileTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: acpProvider (21 blocks, 21-974). The bar is 500 significant lines; this is 212 over it, 1.42× 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: shared/types.ts web/src/lib/shared/types.ts — FileTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 205 over it, 1.41× 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: handlers/gate_share_public.go server/internal/handlers/gate_share_public.go — FileTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: Handlers (23 blocks, 63-937). The bar is 500 significant lines; this is 190 over it, 1.38× 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: engine/review_session.go server/internal/engine/review_session.go — FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: Engine (44 blocks, 97-1101). 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: REDACTED REDACTED — FileTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 130 over it, 1.26× 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: run/useRunLive.ts web/src/lib/run/useRunLive.ts — FileTooLong — 614 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: useRunLive (69-839). The bar is 500 significant lines; this is 114 over it, 1.23× 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: models/models.go server/internal/models/models.go — FileTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 112 over it, 1.22× 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: gateshare/service.go server/internal/gateshare/service.go — FileTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: Service (24 blocks, 71-840). The bar is 500 significant lines; this is 109 over it, 1.22× 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: services/sandbox_studio.go server/internal/services/sandbox_studio.go — FileTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: SandboxService (24 blocks, 32-921). The bar is 500 significant lines; this is 108 over it, 1.22× 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: run/reactArtifactPreview.ts web/src/lib/run/reactArtifactPreview.ts — FileTooLong — 586 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 86 over it, 1.17× 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: api/apiTypes.ts web/src/lib/api/apiTypes.ts — FileTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 78 over it, 1.16× 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: browser/rod.go server/internal/browser/rod.go — FileTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 67 over it, 1.13× 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: agent/useAgentFilesPanel.ts web/src/lib/agent/useAgentFilesPanel.ts — FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: useAgentFilesPanel (32-737). The bar is 500 significant lines; this is 62 over it, 1.12× 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: models/live.go server/internal/models/live.go — FileTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 55 over it, 1.11× 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: browser/service.go server/internal/browser/service.go — FileTooLong — 548 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: Service (25 blocks, 70-892). The bar is 500 significant lines; this is 48 over it, 1.10× 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: mcp/plan.go server/internal/mcp/plan.go — FileTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 29 over it, 1.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.
  • + 4 more in this group — see findings.md.
AC6 · Visual & motion safety · Focus outline removed inline · ×21
  • Focus outline removed inline web/src/components/agent/AgentCapabilitiesPanel.vue:310 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/agent/AgentFilesPanel.vue:197 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/agent/AgentMcpPanel.vue:130 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/agent/AgentWorkspaceHistoryPanel.vue:273 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/agent/CliModelSelect.vue:419 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/agent/MarkdownViewToggle.vue:21 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/canvas/nodes/NodeShell.vue:120 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/run/CommentPinInspectCard.vue:257 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/run/GateProductEditor.vue:652 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/run/GateProductEditor.vue:662 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline REDACTED:1043 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/run/StructuredProductPanel.vue:357 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/ui/AppSelect.vue:433 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/ui/ChatImageThumb.vue:200 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/workflow/CopyWorkflowModal.vue:104 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/components/workflow/WorkflowApiTab.vue:380 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/views/AgentStudioView.vue:675 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/views/AgentStudioView.vue:928 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/views/TokenAnalyticsView.vue:743 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/views/TokenAnalyticsView.vue:753 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/views/TokenAnalyticsView.vue:915 — <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×17
  • Duplicated block (9 lines × 2) sandbox-gateway/gateway/internal/service/recovery.go:158 — sandbox-gateway/gateway/internal/service/recovery.go:158-166 | sandbox-gateway/gateway/internal/service/service.go:412-420 — 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) server/internal/gateshare/preview.go:129 — server/internal/gateshare/preview.go:129-137 | server/internal/gateshare/preview.go:174-182 — 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) server/internal/gateshare/public_events.go:313 — server/internal/gateshare/public_events.go:313-321 | server/internal/gateshare/public_events.go:336-344 — 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 `server/internal/gateshare/public_events.go:313` 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) server/internal/handlers/notifications.go:96 — server/internal/handlers/notifications.go:96-104 | server/internal/handlers/notifications.go:118-126 — 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 `server/internal/handlers/notifications.go:96` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/internal/handlers/notifications.go:117` calls `MarkAllRead` and `server/internal/handlers/notifications.go:95` 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 (9 lines × 2) server/internal/handlers/onboarding.go:63 — server/internal/handlers/onboarding.go:63-71 | server/internal/handlers/workflow.go:238-246 — 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 `server/internal/handlers/onboarding.go:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) server/internal/handlers/workspace.go:115 — server/internal/handlers/workspace.go:115-123 | server/internal/handlers/workspace.go:134-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. 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) server/internal/handlers/workspace.go:167 — server/internal/handlers/workspace.go:167-175 | server/internal/handlers/workspace.go:187-195 — 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) server/internal/services/maintenance.go:37 — server/internal/services/maintenance.go:37-45 | server/internal/services/workspace_agents_bundle.go:324-332 — 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 `server/internal/services/maintenance.go:37` 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) server/internal/runtime/acp_config.go:118 — server/internal/runtime/acp_config.go:118-126 | server/internal/services/agent_inheritance.go:7-15 — 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) server/internal/sandbox/timeline.go:235 — server/internal/sandbox/timeline.go:235-243 | REDACTED:597-605 — 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) server/internal/engine/resume.go:426 — server/internal/engine/resume.go:426-434 | server/internal/engine/resume.go:453-462 — 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 `server/internal/engine/resume.go:453` 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, `server/internal/engine/resume.go:449` calls `EnqueueClarifyTurnWithIDAs`, `Clarify` and `server/internal/engine/resume.go:423` 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 (9 lines × 2) server/internal/engine/reattach.go:86 — server/internal/engine/reattach.go:86-94 | server/internal/engine/reattach.go:103-111 — 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 `server/internal/engine/reattach.go:86` 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) server/internal/engine/annotation_artifact.go:89 — server/internal/engine/annotation_artifact.go:89-97 | server/internal/engine/gate_artifact.go:60-68 — 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 `server/internal/engine/annotation_artifact.go:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (9 lines × 2) server/internal/engine/gate_artifact.go:234 — server/internal/engine/gate_artifact.go:234-242 | server/internal/engine/run_artifact.go:244-252 — 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 `server/internal/engine/gate_artifact.go:234` 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) server/internal/handlers/run_references.go:22 — server/internal/handlers/run_references.go:22-30 | server/internal/handlers/run_references.go:43-51 — 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 `server/internal/handlers/run_references.go:22` 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 (9 lines × 2) sandbox-gateway/sandbox/internal/provider/opencodejson/opencodejson.go:52 — sandbox-gateway/sandbox/internal/provider/opencodejson/opencodejson.go:52-60 | sandbox-gateway/sandbox/internal/provider/streamjson/streamjson.go:159-167 — 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) sandbox-gateway/sandbox/internal/provider/modelconnection/opencode_variant.go:190 — sandbox-gateway/sandbox/internal/provider/modelconnection/opencode_variant.go:190-198 | sandbox-gateway/sandbox/internal/provider/modelconnection/opencode_variant.go:200-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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×16
  • Duplicated block (7 lines × 2) server/internal/handlers/sandbox_proxy_auth.go:137 — server/internal/handlers/sandbox_proxy_auth.go:137-143 | server/internal/handlers/sandbox_proxy_auth.go:190-196 — 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 `server/internal/handlers/sandbox_proxy_auth.go:137` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/internal/handlers/sandbox_proxy_auth.go:188` calls `Set` and `server/internal/handlers/sandbox_proxy_auth.go:135` 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 × 2) REDACTED:95 — REDACTED:95-101 | REDACTED:114-120 — 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:95` 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) server/internal/runtime/acp_ensure.go:52 — server/internal/runtime/acp_ensure.go:52-58 | server/internal/runtime/acp_ensure.go:104-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. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/runtime/acp_ensure.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/internal/runtime/acp_ensure.go:111` calls `Str` and `server/internal/runtime/acp_ensure.go:59` 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 (7 lines × 2) server/internal/runtime/acp_sandbox.go:381 — server/internal/runtime/acp_sandbox.go:381-387 | server/internal/runtime/acp_shared.go:281-287 — 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 `server/internal/runtime/acp_sandbox.go:381` 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: `server/internal/runtime/acp_shared.go:281` is reached only past a guard at line 256 that tests `sb.WorkspaceDir` and leaves the function early, and `server/internal/runtime/acp_sandbox.go:381` reads `sb.WorkspaceDir` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
  • Duplicated block (7 lines × 2) server/internal/services/workspace_credentials.go:274 — server/internal/services/workspace_credentials.go:274-280 | server/internal/services/workspace_credentials.go:421-427 — 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 `server/internal/services/workspace_credentials.go:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) server/internal/engine/review_session.go:831 — server/internal/engine/review_session.go:831-837 | server/internal/engine/review_session.go:983-989 — 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 `server/internal/engine/review_session.go:831` 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) sandbox-gateway/sandbox/internal/provider/modelconnection/opencode_variant.go:23 — sandbox-gateway/sandbox/internal/provider/modelconnection/opencode_variant.go:23-29 | server/internal/modelrouting/opencode_variants.go:22-28 — 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: `sandbox-gateway/sandbox/internal/provider/modelconnection/opencode_variant.go`, `server/internal/modelrouting/opencode_variants.go` sit 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 (7 lines × 2) server/internal/services/codex_device_flow.go:233 — server/internal/services/codex_device_flow.go:233-239 | server/internal/services/github_device_flow.go:321-327 — 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 (7 lines × 2) server/internal/services/codex_device_flow.go:241 — server/internal/services/codex_device_flow.go:241-247 | server/internal/services/github_device_flow.go:329-335 — 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) server/internal/services/run.go:164 — server/internal/services/run.go:164-170 | server/internal/services/workflow.go:47-53 — 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) server/internal/runtime/acp_ensure.go:284 — server/internal/runtime/acp_ensure.go:284-291 | server/internal/runtime/acp_ensure.go:310-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) server/internal/mcp/structured/doc.go:661 — server/internal/mcp/structured/doc.go:661-667 | server/internal/mcp/structured/doc.go:823-829 — 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 `server/internal/mcp/structured/doc.go:661` 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) server/internal/handlers/blobs.go:42 — server/internal/handlers/blobs.go:42-48 | server/internal/handlers/gate_share_public_images.go:91-97 — 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 `server/internal/handlers/blobs.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 (7 lines × 2) server/internal/handlers/gate_share_public_artifacts.go:115 — server/internal/handlers/gate_share_public_artifacts.go:115-121 | server/internal/handlers/gate_share_public_artifacts.go:160-166 — 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 `server/internal/handlers/gate_share_public_artifacts.go:115` 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: `server/internal/handlers/gate_share_public_artifacts.go:115` is reached only past a guard at line 109 that tests `a.Name` and leaves the function early, and `server/internal/handlers/gate_share_public_artifacts.go:160` reads `a.Name` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
  • Duplicated block (7 lines × 2) sandbox-gateway/sandbox/internal/provider/acpx/provider.go:110 — sandbox-gateway/sandbox/internal/provider/acpx/provider.go:110-116 | sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.go:188-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) sandbox-gateway/sandbox/internal/provider/modelconnection/version.go:56 — sandbox-gateway/sandbox/internal/provider/modelconnection/version.go:56-62 | sandbox-gateway/sandbox/internal/provider/modelconnection/version.go:67-73 — 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.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×13
  • Modal dialog does not manage focus web/src/components/agent/AgentCreateWizard.vue:64 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/agent/AgentIconPicker.vue:166 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/agent/AgentSwitcher.vue:92 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/canvas/WorkflowVersionDrawer.vue:64 — This <aside role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/canvas/chrome/QuickAdd.vue:85 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/canvas/chrome/ShortcutHelp.vue:20 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/canvas/edges/EdgeLabelEditor.vue:48 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/canvas/edges/FlowEdge.vue:234 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/onboarding/OnboardingWizard.vue:402 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/run/CommentPinInspectCard.vue:195 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/ui/TagFilter.vue:189 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/views/AgentStudioView.vue:706 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/views/RunDetailView.vue:413 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) server/cmd/doctor/main.go:155 — server/cmd/doctor/main.go:155-160 | server/cmd/doctor/main.go:258-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) server/internal/embed/store.go:121 — server/internal/embed/store.go:121-126 | server/internal/embed/store.go:230-235 — 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 after the matched lines, `server/internal/embed/store.go:127` calls `TrimRight`, `TrimSpace` and `server/internal/embed/store.go:236` 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) server/internal/handlers/gate.go:76 — server/internal/handlers/gate.go:76-81 | server/internal/handlers/gate.go:98-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. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/handlers/gate.go:76` 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, `server/internal/handlers/gate.go:95` calls `SaveAnnotationArtifact`, `Param`, `Error` and `server/internal/handlers/gate.go:75` 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) server/internal/handlers/gate.go:303 — server/internal/handlers/gate.go:303-308 | server/internal/handlers/gate.go:324-329 — 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 `server/internal/handlers/gate.go:303` 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) server/internal/handlers/gate_share.go:56 — server/internal/handlers/gate_share.go:56-61 | server/internal/handlers/review_share.go:20-25 — 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 `server/internal/handlers/gate_share.go:56` 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 (6 lines × 2) server/internal/runtime/acp_react.go:264 — server/internal/runtime/acp_react.go:264-269 | server/internal/runtime/acp_react.go:278-283 — 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) server/internal/services/workspace_credentials.go:304 — server/internal/services/workspace_credentials.go:304-309 | server/internal/services/workspace_credentials.go:460-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) server/internal/filestore/store.go:128 — server/internal/filestore/store.go:128-133 | server/internal/solobackup/local.go:98-103 — 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) server/internal/services/codex_device_flow.go:292 — server/internal/services/codex_device_flow.go:292-297 | server/internal/services/github_device_flow.go:390-395 — 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 `server/internal/services/codex_device_flow.go:292` 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) sandbox-gateway/gateway/internal/driver/e2b/driver.go:885 — sandbox-gateway/gateway/internal/driver/e2b/driver.go:885-890 | sandbox-gateway/gateway/internal/driver/e2b/driver.go:1048-1053 — 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) server/internal/handlers/codex_device.go:63 — server/internal/handlers/codex_device.go:63-68 | server/internal/handlers/github_device.go:74-79 — 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 `server/internal/handlers/codex_device.go:63` 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) sandbox-gateway/sandbox/internal/handler/runtime.go:19 — sandbox-gateway/sandbox/internal/handler/runtime.go:19-24 | sandbox-gateway/sandbox/internal/handler/runtime.go:31-36 — 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 `sandbox-gateway/sandbox/internal/handler/runtime.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 (6 lines × 2) server/internal/sandbox/confighome.go:289 — server/internal/sandbox/confighome.go:289-294 | server/internal/sandbox/confighome.go:311-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/sandbox/confighome.go:289` 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.
D3 · God Classes · MethodTooLong · ×12
  • MethodTooLong: SandboxService.AlignSoloModelRoute server/internal/services/sandbox_solo_route.go:83 — MethodTooLong — AlignSoloModelRoute runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× 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: WorkspaceService.GlobalTokenStats server/internal/services/global_token_stats.go:201 — MethodTooLong — GlobalTokenStats runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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: Engine.reactReply server/internal/engine/resume.go:380 — MethodTooLong — reactReply 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.
  • MethodTooLong: acpProvider.ReactReply server/internal/runtime/acp_react.go:124 — MethodTooLong — ReactReply 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.
  • MethodTooLong: Engine.ReactLiveWithAttachmentsAs server/internal/engine/live.go:132 — MethodTooLong — ReactLiveWithAttachmentsAs 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.
  • MethodTooLong: SandboxService.startContainer server/internal/services/sandbox_studio.go:164 — MethodTooLong — startContainer 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: Engine.executeClarifyTurn server/internal/engine/review_session.go:713 — MethodTooLong — executeClarifyTurn 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: Engine.executeFrom server/internal/engine/execute.go:298 — MethodTooLong — executeFrom 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: Engine.ResumeGateExternal server/internal/engine/resume_external.go:23 — MethodTooLong — ResumeGateExternal 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: acpProvider.runAgentOnce REDACTED:74 — MethodTooLong — runAgentOnce runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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: AgentService.ImportWorkspaceAgentsZIP server/internal/services/workspace_agents_bundle.go:117 — MethodTooLong — ImportWorkspaceAgentsZIP 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.
  • MethodTooLong: CredentialService.updateOnce server/internal/services/workspace_credentials.go:356 — MethodTooLong — updateOnce runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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 · Edited copy of a member (7 corresponding lines) · ×12
  • Edited copy of a member (7 corresponding lines) server/internal/handlers/model_configurations.go:63 — server/internal/handlers/model_configurations.go:63-69 | server/internal/handlers/model_connections.go:77-83 — 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) server/internal/engine/page_session.go:18 — server/internal/engine/page_session.go:18-24 | server/internal/mcp/host.go:828-834 — 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) server/internal/services/sandbox_desktop.go:10 — server/internal/services/sandbox_desktop.go:10-16 | server/internal/services/sandbox_view.go:83-89 — 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) server/internal/services/sandbox_desktop.go:20 — server/internal/services/sandbox_desktop.go:20-26 | server/internal/services/sandbox_view.go:251-257 — 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) server/internal/services/agent.go:608 — server/internal/services/agent.go:608-614 | server/internal/services/shared_agent.go:177-183 — 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) server/internal/blob/mime.go:10 — server/internal/blob/mime.go:10-16 | REDACTED:291-297 — 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) server/internal/engine/finish.go:99 — server/internal/engine/finish.go:99-105 | server/internal/engine/run_artifact.go:68-74 — 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) sandbox-gateway/gateway/internal/driver/e2b/driver.go:280 — sandbox-gateway/gateway/internal/driver/e2b/driver.go:280-286 | sandbox-gateway/sandbox/internal/correl/correl.go:17-23 — 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) server/internal/gateshare/preview.go:260 — server/internal/gateshare/preview.go:260-266 | server/internal/pagebridge/hub.go:549-556 — 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) server/internal/engine/live.go:766 — server/internal/engine/live.go:766-772 | server/internal/mcp/history.go:353-359 — 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) server/internal/runtime/acp_backend.go:158 — server/internal/runtime/acp_backend.go:158-164 | server/internal/services/agent.go:598-605 — 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) server/internal/engine/execute.go:272 — server/internal/engine/execute.go:272-278 | server/internal/engine/reattach.go:294-300 — 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 (5 lines × 2) · ×12
  • Duplicated block (5 lines × 2) server/internal/engine/review_session.go:1015 — server/internal/engine/review_session.go:1015-1019 | server/internal/engine/visitor_lane.go:423-427 — 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 `server/internal/engine/review_session.go:1015` 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) server/internal/handlers/gate.go:270 — server/internal/handlers/gate.go:270-274 | server/internal/handlers/gate.go:286-290 — 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) server/internal/handlers/gate.go:275 — server/internal/handlers/gate.go:275-279 | server/internal/handlers/gate.go:312-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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, `server/internal/handlers/gate.go:274` calls `Param` and `server/internal/handlers/gate.go:311` 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) server/internal/handlers/gate.go:291 — server/internal/handlers/gate.go:291-295 | server/internal/handlers/gate.go:333-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. 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, `server/internal/handlers/gate.go:290` calls `Param` and `server/internal/handlers/gate.go:332` 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) server/internal/mcp/conversation_history.go:77 — server/internal/mcp/conversation_history.go:77-81 | server/internal/mcp/reference.go:51-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/mcp/conversation_history.go:77` 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) sandbox-gateway/gateway/internal/service/service.go:213 — sandbox-gateway/gateway/internal/service/service.go:213-217 | sandbox-gateway/gateway/internal/service/service.go:322-327 — 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 `sandbox-gateway/gateway/internal/service/service.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.
  • Duplicated block (5 lines × 2) server/internal/runtime/acp_react.go:85 — server/internal/runtime/acp_react.go:85-89 | server/internal/runtime/acp_react.go:98-102 — 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 `server/internal/runtime/acp_react.go: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. 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) server/internal/runtime/codex_login_hub.go:316 — server/internal/runtime/codex_login_hub.go:316-320 | server/internal/runtime/codex_login_hub.go:334-338 — 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 (5 lines × 2) server/internal/services/sandbox_agent.go:97 — server/internal/services/sandbox_agent.go:97-101 | server/internal/services/sandbox_studio.go:181-185 — 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 `server/internal/services/sandbox_agent.go:97` 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) server/internal/engine/review.go:309 — server/internal/engine/review.go:309-313 | server/internal/engine/review_session.go:1032-1036 — 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 `server/internal/engine/review.go:309` 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) server/internal/runtime/acp_react.go:687 — server/internal/runtime/acp_react.go:687-691 | server/internal/runtime/acp_react.go:712-716 — 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 `server/internal/runtime/acp_react.go:687` 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) REDACTED:153 — REDACTED:153-157 | server/scripts/grasp-mcp-spa-proxy.py:153-157 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×11
  • Edited copy of a member (11 corresponding lines) server/internal/handlers/gate_share_public.go:939 — server/internal/handlers/gate_share_public.go:939-949 | server/internal/handlers/gate_share_public_preview.go:406-416 — 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) server/internal/services/model_configurations.go:27 — server/internal/services/model_configurations.go:27-37 | server/internal/services/model_connections.go:29-39 — 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) server/internal/services/preview.go:344 — server/internal/services/preview.go:344-360 | server/internal/services/preview_keepalive.go:132-142 — 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:288 — REDACTED:288-298 | REDACTED:485-495 — 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) sandbox-gateway/gateway/internal/driver/e2b/driver.go:534 — sandbox-gateway/gateway/internal/driver/e2b/driver.go:534-544 | server/internal/models/git_scope.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) server/internal/engine/outcome.go:108 — server/internal/engine/outcome.go:108-118 | server/internal/handlers/gate_share_public.go:849-859 — 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) server/internal/services/sandbox_view.go:223 — server/internal/services/sandbox_view.go:223-233 | server/internal/services/sandbox_view.go:238-248 — 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) server/internal/engine/resume.go:632 — server/internal/engine/resume.go:632-644 | server/internal/engine/resume_review_external.go:136-146 — 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) sandbox-gateway/sandbox/internal/handler/runtime.go:18 — sandbox-gateway/sandbox/internal/handler/runtime.go:18-28 | sandbox-gateway/sandbox/internal/handler/runtime.go:30-40 — 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) server/internal/sandbox/manager.go:811 — server/internal/sandbox/manager.go:811-821 | server/internal/sandbox/manager.go:832-842 — 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) sandbox-gateway/sandbox/internal/acp/panel.go:304 — sandbox-gateway/sandbox/internal/acp/panel.go:304-314 | sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.go:889-899 — 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 · Duplicated block (8 lines × 2) · ×11
  • Duplicated block (8 lines × 2) sandbox-gateway/gateway/internal/api/handlers.go:338 — sandbox-gateway/gateway/internal/api/handlers.go:338-345 | sandbox-gateway/gateway/internal/api/handlers.go:359-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) server/internal/engine/review_session.go:424 — server/internal/engine/review_session.go:424-431 | server/internal/engine/review_session.go:442-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) server/internal/handlers/agent_workspace_vcs.go:48 — server/internal/handlers/agent_workspace_vcs.go:48-55 | server/internal/handlers/agent_workspace_vcs.go:86-93 — 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 `server/internal/handlers/agent_workspace_vcs.go:48` 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, `server/internal/handlers/agent_workspace_vcs.go:46` calls `DiffRevision` and `server/internal/handlers/agent_workspace_vcs.go:85` 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 (8 lines × 2) REDACTED:260 — REDACTED:260-267 | REDACTED:328-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 `REDACTED:260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) server/internal/runtime/codex_auth.go:416 — server/internal/runtime/codex_auth.go:416-423 | server/internal/services/sandbox_codex_login.go:49-56 — 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) server/internal/engine/review_session.go:820 — server/internal/engine/review_session.go:820-827 | server/internal/engine/review_session.go:971-978 — 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 `server/internal/engine/review_session.go:820` 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) server/internal/runtime/acp_react.go:276 — server/internal/runtime/acp_react.go:276-283 | server/internal/runtime/acp_react.go:692-699 — 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 `server/internal/runtime/acp_react.go:276` 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) server/internal/runtime/acp_react.go:962 — server/internal/runtime/acp_react.go:962-969 | server/internal/runtime/acp_sandbox.go:92-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.
  • Duplicated block (8 lines × 2) server/internal/handlers/model_configurations.go:17 — server/internal/handlers/model_configurations.go:17-24 | server/internal/handlers/model_connections.go:18-25 — 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) sandbox-gateway/sandbox/internal/desktop/mcp.go:301 — sandbox-gateway/sandbox/internal/desktop/mcp.go:301-308 | sandbox-gateway/sandbox/internal/desktop/mcp.go:369-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) sandbox-gateway/sandbox/internal/provider/copilot/copilot.go:18 — sandbox-gateway/sandbox/internal/provider/copilot/copilot.go:18-25 | sandbox-gateway/sandbox/internal/provider/openclaw/openclaw.go:31-38 — 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.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: Engine server/internal/engine/engine.go:24 — TooManyMethods — 370 methods, declared across 44 files: engine/review_session.go (44), engine/live.go (22), engine/dialogue_publish.go (21), engine/resume.go (21), +40 more file(s). The bar is 30 methods; this is 340 over it, 12.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.
  • TooManyMethods: Handlers server/internal/handlers/handlers.go:25 — TooManyMethods — 354 methods, declared across 68 files: REDACTED (30), handlers/gate_share_public.go (23), REDACTED (16), handlers/gate.go (14), +64 more file(s). The bar is 30 methods; this is 324 over it, 11.80× 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: Host server/internal/mcp/host.go:85 — TooManyMethods — 141 methods, declared across 19 files: mcp/host.go (41), mcp/preview.go (22), mcp/outcome.go (20), mcp/tools_structured.go (10), +15 more file(s). The bar is 30 methods; this is 111 over it, 4.70× 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: acpProvider server/internal/runtime/acp_provider.go:117 — TooManyMethods — 140 methods, declared across 18 files: runtime/acp_sandbox.go (23), runtime/acp_react.go (21), runtime/acp_config.go (12), runtime/chat_route.go (12), +14 more file(s). The bar is 30 methods; this is 110 over it, 4.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: SandboxService server/internal/services/sandbox.go:24 — TooManyMethods — 135 methods, declared across 20 files: services/sandbox_studio.go (24), services/sandbox_view.go (21), services/sandbox_recovery.go (18), services/sandbox_run.go (16), +16 more file(s). The bar is 30 methods; this is 105 over it, 4.50× 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: SoloService server/internal/services/solo.go:117 — TooManyMethods — 110 methods, declared across 16 files: services/solo.go (28), services/solo_queue.go (17), services/solo_model_settings.go (13), services/solo_stop.go (10), +12 more file(s). 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: RunService server/internal/services/run.go:63 — TooManyMethods — 41 methods, declared across 8 files: services/run.go (17), services/inbox.go (9), services/inbox_context.go (6), services/conversation_chain.go (3), +4 more file(s). The bar is 30 methods; this is 11 over it, 1.37× 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: rodPage server/internal/browser/rod.go:609 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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.
  • TooManyMethods: Service server/internal/gateshare/service.go:71 — TooManyMethods — 33 methods, declared across 3 files: gateshare/service.go (23), gateshare/review.go (6), gateshare/app_preview.go (4). The bar is 30 methods; this is 3 over it, 1.10× 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: ProviderRegistry server/internal/runtime/registry.go:33 — TooManyMethods — 33 methods, declared across 3 files: runtime/registry.go (30), runtime/acp_transcript.go (2), runtime/acp_recovery.go (1). The bar is 30 methods; this is 3 over it, 1.10× 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.
D3 · God Classes · ClassTooLong · ×10
  • ClassTooLong: useGatesInbox web/src/lib/inbox/useGatesInbox.ts:1 — ClassTooLong — 2604 significant lines (blank, comment-only and punctuation-only lines excluded), 185 methods. The bar is 400 significant lines; this is 2204 over it, 6.51× 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: useRunDetail web/src/lib/run/useRunDetail.ts:1 — ClassTooLong — 1234 significant lines (blank, comment-only and punctuation-only lines excluded), 101 methods. The bar is 400 significant lines; this is 834 over it, 3.09× 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: useClarifyChat web/src/lib/inbox/useClarifyChat.ts:1 — ClassTooLong — 1063 significant lines (blank, comment-only and punctuation-only lines excluded), 136 methods. The bar is 400 significant lines; this is 663 over it, 2.66× 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: useSoloChat web/src/lib/solo/useSoloChat.ts:1 — ClassTooLong — 901 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 501 over it, 2.25× 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: useAgentStudio web/src/lib/agent/useAgentStudio.ts:1 — ClassTooLong — 743 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 400 significant lines; this is 343 over it, 1.86× 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: useRunLive web/src/lib/run/useRunLive.ts:1 — ClassTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 171 over it, 1.43× 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: useAgentFilesPanel web/src/lib/agent/useAgentFilesPanel.ts:1 — ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 142 over it, 1.36× 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 server/internal/gateshare/service.go:71 — ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods, 24 blocks, lines 71-840. The bar is 400 significant lines; this is 104 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: useExecutionStats web/src/lib/run/useExecutionStats.ts:1 — ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 32 over it, 1.08× 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: useRunDetailWs web/src/lib/run/useRunDetailWs.ts:1 — ClassTooLong — 422 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 22 over it, 1.06× 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 (10 corresponding lines) · ×10
  • Edited copy of a member (10 corresponding lines) REDACTED:91 — REDACTED:91-103 | REDACTED:129-138 — 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) server/internal/services/model_configurations.go:39 — server/internal/services/model_configurations.go:39-48 | server/internal/services/model_connections.go:41-50 — 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) server/internal/services/team.go:393 — server/internal/services/team.go:393-404 | server/internal/services/team.go:406-415 — 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) server/internal/services/preview.go:240 — server/internal/services/preview.go:240-249 | server/internal/services/preview.go:272-281 — 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) sandbox-gateway/gateway/internal/driver/e2b/client.go:294 — sandbox-gateway/gateway/internal/driver/e2b/client.go:294-304 | sandbox-gateway/gateway/internal/driver/e2b/snapshot.go:98-107 — 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) server/internal/services/sandbox_chat.go:60 — server/internal/services/sandbox_chat.go:60-70 | server/internal/services/solo_queue.go:25-34 — 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) server/internal/blob/memory.go:75 — server/internal/blob/memory.go:75-87 | server/internal/blob/local.go:108-117 — 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) server/internal/gateshare/sanitize.go:212 — server/internal/gateshare/sanitize.go:212-224 | server/internal/sandbox/events.go:534-543 — 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) server/internal/envauth/keys.go:99 — server/internal/envauth/keys.go:99-108 | server/internal/services/agent_git_env.go:18-29 — 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) sandbox-gateway/sandbox/internal/provider/modelconnection/version.go:55 — sandbox-gateway/sandbox/internal/provider/modelconnection/version.go:55-64 | sandbox-gateway/sandbox/internal/provider/modelconnection/version.go:66-75 — 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 (11 lines × 2) · ×10
  • Duplicated block (11 lines × 2) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:557 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:557-567 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:588-598 — 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 `sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:557` 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 (11 lines × 2) server/internal/handlers/gate_share_public.go:310 — server/internal/handlers/gate_share_public.go:310-320 | server/internal/handlers/live.go:100-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 `server/internal/handlers/gate_share_public.go:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) server/internal/handlers/inbox_context.go:65 — server/internal/handlers/inbox_context.go:65-75 | server/internal/handlers/inbox_context.go:141-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) server/internal/handlers/v1_handlers.go:168 — server/internal/handlers/v1_handlers.go:168-178 | server/internal/handlers/v1_handlers.go:202-212 — 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 (11 lines × 2) server/internal/mcp/host.go:340 — server/internal/mcp/host.go:340-350 | server/internal/mcp/host.go:366-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) server/internal/services/sandbox_recovery.go:410 — server/internal/services/sandbox_recovery.go:410-420 | server/internal/services/solo_stop.go:208-218 — 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 (11 lines × 2) server/internal/services/team.go:224 — server/internal/services/team.go:224-234 | server/internal/services/team.go:257-267 — 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 `server/internal/services/team.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 (11 lines × 2) server/internal/codexoauth/authfile.go:57 — server/internal/codexoauth/authfile.go:57-67 | server/internal/runtime/codex_auth.go:145-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) server/internal/mcp/plan.go:270 — server/internal/mcp/plan.go:270-280 | server/internal/mcp/plan.go:395-405 — 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 (11 lines × 2) REDACTED:207 — REDACTED:207-217 | server/scripts/grasp-mcp-spa-proxy.py:207-217 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) server/internal/engine/resume_external.go:24 — server/internal/engine/resume_external.go:24-33 | server/internal/engine/resume_review_external.go:16-25 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/internal/engine/resume_review_external.go:26` calls `normalizeLookupKind` and `server/internal/engine/resume_external.go:34` 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 (10 lines × 2) server/internal/engine/resume_external.go:41 — server/internal/engine/resume_external.go:41-50 | server/internal/engine/resume_external.go:77-86 — 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 `server/internal/engine/resume_external.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 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) server/internal/engine/review_session.go:517 — server/internal/engine/review_session.go:517-526 | server/internal/engine/visitor_lane.go:86-95 — 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 `server/internal/engine/review_session.go:517` 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) REDACTED:504 — REDACTED:504-513 | REDACTED:529-538 — 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:504` 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 (10 lines × 2) server/internal/runtime/acp_config.go:195 — server/internal/runtime/acp_config.go:195-204 | server/internal/services/shared_agent.go:244-253 — 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 (10 lines × 2) server/internal/services/workspace_credentials.go:357 — server/internal/services/workspace_credentials.go:357-366 | server/internal/services/workspace_credentials.go:587-596 — 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) sandbox-gateway/gateway/internal/logging/logging.go:85 — sandbox-gateway/gateway/internal/logging/logging.go:85-94 | sandbox-gateway/sandbox/internal/logging/logging.go:65-74 — before extracting anything, compare `sandbox-gateway/gateway/internal/logging/logging.go` and `sandbox-gateway/sandbox/internal/logging/logging.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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. Check import visibility before settling on that home: `sandbox-gateway/gateway/internal/logging/logging.go`, `sandbox-gateway/sandbox/internal/logging/logging.go` sit 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 lines × 2) server/internal/handlers/dto.go:156 — server/internal/handlers/dto.go:156-165 | server/internal/services/inbox_context.go:232-241 — 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) server/internal/services/model_configurations.go:97 — server/internal/services/model_configurations.go:97-106 | server/internal/services/model_connections.go:83-92 — 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 `string` to `s *ModelConfigurationService) Update(id` in one and `s *ModelConnectionService) Update(id` 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 (10 lines × 2) REDACTED:140 — REDACTED:140-149 | server/scripts/grasp-mcp-spa-proxy.py:140-149 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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.
X2 · Cancellation propagation · Async function without AbortSignal · ×10
  • Async function without AbortSignal: loadImageDownload web/src/lib/run/useArtifactPreview.ts:272 — `loadImageDownload` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: redeemEmbedTicket web/src/lib/inbox/embedChat.ts:169 — `redeemEmbedTicket` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: pollShutdownHealth web/src/lib/composables/useShutdownState.ts:54 — `pollShutdownHealth` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: exportAgent web/src/lib/api/clients/agentsClient.ts:99 — `exportAgent` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: exportWorkspaceAgents web/src/lib/api/clients/agentsClient.ts:115 — `exportWorkspaceAgents` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: importWorkspaceAgents web/src/lib/api/clients/agentsClient.ts:136 — `importWorkspaceAgents` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: importAgent web/src/lib/api/clients/agentsClient.ts:165 — `importAgent` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: packRunArtifacts web/src/lib/api/clients/artifactsClient.ts:86 — `packRunArtifacts` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: deleteArtifact web/src/lib/api/clients/artifactsClient.ts:113 — `deleteArtifact` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getRunNodeSandbox web/src/lib/api/clients/runsClient.ts:431 — `getRunNodeSandbox` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×9
  • Focus outline removed in CSS without a :focus replacement web/src/views/WorkflowsView.vue:320 — `.workflow-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/styles/chat.css:161 — `.chat-composer .chat-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/styles/global.css:308 — `.input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement REDACTED:94 — `.git-host-field__input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/components/workspace/WorkspaceAuditPanel.vue:1151 — `.search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/components/run/ArtifactList.vue:385 — `.artifact-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/components/onboarding/OnboardingTeamCard.vue:298 — `.team-field input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement web/src/components/chat/ConversationWorkspace.vue:380 — `.is-resizing .conversation-sash` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement sandbox-gateway/sandbox/web/static/css/app.css:1044 — `.cc-turn-usage:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×9
  • Duplicated block (12 lines × 2) sandbox-gateway/gateway/internal/service/recovery.go:192 — sandbox-gateway/gateway/internal/service/recovery.go:192-203 | sandbox-gateway/gateway/internal/service/service.go:416-427 — 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 `sandbox-gateway/gateway/internal/service/recovery.go:192` 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 (12 lines × 2) sandbox-gateway/gateway/internal/service/recovery.go:214 — sandbox-gateway/gateway/internal/service/recovery.go:214-225 | sandbox-gateway/gateway/internal/service/service.go:422-433 — 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 (12 lines × 2) server/internal/handlers/gate_share_public.go:752 — server/internal/handlers/gate_share_public.go:752-763 | server/internal/handlers/gate_share_public.go:781-792 — 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) server/internal/runtime/acp_timeline.go:86 — server/internal/runtime/acp_timeline.go:86-97 | server/internal/runtime/acp_timeline.go:103-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 2) server/internal/services/workflow.go:135 — server/internal/services/workflow.go:135-146 | server/internal/services/workflow_import.go:96-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 `server/internal/services/workflow.go:135` 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) server/internal/services/workspace_token_stats.go:335 — server/internal/services/workspace_token_stats.go:335-346 | server/internal/services/workspace_token_stats.go:354-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) server/internal/engine/resume.go:51 — server/internal/engine/resume.go:51-62 | server/internal/modelrouting/auxiliary.go:56-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:781 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:781-792 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:802-813 — 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 `sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:781` 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 (12 lines × 2) REDACTED:161 — REDACTED:161-172 | server/scripts/grasp-mcp-spa-proxy.py:161-172 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×8
  • Fixed-sleep synchronisation: offers references from the + menu and turns pasted links into #n for the picked repo web/src/views/DashboardView.references.test.ts:149 — This test starts work it did not wait for (`w`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 300))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: opens references from the + menu and drops them when the workflow changes web/src/views/DashboardView.references.test.ts:251 — This test starts work it did not wait for (`w`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 300))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: selects a credential kind before showing the alias and secret fields web/src/components/workspace/WorkspaceCredentialsPanel.test.ts:634 — This test starts work it did not wait for (`wrapper`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 220))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: creates a model-service key without selecting a tool or model web/src/components/workspace/WorkspaceCredentialsPanel.test.ts:674 — This test starts work it did not wait for (`wrapper`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 220))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: rejects a duplicate alias and keeps the step while the animation is locked web/src/components/workspace/WorkspaceCredentialsPanel.test.ts:1002 — This test starts work it did not wait for (`wrapper`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 220))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: clears the secret when going back and choosing another credential kind web/src/components/workspace/WorkspaceCredentialsPanel.test.ts:1281 — This test starts work it did not wait for (`wrapper`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 220))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: keeps tall credential forms reachable without fixing the create step height web/src/components/workspace/WorkspaceCredentialsPanel.test.ts:1315 — This test starts work it did not wait for (`wrapper`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 220))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: opens the picker from the + menu, and chips can be removed web/src/components/solo/SoloSessionPane.references.test.ts:193 — This test starts work it did not wait for (`w`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 300))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×8
  • Edited copy of a member (9 corresponding lines) server/internal/services/artifact.go:158 — server/internal/services/artifact.go:158-166 | server/internal/services/artifact.go:169-177 — 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) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:752 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:752-761 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:763-771 — 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) server/internal/handlers/issue.go:53 — server/internal/handlers/issue.go:53-61 | server/internal/handlers/preview.go:26-35 — 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) sandbox-gateway/gateway/internal/driver/e2b/client.go:306 — sandbox-gateway/gateway/internal/driver/e2b/client.go:306-317 | sandbox-gateway/gateway/internal/driver/e2b/client.go:320-328 — 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) server/internal/services/preview_keepalive.go:107 — server/internal/services/preview_keepalive.go:107-115 | server/internal/services/preview_keepalive.go:117-128 — 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) server/internal/engine/resume.go:750 — server/internal/engine/resume.go:750-760 | server/internal/services/run.go:192-200 — 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) server/internal/services/agent.go:354 — server/internal/services/agent.go:354-362 | server/internal/services/shared_agent.go:274-282 — 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) sandbox-gateway/sandbox/internal/provider/deepseek/deepseek.go:69 — sandbox-gateway/sandbox/internal/provider/deepseek/deepseek.go:69-77 | sandbox-gateway/sandbox/internal/provider/kimicode/provider.go:31-47 — 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 · Duplicated block (13 lines × 2) · ×8
  • Duplicated block (13 lines × 2) server/internal/chatsession/session.go:214 — server/internal/chatsession/session.go:214-226 | server/internal/chatsession/session.go:238-250 — 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: `server/internal/chatsession/session.go:214` is reached only past a guard at line 208 that tests `s.queue` and leaves the function early, and `server/internal/chatsession/session.go:238` reads `s.queue` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
  • Duplicated block (13 lines × 2) server/internal/engine/route.go:19 — server/internal/engine/route.go:19-31 | server/internal/engine/route.go:41-53 — 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 `server/internal/engine/route.go:19` 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) server/internal/handlers/gate.go:203 — server/internal/handlers/gate.go:203-215 | server/internal/handlers/ws.go:165-177 — 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 `server/internal/handlers/gate.go:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) server/internal/handlers/gate_share_public.go:426 — server/internal/handlers/gate_share_public.go:426-438 | server/internal/handlers/gate_share_public.go:482-494 — 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 `server/internal/handlers/gate_share_public.go:426` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) server/internal/handlers/gate_share_public.go:620 — server/internal/handlers/gate_share_public.go:620-632 | server/internal/handlers/gate_share_public.go:705-717 — 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 `server/internal/handlers/gate_share_public.go:620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) server/internal/runtime/acp_react.go:196 — server/internal/runtime/acp_react.go:196-208 | server/internal/runtime/acp_react.go:366-378 — 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 `server/internal/runtime/acp_react.go:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) server/internal/services/codex_device_flow.go:253 — server/internal/services/codex_device_flow.go:253-265 | server/internal/services/github_device_flow.go:341-353 — 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 (13 lines × 2) sandbox-gateway/sandbox/internal/acp/panel.go:385 — sandbox-gateway/sandbox/internal/acp/panel.go:385-397 | sandbox-gateway/sandbox/internal/acp/panel.go:423-435 — 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.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×7
  • Animation without a prefers-reduced-motion guard web/src/components/run/AcpStatusPill.vue:25 — <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard REDACTED:1181 — <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard REDACTED:1227 — <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/components/run/product/TestResultView.vue:295 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/components/solo/SoloSessionList.vue:68 — <icon> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/components/ui/WorkflowFilter.vue:134 — <appspinner> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/views/TokenAnalyticsView.vue:692 — <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×7
  • Edited copy of a member (16 corresponding lines) sandbox-gateway/gateway/internal/logging/logging.go:20 — sandbox-gateway/gateway/internal/logging/logging.go:20-35 | sandbox-gateway/sandbox/internal/logging/logging.go:21-36 — 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) server/internal/handlers/codex_device.go:32 — server/internal/handlers/codex_device.go:32-47 | server/internal/handlers/github_device.go:41-57 — 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) server/internal/handlers/notifications.go:108 — server/internal/handlers/notifications.go:108-126 | server/internal/handlers/team.go:42-57 — 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) server/internal/engine/annotation_artifact.go:250 — server/internal/engine/annotation_artifact.go:250-265 | server/internal/engine/annotation_artifact.go:269-284 — 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) server/internal/mcp/structured/doc.go:951 — server/internal/mcp/structured/doc.go:951-966 | server/internal/mcp/structured/doc.go:971-986 — 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) server/internal/mcp/host.go:337 — server/internal/mcp/host.go:337-352 | server/internal/mcp/host.go:362-378 — 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) server/internal/runtime/acp_sandbox.go:291 — server/internal/runtime/acp_sandbox.go:291-311 | server/internal/runtime/acp_shared.go:355-370 — 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 (12 corresponding lines) · ×7
  • Edited copy of a member (12 corresponding lines) server/internal/handlers/gate_share.go:63 — server/internal/handlers/gate_share.go:63-74 | server/internal/handlers/review_share.go:27-38 — 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) server/internal/mcp/structured/doc.go:205 — server/internal/mcp/structured/doc.go:205-216 | server/internal/mcp/structured/doc.go:218-229 — 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) REDACTED:384 — REDACTED:384-395 | REDACTED:398-409 — 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) server/internal/runtime/acp_shared.go:94 — server/internal/runtime/acp_shared.go:94-105 | server/internal/runtime/acp_shared.go:109-121 — 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) server/internal/engine/execute.go:254 — server/internal/engine/execute.go:254-265 | server/internal/engine/resume.go:823-834 — 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) server/internal/engine/resume_review_external.go:148 — server/internal/engine/resume_review_external.go:148-159 | server/internal/handlers/gate_share_public.go:657-668 — 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) sandbox-gateway/sandbox/internal/provider/deepseek/usage.go:126 — sandbox-gateway/sandbox/internal/provider/deepseek/usage.go:126-140 | sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.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.
R4 · Test Coverage · No test reaches this file · ×7
  • No test reaches this file web/scripts/measure-lcp.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/scripts/mermaid-validate-entry.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file sandbox-gateway/scripts/agent-ws-check.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/scripts/audit-check.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/scripts/assert-no-novnc-secure-context.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/liveoverlay/entry.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/scripts/dompurify-stub.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×6
  • Edited copy of a member (18 corresponding lines) server/internal/handlers/audit.go:83 — server/internal/handlers/audit.go:83-119 | server/internal/handlers/audit.go:150-173 — 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) server/internal/handlers/workspace.go:114 — server/internal/handlers/workspace.go:114-131 | server/internal/handlers/workspace.go:133-150 — 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) server/cmd/doctor/main.go:147 — server/cmd/doctor/main.go:147-165 | server/cmd/doctor/main.go:251-268 — 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) server/internal/services/sandbox_recovery.go:408 — server/internal/services/sandbox_recovery.go:408-425 | server/internal/services/solo_stop.go:204-224 — 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) server/internal/services/project.go:188 — server/internal/services/project.go:188-205 | server/internal/services/project.go:208-228 — 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) server/internal/handlers/agent.go:45 — server/internal/handlers/agent.go:45-62 | server/internal/services/agent_inheritance.go:17-34 — 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 (19 corresponding lines) · ×6
  • Edited copy of a member (19 corresponding lines) server/internal/handlers/gate.go:61 — server/internal/handlers/gate.go:61-85 | server/internal/handlers/gate.go:89-107 — 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) server/internal/gateshare/public_events.go:307 — server/internal/gateshare/public_events.go:307-328 | server/internal/gateshare/public_events.go:330-348 — 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) server/internal/mcp/artifact_kind.go:40 — server/internal/mcp/artifact_kind.go:40-62 | server/internal/models/nodereg/gate_upstream.go:133-151 — 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) server/internal/filestore/store.go:232 — server/internal/filestore/store.go:232-250 | server/internal/services/sandbox_recovery.go:191-209 — 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) server/internal/services/codex_device_flow.go:251 — server/internal/services/codex_device_flow.go:251-269 | server/internal/services/github_device_flow.go:339-357 — 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) server/internal/browser/rod.go:557 — server/internal/browser/rod.go:557-575 | server/internal/browser/rod.go:655-673 — 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 · Edited copy of a member (14 corresponding lines) · ×6
  • Edited copy of a member (14 corresponding lines) server/internal/handlers/codex_device.go:85 — server/internal/handlers/codex_device.go:85-98 | server/internal/handlers/github_device.go:97-111 — 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) server/internal/handlers/agent_workspace_vcs.go:23 — server/internal/handlers/agent_workspace_vcs.go:23-36 | server/internal/handlers/agent_workspace_vcs.go:39-57 — 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) server/internal/handlers/dto.go:137 — server/internal/handlers/dto.go:137-152 | server/internal/handlers/gate_share_public_artifacts.go:159-172 — 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) server/internal/mcp/plan.go:269 — server/internal/mcp/plan.go:269-282 | server/internal/mcp/plan.go:394-407 — 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) server/internal/browser/registry.go:91 — server/internal/browser/registry.go:91-104 | server/internal/browser/registry.go:108-121 — 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) server/internal/handlers/sandbox_proxy_auth.go:152 — server/internal/handlers/sandbox_proxy_auth.go:152-165 | server/internal/handlers/sandbox_proxy_auth.go:204-217 — 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 · Edited copy of a member (15 corresponding lines) · ×6
  • Edited copy of a member (15 corresponding lines) sandbox-gateway/gateway/internal/api/handlers.go:250 — sandbox-gateway/gateway/internal/api/handlers.go:250-264 | sandbox-gateway/gateway/internal/api/handlers.go:267-281 — 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) server/internal/handlers/artifact.go:130 — server/internal/handlers/artifact.go:130-144 | server/internal/handlers/run.go:286-300 — 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) server/internal/engine/guard.go:166 — server/internal/engine/guard.go:166-180 | server/internal/engine/guard.go:182-196 — 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) server/internal/engine/guard.go:410 — server/internal/engine/guard.go:410-428 | server/internal/gateshare/public_events.go:239-253 — 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) server/internal/services/onboarding.go:457 — server/internal/services/onboarding.go:457-471 | server/internal/services/workflow.go:581-598 — 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) sandbox-gateway/sandbox/internal/acp/conn.go:388 — sandbox-gateway/sandbox/internal/acp/conn.go:388-402 | sandbox-gateway/sandbox/internal/acp/conn.go:404-422 — 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 (8 corresponding lines) · ×6
  • Edited copy of a member (8 corresponding lines) REDACTED:116 — REDACTED:116-123 | server/internal/engine/dialogue_state.go:421-428 — 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) server/internal/runtime/acp_react.go:457 — server/internal/runtime/acp_react.go:457-464 | server/internal/runtime/acp_visitor.go:154-161 — 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) server/internal/handlers/artifact.go:40 — server/internal/handlers/artifact.go:40-47 | REDACTED:184-191 — 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) server/internal/runtime/shared_env.go:9 — server/internal/runtime/shared_env.go:9-17 | server/internal/services/agent_model_binding.go:55-62 — 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) sandbox-gateway/sandbox/internal/handler/capabilities.go:80 — sandbox-gateway/sandbox/internal/handler/capabilities.go:80-87 | server/internal/config/config.go:897-904 — 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) REDACTED:87 — REDACTED:87-94 | server/internal/mcp/history.go:371-378 — 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.
D3 · God Classes · TooManyFields · ×5
  • TooManyFields: Handlers server/internal/handlers/handlers.go:25 — TooManyFields — 47 stored fields beside 354 methods. The bar is 30 stored fields; this is 17 over it, 1.57× 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: Engine server/internal/engine/engine.go:24 — TooManyFields — 43 stored fields beside 370 methods. The bar is 30 stored fields; this is 13 over it, 1.43× 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: SoloSession server/internal/models/solo.go:70 — TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× 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: Host server/internal/mcp/host.go:85 — TooManyFields — 36 stored fields beside 141 methods. The bar is 30 stored fields; this is 6 over it, 1.20× 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: SandboxService server/internal/services/sandbox.go:24 — TooManyFields — 32 stored fields beside 135 methods. The bar is 30 stored fields; this is 2 over it, 1.07× 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.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) server/internal/gateshare/review.go:78 — server/internal/gateshare/review.go:78-105 | server/internal/gateshare/service.go:203-227 — 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) server/internal/runtime/acp_sandbox.go:119 — server/internal/runtime/acp_sandbox.go:119-143 | server/internal/runtime/acp_sandbox.go:149-174 — 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) server/internal/handlers/health.go:95 — server/internal/handlers/health.go:95-123 | server/internal/handlers/stats.go:121-145 — 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) server/internal/runtime/acp_config.go:339 — server/internal/runtime/acp_config.go:339-365 | server/internal/services/sandbox_studio.go:925-949 — 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) server/internal/services/shared_agent.go:214 — server/internal/services/shared_agent.go:214-238 | server/internal/services/shared_agent.go:240-265 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) server/internal/handlers/gate_share_public_artifacts.go:135 — server/internal/handlers/gate_share_public_artifacts.go:135-155 | server/internal/handlers/live.go:58-81 — 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) server/internal/handlers/run.go:309 — server/internal/handlers/run.go:309-330 | server/internal/handlers/run.go:339-359 — 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) server/internal/sandbox/confighome.go:282 — server/internal/sandbox/confighome.go:282-302 | server/internal/sandbox/confighome.go:304-326 — 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) sandbox-gateway/sandbox/internal/handler/chats.go:63 — sandbox-gateway/sandbox/internal/handler/chats.go:63-83 | sandbox-gateway/sandbox/internal/handler/desktop.go:28-53 — 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 · Edited copy of a member (20 corresponding lines) · ×4
  • Edited copy of a member (20 corresponding lines) REDACTED:398 — REDACTED:398-417 | REDACTED:424-443 — 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) server/internal/handlers/opencode_catalog.go:23 — server/internal/handlers/opencode_catalog.go:23-42 | server/internal/handlers/opencode_catalog.go:47-67 — 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) server/internal/runtime/codex_auth.go:413 — server/internal/runtime/codex_auth.go:413-433 | server/internal/services/sandbox_codex_login.go:46-65 — 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) server/internal/handlers/run.go:52 — server/internal/handlers/run.go:52-76 | server/internal/handlers/run_references.go:130-149 — 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 (13 corresponding lines) · ×4
  • Edited copy of a member (13 corresponding lines) server/internal/services/model_configurations.go:50 — server/internal/services/model_configurations.go:50-62 | server/internal/services/model_connections.go:52-64 — 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) server/internal/engine/node_req.go:326 — server/internal/engine/node_req.go:326-338 | server/internal/engine/node_req.go:340-352 — 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) server/internal/handlers/model_configurations.go:35 — server/internal/handlers/model_configurations.go:35-47 | server/internal/handlers/model_configurations.go:49-61 — 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) server/internal/handlers/model_connections.go:49 — server/internal/handlers/model_connections.go:49-61 | server/internal/handlers/model_connections.go:63-75 — 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 · Edited copies of one member (3 members, 10+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 10+ corresponding lines) server/internal/handlers/model_connections.go:89 — server/internal/handlers/model_connections.go:89-98 | server/internal/handlers/stats.go:53-68 | server/internal/handlers/workspace.go:237-250 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) server/internal/gateshare/service.go:454 — server/internal/gateshare/service.go:454-463 | server/internal/gateshare/service.go:466-475 | server/internal/gateshare/service.go:478-487 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) server/internal/services/project.go:170 — server/internal/services/project.go:170-179 | server/internal/services/solo.go:232-241 | server/internal/services/workspace_credentials.go:586-598 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:1111 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:1111-1120 | server/internal/runtime/acp_config.go:309-318 | server/internal/sandbox/confighome.go:353-362 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) sandbox-gateway/sandbox/internal/provider/modelconnection/platform.go:156 — sandbox-gateway/sandbox/internal/provider/modelconnection/platform.go:156-170 | server/internal/modelrouting/capabilities.go:199-213 — 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 `sandbox-gateway/sandbox/internal/provider/modelconnection/platform.go:156` 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: `sandbox-gateway/sandbox/internal/provider/modelconnection/platform.go`, `server/internal/modelrouting/capabilities.go` sit 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 (15 lines × 2) server/internal/gateshare/review.go:19 — server/internal/gateshare/review.go:19-33 | server/internal/gateshare/service.go:235-249 — before extracting anything, compare `server/internal/gateshare/review.go` and `server/internal/gateshare/service.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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.
  • Duplicated block (15 lines × 2) server/internal/gateshare/review.go:255 — server/internal/gateshare/review.go:255-269 | server/internal/gateshare/service.go:417-431 — before extracting anything, compare `server/internal/gateshare/review.go` and `server/internal/gateshare/service.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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.
  • Duplicated block (15 lines × 2) server/internal/services/workspace_vars.go:57 — server/internal/services/workspace_vars.go:57-71 | server/internal/services/workspace_vars.go:85-99 — 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 `server/internal/services/workspace_vars.go:57` 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, `server/internal/services/workspace_vars.go:100` calls `isSecretVarPlaceholder` and `server/internal/services/workspace_vars.go:72` 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×4
  • Sync-over-async blocking sandbox-gateway/scripts/mock-agent-model.mjs:451 — `fs.writeFileSync` in `callback to http.createServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking sandbox-gateway/scripts/mock-agent-model.mjs:479 — `fs.readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking sandbox-gateway/scripts/mock-chat-model.mjs:242 — `fs.writeSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking sandbox-gateway/scripts/mock-chat-model.mjs:243 — `fs.writeSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×4
  • Recursive walk over a caller-supplied document has no depth cap web/src/lib/run/acpUnpack.ts:36 — `contentText` is exported and takes `v: unknown` from its caller, and it calls itself at line 36 (`contentText`) with a piece of `v` (and at line 40) — and nowhere in `contentText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `contentText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/src/lib/run/artifactForms.ts:391 — `emptyFieldValue` is exported, takes a document from its caller (line 364) and hands it to `fillObject`, which calls itself at line 391 (`fillObject`) with a piece of `obj` (and at line 393) — and nowhere in `fillObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `fillObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/src/lib/run/artifactForms.ts:435 — `fromForm` is exported, takes a document from its caller (line 457) and hands it to `pruneObject`, which calls itself at line 435 (`pruneObject`) with a piece of `obj` (and at line 441) — and nowhere in `pruneObject` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `pruneObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/src/data/settingsNav.ts:34 — `isIntegrationsQuery` is exported and takes `raw: unknown` from its caller, and it calls itself at line 34 (`isIntegrationsQuery`) with a piece of `raw` — and nowhere in `isIntegrationsQuery` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `isIntegrationsQuery` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D10 · Test Quality · No assertions · ×3
  • No assertions: restores idle sessions and flushes without busy seed web/src/lib/run/useRunDetailWs.test.ts:155 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ignores the old run socket while the newly selected run HTTP load is pending web/src/lib/run/useRunLive.test.ts:140 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: executes mobile menu backdrop and each action web/src/components/agent/AgentFilesPanel.interactions.test.ts:267 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:551 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:551-579 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:581-613 — 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) server/internal/handlers/onboarding.go:46 — server/internal/handlers/onboarding.go:46-82 | server/internal/handlers/workflow.go:227-255 — 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) server/internal/services/workflow.go:124 — server/internal/services/workflow.go:124-155 | server/internal/services/workflow_import.go:87-115 — 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) · ×3
  • Edited copy of a member (23 corresponding lines) server/internal/handlers/codex_device.go:51 — server/internal/handlers/codex_device.go:51-73 | server/internal/handlers/github_device.go:61-84 — 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) REDACTED:456 — REDACTED:456-482 | REDACTED:516-538 — 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) server/internal/mcp/structured/doc.go:865 — server/internal/mcp/structured/doc.go:865-887 | server/internal/mcp/structured/doc.go:908-931 — 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 (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) server/internal/services/solo_stop.go:35 — server/internal/services/solo_stop.go:35-66 | server/internal/services/solo_stop.go:100-126 — 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) server/internal/handlers/onboarding.go:17 — server/internal/handlers/onboarding.go:17-43 | server/internal/handlers/team.go:13-39 — 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) server/internal/handlers/pagination.go:113 — server/internal/handlers/pagination.go:113-139 | server/internal/runtime/acp_timeline.go:276-305 — 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 (17 corresponding lines) · ×3
  • Edited copy of a member (17 corresponding lines) server/internal/engine/finish_node.go:101 — server/internal/engine/finish_node.go:101-117 | server/internal/engine/handoff.go:77-96 — 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) sandbox-gateway/sandbox/internal/provider/modelconnection/platform.go:151 — sandbox-gateway/sandbox/internal/provider/modelconnection/platform.go:151-170 | server/internal/modelrouting/capabilities.go:197-213 — 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) sandbox-gateway/sandbox/internal/service/bridge_eventlog.go:43 — sandbox-gateway/sandbox/internal/service/bridge_eventlog.go:43-59 | sandbox-gateway/sandbox/internal/service/bridge_eventlog.go:63-83 — 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 copy of a member (6 corresponding lines) · ×3
  • Edited copy of a member (6 corresponding lines) server/internal/services/agent_model_binding.go:48 — server/internal/services/agent_model_binding.go:48-53 | server/internal/services/sandbox.go:182-187 — 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) server/internal/models/token_usage_by_model.go:39 — server/internal/models/token_usage_by_model.go:39-46 | server/internal/services/token_ledger_read.go:50-55 — 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) sandbox-gateway/sandbox/internal/provider/acpx/provider.go:81 — sandbox-gateway/sandbox/internal/provider/acpx/provider.go:81-89 | sandbox-gateway/sandbox/internal/provider/oneshot/oneshot.go:177-182 — 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.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) server/internal/gateshare/review.go:182 — server/internal/gateshare/review.go:182-201 | server/internal/gateshare/service.go:344-363 — before extracting anything, compare `server/internal/gateshare/review.go` and `server/internal/gateshare/service.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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 `server/internal/gateshare/review.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 (20 lines × 2) server/internal/sandbox/confighome.go:453 — server/internal/sandbox/confighome.go:453-472 | server/internal/services/workspace_agents_bundle.go:326-345 — 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 `server/internal/sandbox/confighome.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/internal/sandbox/confighome.go:450` calls `IsNotExist` and `server/internal/services/workspace_agents_bundle.go:325` 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 (20 lines × 2) server/internal/services/inbox.go:275 — server/internal/services/inbox.go:275-294 | server/internal/services/inbox.go:348-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) server/internal/runtime/acp_react.go:158 — server/internal/runtime/acp_react.go:158-173 | server/internal/runtime/acp_react.go:346-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/runtime/acp_react.go:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (16 lines × 2) server/internal/handlers/audit.go:86 — server/internal/handlers/audit.go:86-101 | server/internal/handlers/audit.go:152-167 — 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) server/internal/sandbox/acp_reattach.go:129 — server/internal/sandbox/acp_reattach.go:129-144 | server/internal/sandbox/acp_turn.go:330-345 — 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 `server/internal/sandbox/acp_reattach.go:129` 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 (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) server/internal/gateshare/review.go:125 — server/internal/gateshare/review.go:125-138 | server/internal/gateshare/service.go:287-300 — before extracting anything, compare `server/internal/gateshare/review.go` and `server/internal/gateshare/service.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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 `server/internal/gateshare/review.go:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) server/internal/handlers/gate_share_public.go:605 — server/internal/handlers/gate_share_public.go:605-618 | server/internal/handlers/gate_share_public.go:690-703 — 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 `server/internal/handlers/gate_share_public.go:605` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) sandbox-gateway/gateway/internal/logging/logging.go:37 — sandbox-gateway/gateway/internal/logging/logging.go:37-50 | sandbox-gateway/sandbox/internal/logging/logging.go:76-89 — before extracting anything, compare `sandbox-gateway/gateway/internal/logging/logging.go` and `sandbox-gateway/sandbox/internal/logging/logging.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `svc` in one and `msg` 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. Check import visibility before settling on that home: `sandbox-gateway/gateway/internal/logging/logging.go`, `sandbox-gateway/sandbox/internal/logging/logging.go` sit 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×3
  • Duplicated block (8 lines × 3) server/internal/engine/live.go:112 — server/internal/engine/live.go:112-119 | server/internal/engine/resume.go:413-420 | server/internal/engine/resume.go:437-444 — 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 (8 lines × 3) REDACTED:473 — REDACTED:473-480 | REDACTED:504-511 | REDACTED:529-536 — 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:473` 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 × 3) sandbox-gateway/gateway/internal/logging/logging.go:61 — sandbox-gateway/gateway/internal/logging/logging.go:61-68 | sandbox-gateway/sandbox/internal/logging/logging.go:100-107 | server/internal/runtime/acp_config.go:61-68 — before extracting anything, compare `sandbox-gateway/gateway/internal/logging/logging.go` and `sandbox-gateway/sandbox/internal/logging/logging.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `svc` in one and `msg` 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. Check import visibility before settling on that home: `sandbox-gateway/gateway/internal/logging/logging.go`, `sandbox-gateway/sandbox/internal/logging/logging.go`, `server/internal/runtime/acp_config.go` sit 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: Handlers (LCOM4 10) server/internal/handlers/handlers.go:25 — Handlers's methods fall into 10 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 10 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.
  • Low cohesion: session (LCOM4 5) sandbox-gateway/sandbox/internal/provider/deepseek/deepseek.go:281 — session's methods fall into 5 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 5 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.
  • Low cohesion: Config (LCOM4 4) server/internal/config/config.go:30 — Config'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.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×3
  • Duplicated block (20 lines × 2 locations) web/src/components/run/NodeOutputPanel.vue:111 — web/src/components/run/NodeOutputPanel.vue:111 · web/src/components/run/NodeOutputPanel.vue:158 — 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 (20 lines × 2 locations) web/src/lib/api/clients/agentsClient.ts:141 — web/src/lib/api/clients/agentsClient.ts:141 · web/src/lib/api/clients/agentsClient.ts:171 — 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 (20 lines × 2 locations) REDACTED:186 — REDACTED:186 · REDACTED:308 — 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 (18 lines × 2 locations) · ×3
  • Duplicated block (18 lines × 2 locations) web/src/components/dashboard/HomePrioritySelect.vue:92 — web/src/components/dashboard/HomePrioritySelect.vue:92 · web/src/components/dashboard/HomeWorkflowSelect.vue:116 — 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 (18 lines × 2 locations) web/src/components/run/editor/ObjectListField.vue:40 — web/src/components/run/editor/ObjectListField.vue:40 · web/src/components/run/editor/StringListField.vue:30 — 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 (18 lines × 2 locations) web/src/lib/agent/agentCreateWizard.ts:171 — web/src/lib/agent/agentCreateWizard.ts:171 · web/src/lib/agent/agentTeamWizard.ts:38 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×3
  • Duplicated block (17 lines × 2 locations) web/src/components/agent/AgentTemplateSelect.vue:140 — web/src/components/agent/AgentTemplateSelect.vue:140 · web/src/components/dashboard/HomePrioritySelect.vue:101 — 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 (17 lines × 2 locations) web/src/lib/inbox/sidebarPins.ts:13 — web/src/lib/inbox/sidebarPins.ts:13 · web/src/lib/run/useWorkflowFavorites.ts:36 — 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 (17 lines × 2 locations) web/src/lib/run/useWorkflowAskInputs.ts:8 — web/src/lib/run/useWorkflowAskInputs.ts:8 · web/src/lib/workspace/useWorkflows.ts:98 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R11 · Import Boundaries · Boundary violation [package · ×3
  • Boundary violation [package:third-party-deep-import] web/src/components/canvas/composables/useAutoLayout.ts:1 — web/src/components/canvas/composables/useAutoLayout.ts:1 imports elkjs/lib/elk.bundled.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:22 — REDACTED:22 imports @novnc/novnc/lib/rfb.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] web/src/lib/agent/fixedEffort.ts:2 — web/src/lib/agent/fixedEffort.ts:2 reaches into another package with a relative path (../../../../server/internal/modelrouting/provider_efforts.json) — import the package by name instead.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×2
  • Heading level jumps from h1 to h3 web/src/views/RunDetailView.vue:424 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 web/src/views/TokenAnalyticsView.vue:1135 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.2 · ×2
  • Low contrast colour pair in CSS (4.2:1) docs/site/css/home.css:1620 — `.approve-confirm` sets color: #fff on background-color: #7b61ff — 4.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (4.2:1) docs/site/css/home.css:1856 — `.demo-ui__btn.is-primary` sets color: #fff on background-color: #7b61ff — 4.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: useClarifyChat.ts ↔ useGateApproval.ts web/src/lib/inbox/useClarifyChat.ts:1 — `web/src/lib/inbox/useClarifyChat.ts` and `web/src/lib/inbox/useGateApproval.ts` change together 82% of the time (9 of the 11 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `2f0a3b1b` refactor(web): drop unused destructures and composable returns; `d42ae2b1` fix: keep workflow and approval waiters in the queue until their turn…; `4ca6c74b` fix: reconcile accepted chat messages by send identity — run `git show` on any of them.
  • Change coupling: AgentMetaPanel.vue ↔ apiTypes.ts web/src/components/agent/AgentMetaPanel.vue:1 — `web/src/components/agent/AgentMetaPanel.vue` and `web/src/lib/api/apiTypes.ts` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 5 shared commits counted here, the most recent 3 are `aabbc823` fix: CLI 模型清单改为实际 ID,共享 Agent 配置支持默认模型 (#790); `8a692674` feat: 共享 Agent 配置可保存通用授权,运行时单个优先 (#779); `a3d7f6a7` feat(credentials): 让 OpenCode 按 Agent 选用模型厂商密钥 — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) server/internal/handlers/sandbox_proxy_auth.go:126 — server/internal/handlers/sandbox_proxy_auth.go:126-147 | server/internal/handlers/sandbox_proxy_auth.go:176-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) REDACTED:43 — REDACTED:43-64 | REDACTED:75-96 — 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 (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) server/internal/handlers/gate_share_public.go:751 — server/internal/handlers/gate_share_public.go:751-778 | server/internal/handlers/gate_share_public.go:780-810 — 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.
  • Edited copy of a member (28 corresponding lines) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:239 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:239-266 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:268-295 — 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, 17+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 17+ corresponding lines) sandbox-gateway/gateway/internal/api/handlers.go:331 — sandbox-gateway/gateway/internal/api/handlers.go:331-347 | sandbox-gateway/gateway/internal/api/handlers.go:350-368 | sandbox-gateway/gateway/internal/api/handlers.go:371-393 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 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, 17+ corresponding lines) server/internal/handlers/app_preview_references.go:33 — server/internal/handlers/app_preview_references.go:33-53 | server/internal/handlers/run_references.go:14-30 | server/internal/handlers/run_references.go:35-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 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, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) server/internal/handlers/workspace.go:152 — server/internal/handlers/workspace.go:152-164 | server/internal/handlers/workspace.go:166-182 | server/internal/handlers/workspace.go:186-202 — 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.
  • Edited copies of one member (3 members, 13+ corresponding lines) server/internal/runtime/acp_timeline.go:70 — server/internal/runtime/acp_timeline.go:70-82 | server/internal/runtime/acp_timeline.go:85-100 | server/internal/runtime/acp_timeline.go:102-117 — 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 (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) server/internal/gateshare/review.go:135 — server/internal/gateshare/review.go:135-156 | server/internal/gateshare/review.go:198-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/internal/gateshare/review.go:220` calls `notifyInvalidated` and `server/internal/gateshare/review.go:157` 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 (22 lines × 2) server/internal/handlers/pagination.go:118 — server/internal/handlers/pagination.go:118-139 | server/internal/runtime/acp_timeline.go:284-305 — 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 `server/internal/handlers/pagination.go:118` 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 (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) server/internal/handlers/embed.go:140 — server/internal/handlers/embed.go:140-152 | server/internal/handlers/gate_share_public_preview.go:33-44 — 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 `server/internal/handlers/embed.go:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) server/internal/services/sandbox_agent.go:112 — server/internal/services/sandbox_agent.go:112-123 | server/internal/services/sandbox_studio.go:284-296 — 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 (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) server/internal/handlers/gate_share_public.go:75 — server/internal/handlers/gate_share_public.go:75-83 | server/internal/handlers/gate_share_public.go:141-149 | server/internal/handlers/gate_share_public_images.go:21-29 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/internal/handlers/gate_share_public_images.go:31` calls `TrimSpace`, `Query` and `server/internal/handlers/gate_share_public.go:84` 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 (9 lines × 3) server/internal/mcp/structured/doc.go:85 — server/internal/mcp/structured/doc.go:85-93 | server/internal/mcp/tools.go:994-1002 | server/internal/runtime/acp_repos.go:147-155 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) server/internal/handlers/embed.go:150 — server/internal/handlers/embed.go:150-157 | server/internal/handlers/gate_share_public.go:85-92 | server/internal/handlers/gate_share_public.go:151-158 | server/internal/handlers/gate_share_public_images.go:34-41 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/handlers/embed.go:150` 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 × 4) sandbox-gateway/sandbox/internal/acp/panel.go:489 — sandbox-gateway/sandbox/internal/acp/panel.go:489-496 | sandbox-gateway/sandbox/internal/acp/panel.go:516-523 | sandbox-gateway/sandbox/internal/acp/panel.go:533-540 | sandbox-gateway/sandbox/internal/acp/panel.go:549-556 — 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 `sandbox-gateway/sandbox/internal/acp/panel.go:489` 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 (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) server/internal/handlers/inbox_context.go:66 — server/internal/handlers/inbox_context.go:66-71 | server/internal/handlers/inbox_context.go:142-147 | server/internal/handlers/v1_handlers.go:176-181 — 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 `server/internal/handlers/inbox_context.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.
  • Duplicated block (6 lines × 3) server/internal/handlers/gate.go:306 — server/internal/handlers/gate.go:306-311 | server/internal/handlers/gate.go:327-332 | server/internal/handlers/gate.go:343-348 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/internal/handlers/gate.go:338` calls `JSON`, `GateReactCancel` and `server/internal/handlers/gate.go:305` 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 (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) server/internal/handlers/gate.go:77 — server/internal/handlers/gate.go:77-81 | server/internal/handlers/gate.go:99-103 | server/internal/handlers/run_artifact.go:53-57 — 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 `server/internal/handlers/gate.go:77` 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 × 3) server/internal/handlers/gate.go:302 — server/internal/handlers/gate.go:302-306 | server/internal/handlers/gate.go:323-327 | server/internal/handlers/visit_model.go:40-44 — 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.
P8 · Schema migrations · Schema created by GORM AutoMigrate (no migration path) · ×2
  • Schema created by GORM AutoMigrate (no migration path) server/internal/database/database.go:253 — GORM AutoMigrate builds the schema from the model at startup and keeps no migration history, so there is no reviewed, repeatable upgrade path for an existing production database — a renamed column is dropped and re-added rather than migrated. Adopt a versioned migration tool such as golang-migrate, goose or Atlas, so every schema change is a versioned file applied the same way in every environment.
  • Schema created by GORM AutoMigrate (no migration path) sandbox-gateway/gateway/internal/database/database.go:29 — GORM AutoMigrate builds the schema from the model at startup and keeps no migration history, so there is no reviewed, repeatable upgrade path for an existing production database — a renamed column is dropped and re-added rather than migrated. Adopt a versioned migration tool such as golang-migrate, goose or Atlas, so every schema change is a versioned file applied the same way in every environment.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×2
  • Duplicated block (16 lines × 2 locations) web/src/components/run/SandboxStageSurface.vue:131 — web/src/components/run/SandboxStageSurface.vue:131 · web/src/views/SandboxConsoleView.vue:237 — 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 (16 lines × 2 locations) web/src/lib/api/clients/agentsClient.ts:13 — web/src/lib/api/clients/agentsClient.ts:13 · web/src/lib/api/clients/artifactsClient.ts:12 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
AC1 · Text alternatives · <canvas> without a text alternative · ×1
  • <canvas> without a text alternative web/src/components/dashboard/HomeParticleMeshBackground.vue:166 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark web/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.3 · ×1
  • Low contrast colour pair in CSS (3.3:1) docs/site/css/home.css:1946 — `.approve-btn` sets color: #fff on background-color: #16a34a — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AX2 · Stateful singletons · Stateful handler dependency · ×1
  • Stateful handler dependency: Engine server/internal/engine/engine.go:24 — `Engine` is shared by every request (`autoRunsMap` is called per request from the Gin handler `Handlers.ResumeRun`, on the one `Engine` value that handler's shared receiver holds) but writes its fields outside any lock (autoRuns; e.g. `autoRuns` in `autoRunsMap` at line 91). Unsynchronised concurrent writes are a data race in Go: an update is lost or a value tears, and a concurrent map write aborts the process.
D1 · Cyclomatic Complexity · useGatesInbox.useGatesInbox.connectActiveRunWs (cyclomatic 124) · ×1
  • useGatesInbox.useGatesInbox.connectActiveRunWs (cyclomatic 124) web/src/lib/inbox/useGatesInbox.ts:2352 — useGatesInbox.useGatesInbox.connectActiveRunWs has cyclomatic complexity 124 (threshold 15). Most of this is not in the body itself: 6 of the 124 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 2400, 2460, 2453, …). 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 · useSoloChat.useSoloChat.onFrame (cyclomatic 83) · ×1
  • useSoloChat.useSoloChat.onFrame (cyclomatic 83) web/src/lib/solo/useSoloChat.ts:609 — useSoloChat.useSoloChat.onFrame has cyclomatic complexity 83 (threshold 15). Of this number, 81 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 · overlay.createOverlay (cyclomatic 81) · ×1
  • overlay.createOverlay (cyclomatic 81) web/src/liveoverlay/overlay.ts:150 — overlay.createOverlay has cyclomatic complexity 81 (threshold 15). Most of this is not in the body itself: 6 of the 81 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1132, 1259, 1270, …). 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 · useGatesInbox.useGatesInbox.onClarifySend (cyclomatic 73) · ×1
  • useGatesInbox.useGatesInbox.onClarifySend (cyclomatic 73) web/src/lib/inbox/useGatesInbox.ts:3322 — useGatesInbox.useGatesInbox.onClarifySend has cyclomatic complexity 73 (threshold 15). Of this number, 70 points are the body's own statements and 3 belong to 2 function items 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 · useGatesInbox.useGatesInbox (cyclomatic 67) · ×1
  • useGatesInbox.useGatesInbox (cyclomatic 67) web/src/lib/inbox/useGatesInbox.ts:107 — useGatesInbox.useGatesInbox has cyclomatic complexity 67 (threshold 15). Most of this is not in the body itself: 1 of the 67 points is its own statement and the rest belongs to 29 function literals inside it that branch (lines 1987, 1961, 451, …). 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 · overlay.createOverlay.renderSwitchers (cyclomatic 63) · ×1
  • overlay.createOverlay.renderSwitchers (cyclomatic 63) web/src/liveoverlay/overlay.ts:570 — overlay.createOverlay.renderSwitchers 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 · Engine.ReactLiveWithAttachmentsAs (cyclomatic 62) · ×1
  • Engine.ReactLiveWithAttachmentsAs (cyclomatic 62) server/internal/engine/live.go:132 — Engine.ReactLiveWithAttachmentsAs has cyclomatic complexity 62 (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 · useClarifyChat.useClarifyChat (cyclomatic 59) · ×1
  • useClarifyChat.useClarifyChat (cyclomatic 59) web/src/lib/inbox/useClarifyChat.ts:122 — useClarifyChat.useClarifyChat has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 16 function literals inside it that branch (lines 324, 1445, 1307, …). 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 · main.main (cyclomatic 57) · ×1
  • main.main (cyclomatic 57) REDACTED:56 — main.main has cyclomatic complexity 57 (threshold 15). Of this number, 21 points are the body's own statements and 36 belong to 16 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 · useGateApproval.useGateApproval.applyReviewFrame (cyclomatic 57) · ×1
  • useGateApproval.useGateApproval.applyReviewFrame (cyclomatic 57) web/src/lib/inbox/useGateApproval.ts:1501 — useGateApproval.useGateApproval.applyReviewFrame has cyclomatic complexity 57 (threshold 15). Of this number, 55 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 · Driver.Create (cyclomatic 54) · ×1
  • Driver.Create (cyclomatic 54) sandbox-gateway/gateway/internal/driver/e2b/driver.go:297 — Driver.Create has cyclomatic complexity 54 (threshold 15). Of this number, 52 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 · useGatesInbox.useGatesInbox.recoverClarifySession (cyclomatic 54) · ×1
  • useGatesInbox.useGatesInbox.recoverClarifySession (cyclomatic 54) web/src/lib/inbox/useGatesInbox.ts:2727 — useGatesInbox.useGatesInbox.recoverClarifySession has cyclomatic complexity 54 (threshold 15). Of this number, 49 points are the body's own statements and 5 belong to 3 function items 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 · CredentialService.updateOnce (cyclomatic 53) · ×1
  • CredentialService.updateOnce (cyclomatic 53) server/internal/services/workspace_credentials.go:356 — CredentialService.updateOnce 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 · LiveEvent.Normalize (cyclomatic 51) · ×1
  • LiveEvent.Normalize (cyclomatic 51) server/internal/models/live.go:256 — LiveEvent.Normalize has cyclomatic complexity 51 (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 · Engine.reactReply (cyclomatic 49) · ×1
  • Engine.reactReply (cyclomatic 49) server/internal/engine/resume.go:380 — Engine.reactReply 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 · useRunDetailWs.useRunDetailWs.connectWs (cyclomatic 49) · ×1
  • useRunDetailWs.useRunDetailWs.connectWs (cyclomatic 49) web/src/lib/run/useRunDetailWs.ts:465 — useRunDetailWs.useRunDetailWs.connectWs has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 3 of the 49 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 493, 534, 528, …). 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 · modelrouting.ValidateBinding (cyclomatic 48) · ×1
  • modelrouting.ValidateBinding (cyclomatic 48) server/internal/modelrouting/capabilities.go:69 — modelrouting.ValidateBinding 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 · overlay.createOverlay.onDrawer (cyclomatic 47) · ×1
  • overlay.createOverlay.onDrawer (cyclomatic 47) web/src/liveoverlay/overlay.ts:1317 — overlay.createOverlay.onDrawer has cyclomatic complexity 47 (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 · Driver.load (cyclomatic 45) · ×1
  • Driver.load (cyclomatic 45) sandbox-gateway/gateway/internal/driver/e2b/state.go:94 — Driver.load 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 · Config.validateE2B (cyclomatic 44) · ×1
  • Config.validateE2B (cyclomatic 44) sandbox-gateway/gateway/internal/config/validation.go:80 — Config.validateE2B has cyclomatic complexity 44 (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 · Engine.ResumeGateExternal (cyclomatic 44) · ×1
  • Engine.ResumeGateExternal (cyclomatic 44) server/internal/engine/resume_external.go:23 — Engine.ResumeGateExternal has cyclomatic complexity 44 (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 · SandboxService.AlignSoloModelRoute (cyclomatic 44) · ×1
  • SandboxService.AlignSoloModelRoute (cyclomatic 44) server/internal/services/sandbox_solo_route.go:83 — SandboxService.AlignSoloModelRoute has cyclomatic complexity 44 (threshold 15). Of this number, 38 points are the body's own statements and 6 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 · structured.ParseClarifiedRequirement (cyclomatic 43) · ×1
  • structured.ParseClarifiedRequirement (cyclomatic 43) server/internal/mcp/structured/doc.go:231 — structured.ParseClarifiedRequirement has cyclomatic complexity 43 (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 · useRunLive.useRunLive.applyRun (cyclomatic 43) · ×1
  • useRunLive.useRunLive.applyRun (cyclomatic 43) web/src/lib/run/useRunLive.ts:305 — useRunLive.useRunLive.applyRun has cyclomatic complexity 43 (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 · structured.RenderClarifiedRequirementMarkdown (cyclomatic 42) · ×1
  • structured.RenderClarifiedRequirementMarkdown (cyclomatic 42) server/internal/mcp/structured/doc.go:459 — structured.RenderClarifiedRequirementMarkdown has cyclomatic complexity 42 (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 · Engine.buildDialogue (cyclomatic 41) · ×1
  • Engine.buildDialogue (cyclomatic 41) server/internal/engine/dialogue_state.go:114 — Engine.buildDialogue 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 · Handlers.PublicAppPreviewGuestChat (cyclomatic 41) · ×1
  • Handlers.PublicAppPreviewGuestChat (cyclomatic 41) REDACTED:93 — Handlers.PublicAppPreviewGuestChat 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 · services.normalizeCredentialDomainInput (cyclomatic 41) · ×1
  • services.normalizeCredentialDomainInput (cyclomatic 41) server/internal/services/credential_domain.go:40 — services.normalizeCredentialDomainInput 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 · SandboxService.ensureRunningLocked (cyclomatic 41) · ×1
  • SandboxService.ensureRunningLocked (cyclomatic 41) server/internal/services/sandbox_recovery.go:291 — SandboxService.ensureRunningLocked has cyclomatic complexity 41 (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 · useRunLive.useRunLive.onFrame (cyclomatic 41) · ×1
  • useRunLive.useRunLive.onFrame (cyclomatic 41) web/src/lib/run/useRunLive.ts:505 — useRunLive.useRunLive.onFrame 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 · Driver.cleanup (cyclomatic 40) · ×1
  • Driver.cleanup (cyclomatic 40) sandbox-gateway/gateway/internal/driver/e2b/driver.go:967 — Driver.cleanup has cyclomatic complexity 40 (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 · config.applyEnvOverrides (cyclomatic 40) · ×1
  • config.applyEnvOverrides (cyclomatic 40) server/internal/config/config.go:499 — config.applyEnvOverrides 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 · Engine.TakeoverNode (cyclomatic 40) · ×1
  • Engine.TakeoverNode (cyclomatic 40) server/internal/engine/takeover.go:132 — Engine.TakeoverNode has cyclomatic complexity 40 (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 · mcp.ValidateHumanArtifactContent (cyclomatic 40) · ×1
  • mcp.ValidateHumanArtifactContent (cyclomatic 40) server/internal/mcp/human_artifact.go:27 — mcp.ValidateHumanArtifactContent has cyclomatic complexity 40 (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 · ModelConnectionService.Resolve (cyclomatic 40) · ×1
  • ModelConnectionService.Resolve (cyclomatic 40) server/internal/services/model_connections.go:175 — ModelConnectionService.Resolve has cyclomatic complexity 40 (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 · mock-agent-model.validateScenario (cyclomatic 40) · ×1
  • mock-agent-model.validateScenario (cyclomatic 40) sandbox-gateway/scripts/mock-agent-model.mjs:131 — mock-agent-model.validateScenario has cyclomatic complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function item 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 · llmTranscriptThread.clarifyTurnsFromLlm (cyclomatic 39) · ×1
  • llmTranscriptThread.clarifyTurnsFromLlm (cyclomatic 39) web/src/lib/run/llmTranscriptThread.ts:95 — llmTranscriptThread.clarifyTurnsFromLlm has cyclomatic complexity 39 (threshold 15). Of this number, 17 points are the body's own statements and 22 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 · acpProvider.ReactReply (cyclomatic 38) · ×1
  • acpProvider.ReactReply (cyclomatic 38) server/internal/runtime/acp_react.go:124 — acpProvider.ReactReply has cyclomatic complexity 38 (threshold 15). Of this number, 34 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 · mock-agent-model.resolveAction (cyclomatic 38) · ×1
  • mock-agent-model.resolveAction (cyclomatic 38) sandbox-gateway/scripts/mock-agent-model.mjs:163 — mock-agent-model.resolveAction 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, separate the cases: extract each independent 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 · useGatesInbox.useGatesInbox.loadActiveRun (cyclomatic 38) · ×1
  • useGatesInbox.useGatesInbox.loadActiveRun (cyclomatic 38) web/src/lib/inbox/useGatesInbox.ts:2899 — useGatesInbox.useGatesInbox.loadActiveRun has cyclomatic complexity 38 (threshold 15). Of this number, 36 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 · Config.validate (cyclomatic 37) · ×1
  • Config.validate (cyclomatic 37) sandbox-gateway/gateway/internal/config/validation.go:13 — Config.validate has cyclomatic complexity 37 (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 · ModelConnectionService.DiscoverModels (cyclomatic 37) · ×1
  • ModelConnectionService.DiscoverModels (cyclomatic 37) server/internal/services/model_discovery.go:29 — ModelConnectionService.DiscoverModels 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 · artifactForms.pruneObject (cyclomatic 37) · ×1
  • artifactForms.pruneObject (cyclomatic 37) web/src/lib/run/artifactForms.ts:405 — artifactForms.pruneObject has cyclomatic complexity 37 (threshold 15). Of this number, 36 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 · configuredModels.configuredModelChoices (cyclomatic 37) · ×1
  • configuredModels.configuredModelChoices (cyclomatic 37) web/src/lib/solo/configuredModels.ts:62 — configuredModels.configuredModelChoices has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 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 · Engine.ResumeReviewExternalOpts (cyclomatic 36) · ×1
  • Engine.ResumeReviewExternalOpts (cyclomatic 36) server/internal/engine/resume_review_external.go:15 — Engine.ResumeReviewExternalOpts 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 · filestore.Migrate (cyclomatic 36) · ×1
  • filestore.Migrate (cyclomatic 36) server/internal/filestore/migration.go:27 — filestore.Migrate 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 · Handlers.PublicGateDecide (cyclomatic 36) · ×1
  • Handlers.PublicGateDecide (cyclomatic 36) server/internal/handlers/gate_share_public.go:531 — Handlers.PublicGateDecide 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 · SoloService.alignSessionModel (cyclomatic 36) · ×1
  • SoloService.alignSessionModel (cyclomatic 36) server/internal/services/solo_model_settings.go:325 — SoloService.alignSessionModel 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 · mock-agent-model.normalizeRequest (cyclomatic 36) · ×1
  • mock-agent-model.normalizeRequest (cyclomatic 36) sandbox-gateway/scripts/mock-agent-model.mjs:53 — mock-agent-model.normalizeRequest has cyclomatic complexity 36 (threshold 15). Of this number, 16 points are the body's own statements and 20 belong to 2 function items 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 · httpCore.req (cyclomatic 36) · ×1
  • httpCore.req (cyclomatic 36) web/src/lib/api/httpCore.ts:81 — httpCore.req 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 · config.setDefaults (cyclomatic 35) · ×1
  • config.setDefaults (cyclomatic 35) server/internal/config/config.go:619 — config.setDefaults 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 · useRunDetail.useRunDetail (cyclomatic 35) · ×1
  • useRunDetail.useRunDetail (cyclomatic 35) web/src/lib/run/useRunDetail.ts:62 — useRunDetail.useRunDetail has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 688, 671, 1226, …). 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 · useRunDetail.useRunDetail.onClarifySend (cyclomatic 35) · ×1
  • useRunDetail.useRunDetail.onClarifySend (cyclomatic 35) web/src/lib/run/useRunDetail.ts:737 — useRunDetail.useRunDetail.onClarifySend 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 · useRunLive.useRunLive.seed (cyclomatic 35) · ×1
  • useRunLive.useRunLive.seed (cyclomatic 35) web/src/lib/run/useRunLive.ts:473 — useRunLive.useRunLive.seed has cyclomatic complexity 35 (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 · TunnelManager.forward (cyclomatic 34) · ×1
  • TunnelManager.forward (cyclomatic 34) sandbox-gateway/gateway/internal/driver/e2b/tunnel.go:322 — TunnelManager.forward has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 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 · Engine.ApplyLiveReport (cyclomatic 34) · ×1
  • Engine.ApplyLiveReport (cyclomatic 34) server/internal/engine/live.go:481 — Engine.ApplyLiveReport 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 · Handlers.PublicGateEvents (cyclomatic 34) · ×1
  • Handlers.PublicGateEvents (cyclomatic 34) REDACTED:34 — Handlers.PublicGateEvents has cyclomatic complexity 34 (threshold 15). 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, separate the cases: extract each independent 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 · AgentService.ImportWorkspaceAgentsZIP (cyclomatic 34) · ×1
  • AgentService.ImportWorkspaceAgentsZIP (cyclomatic 34) server/internal/services/workspace_agents_bundle.go:117 — AgentService.ImportWorkspaceAgentsZIP has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 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 · ModelConnectionService.validateConnection (cyclomatic 34) · ×1
  • ModelConnectionService.validateConnection (cyclomatic 34) server/internal/services/model_connections.go:94 — ModelConnectionService.validateConnection 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 · liveVariants.parseMarks (cyclomatic 34) · ×1
  • liveVariants.parseMarks (cyclomatic 34) web/src/lib/inbox/liveVariants.ts:135 — liveVariants.parseMarks 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 · Engine.executeFrom (cyclomatic 33) · ×1
  • Engine.executeFrom (cyclomatic 33) server/internal/engine/execute.go:298 — Engine.executeFrom has cyclomatic complexity 33 (threshold 15). Of this number, 32 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 · liveVariants.parseEmbedLiveMessage (cyclomatic 33) · ×1
  • liveVariants.parseEmbedLiveMessage (cyclomatic 33) web/src/lib/inbox/liveVariants.ts:201 — liveVariants.parseEmbedLiveMessage 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 · useGraphIssues.collectGraphIssues (cyclomatic 33) · ×1
  • useGraphIssues.collectGraphIssues (cyclomatic 33) web/src/components/canvas/composables/useGraphIssues.ts:17 — useGraphIssues.collectGraphIssues has cyclomatic complexity 33 (threshold 15). Of this number, 32 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 · useCanvasShortcuts.resolveShortcut (cyclomatic 33) · ×1
  • useCanvasShortcuts.resolveShortcut (cyclomatic 33) web/src/components/canvas/composables/useCanvasShortcuts.ts:70 — useCanvasShortcuts.resolveShortcut 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 · Handlers.PublicGateReply (cyclomatic 32) · ×1
  • Handlers.PublicGateReply (cyclomatic 32) server/internal/handlers/gate_share_public.go:179 — Handlers.PublicGateReply 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 · Handlers.PublicPreviewAPIProxy (cyclomatic 32) · ×1
  • Handlers.PublicPreviewAPIProxy (cyclomatic 32) server/internal/handlers/gate_share_public_preview.go:191 — Handlers.PublicPreviewAPIProxy has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 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 · mcp.RenderPlanMarkdown (cyclomatic 32) · ×1
  • mcp.RenderPlanMarkdown (cyclomatic 32) server/internal/mcp/plan.go:669 — mcp.RenderPlanMarkdown 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 · services.aggregateGlobalRows (cyclomatic 32) · ×1
  • services.aggregateGlobalRows (cyclomatic 32) server/internal/services/global_token_stats.go:693 — services.aggregateGlobalRows 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 · AgentService.prepareSave (cyclomatic 32) · ×1
  • AgentService.prepareSave (cyclomatic 32) server/internal/services/agent.go:412 — AgentService.prepareSave 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 · ConversationHistoryService.readSession (cyclomatic 32) · ×1
  • ConversationHistoryService.readSession (cyclomatic 32) server/internal/services/conversation_history.go:101 — ConversationHistoryService.readSession 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 · RunService.CurrentNodes (cyclomatic 32) · ×1
  • RunService.CurrentNodes (cyclomatic 32) server/internal/services/run_current.go:88 — RunService.CurrentNodes 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 · useGatesInbox.useGatesInbox.confirmIncomingGhostStillNeeded (cyclomatic 32) · ×1
  • useGatesInbox.useGatesInbox.confirmIncomingGhostStillNeeded (cyclomatic 32) web/src/lib/inbox/useGatesInbox.ts:1336 — useGatesInbox.useGatesInbox.confirmIncomingGhostStillNeeded has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 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 · useHomeApproveChat.useHomeApproveChat (cyclomatic 32) · ×1
  • useHomeApproveChat.useHomeApproveChat (cyclomatic 32) web/src/lib/run/useHomeApproveChat.ts:114 — useHomeApproveChat.useHomeApproveChat has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 282, 313, 274, …). 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 · useRunDetailSelection.useRunDetailSelection (cyclomatic 32) · ×1
  • useRunDetailSelection.useRunDetailSelection (cyclomatic 32) web/src/lib/run/useRunDetailSelection.ts:16 — useRunDetailSelection.useRunDetailSelection has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 168, 189, 229, …). 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 · useSoloChat.useSoloChat.applyMessages (cyclomatic 32) · ×1
  • useSoloChat.useSoloChat.applyMessages (cyclomatic 32) web/src/lib/solo/useSoloChat.ts:318 — useSoloChat.useSoloChat.applyMessages has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body's own statements and 13 belong to one function item 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 · Engine.buildOutputCard (cyclomatic 31) · ×1
  • Engine.buildOutputCard (cyclomatic 31) server/internal/engine/output.go:159 — Engine.buildOutputCard 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 · Engine.executeClarifyTurn (cyclomatic 31) · ×1
  • Engine.executeClarifyTurn (cyclomatic 31) server/internal/engine/review_session.go:713 — Engine.executeClarifyTurn 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 · acpProvider.runAgentOnce (cyclomatic 31) · ×1
  • acpProvider.runAgentOnce (cyclomatic 31) REDACTED:74 — acpProvider.runAgentOnce has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 belong to 3 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 · services.dropOnboardingAgentNode (cyclomatic 31) · ×1
  • services.dropOnboardingAgentNode (cyclomatic 31) server/internal/services/onboarding.go:477 — services.dropOnboardingAgentNode has cyclomatic complexity 31 (threshold 15). Of this number, 27 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 · ArtifactService.SaveFile (cyclomatic 31) · ×1
  • ArtifactService.SaveFile (cyclomatic 31) server/internal/services/artifact_file.go:65 — ArtifactService.SaveFile has cyclomatic complexity 31 (threshold 15). Of this number, 18 points are the body's own statements and 13 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 · CredentialService.create (cyclomatic 31) · ×1
  • CredentialService.create (cyclomatic 31) server/internal/services/workspace_credentials.go:257 — CredentialService.create 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 · useSoloChat.useSoloChat.openWs (cyclomatic 31) · ×1
  • useSoloChat.useSoloChat.openWs (cyclomatic 31) web/src/lib/solo/useSoloChat.ts:752 — useSoloChat.useSoloChat.openWs has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 5 function items inside it that branch (deliver, flushReplay, a function literal at line 806, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · e2b.validateRecovery (cyclomatic 30) · ×1
  • e2b.validateRecovery (cyclomatic 30) sandbox-gateway/gateway/internal/driver/e2b/snapshot_restore.go:134 — e2b.validateRecovery has cyclomatic complexity 30 (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 · engine.tokenize (cyclomatic 30) · ×1
  • engine.tokenize (cyclomatic 30) server/internal/engine/guard.go:90 — engine.tokenize has cyclomatic complexity 30 (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 · Engine.finish (cyclomatic 30) · ×1
  • Engine.finish (cyclomatic 30) server/internal/engine/finish.go:146 — Engine.finish 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 · SandboxService.reclaimLocked (cyclomatic 30) · ×1
  • SandboxService.reclaimLocked (cyclomatic 30) server/internal/services/sandbox_recovery.go:47 — SandboxService.reclaimLocked 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 · runtime.installRuntimeIconMotion (cyclomatic 30) · ×1
  • runtime.installRuntimeIconMotion (cyclomatic 30) web/src/lib/icons/runtime.ts:32 — runtime.installRuntimeIconMotion has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 10 function items inside it that branch (enter, leave, pointerover, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useFlowElements.useFlowElements.flowNodes.out (cyclomatic 30) · ×1
  • useFlowElements.useFlowElements.flowNodes.out (cyclomatic 30) web/src/components/canvas/composables/useFlowElements.ts:134 — useFlowElements.useFlowElements.flowNodes.out 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 · useFlowElements.useFlowElements.flowEdges (cyclomatic 30) · ×1
  • useFlowElements.useFlowElements.flowEdges (cyclomatic 30) web/src/components/canvas/composables/useFlowElements.ts:213 — useFlowElements.useFlowElements.flowEdges has cyclomatic complexity 30 (threshold 15). Of this number, 26 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 · e2b.New (cyclomatic 29) · ×1
  • e2b.New (cyclomatic 29) sandbox-gateway/gateway/internal/driver/e2b/driver.go:145 — e2b.New 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 · gateshare.sanitizeJSONValue (cyclomatic 29) · ×1
  • gateshare.sanitizeJSONValue (cyclomatic 29) server/internal/gateshare/sanitize.go:226 — gateshare.sanitizeJSONValue 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 · Handlers.PublicAppPreviewMainEvents (cyclomatic 29) · ×1
  • Handlers.PublicAppPreviewMainEvents (cyclomatic 29) REDACTED:19 — Handlers.PublicAppPreviewMainEvents has cyclomatic complexity 29 (threshold 15). Of this number, 27 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 · useSidebarNavigation.provideSidebarNavigation (cyclomatic 29) · ×1
  • useSidebarNavigation.provideSidebarNavigation (cyclomatic 29) web/src/lib/composables/useSidebarNavigation.ts:15 — useSidebarNavigation.provideSidebarNavigation has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 25, 43, 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 · useRunDetailWs.useRunDetailWs.initAfterLoadSuccess (cyclomatic 29) · ×1
  • useRunDetailWs.useRunDetailWs.initAfterLoadSuccess (cyclomatic 29) web/src/lib/run/useRunDetailWs.ts:401 — useRunDetailWs.useRunDetailWs.initAfterLoadSuccess has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 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 · Service.LookupByToken (cyclomatic 28) · ×1
  • Service.LookupByToken (cyclomatic 28) server/internal/gateshare/service.go:491 — Service.LookupByToken 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 · tokenAnalyticsCharts.listDrillBreakdowns (cyclomatic 28) · ×1
  • tokenAnalyticsCharts.listDrillBreakdowns (cyclomatic 28) web/src/components/token-analytics/tokenAnalyticsCharts.ts:447 — tokenAnalyticsCharts.listDrillBreakdowns has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 502, a function literal at line 541, a function literal at line 468, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useSoloChat.useSoloChat.samePayload (cyclomatic 28) · ×1
  • useSoloChat.useSoloChat.samePayload (cyclomatic 28) web/src/lib/solo/useSoloChat.ts:244 — useSoloChat.useSoloChat.samePayload has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 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 · useSoloChat.useSoloChat.send (cyclomatic 28) · ×1
  • useSoloChat.useSoloChat.send (cyclomatic 28) web/src/lib/solo/useSoloChat.ts:907 — useSoloChat.useSoloChat.send 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 · scan.parseParams (cyclomatic 28) · ×1
  • scan.parseParams (cyclomatic 28) web/src/liveoverlay/scan.ts:23 — scan.parseParams has cyclomatic complexity 28 (threshold 15). Of this number, 26 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 · executor.createExecutor.exec (cyclomatic 28) · ×1
  • executor.createExecutor.exec (cyclomatic 28) web/src/pagecontrol/executor.ts:215 — executor.createExecutor.exec 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 · Driver.restoreLatest (cyclomatic 27) · ×1
  • Driver.restoreLatest (cyclomatic 27) sandbox-gateway/gateway/internal/driver/e2b/snapshot_restore.go:59 — Driver.restoreLatest 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 · mcp.formatMCPAuditAction (cyclomatic 27) · ×1
  • mcp.formatMCPAuditAction (cyclomatic 27) server/internal/mcp/audit_summary.go:56 — mcp.formatMCPAuditAction has cyclomatic complexity 27 (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 · githubRefClient.Search (cyclomatic 27) · ×1
  • githubRefClient.Search (cyclomatic 27) server/internal/services/solo_reference_github.go:411 — githubRefClient.Search 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 · WorkspaceService.GlobalTokenStats (cyclomatic 27) · ×1
  • WorkspaceService.GlobalTokenStats (cyclomatic 27) server/internal/services/global_token_stats.go:201 — WorkspaceService.GlobalTokenStats 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 · mock-agent-model.createMockAgentServer.server (cyclomatic 27) · ×1
  • mock-agent-model.createMockAgentServer.server (cyclomatic 27) sandbox-gateway/scripts/mock-agent-model.mjs:426 — mock-agent-model.createMockAgentServer.server has cyclomatic complexity 27 (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 · useGatesInbox.useGatesInbox.refreshActiveContext (cyclomatic 27) · ×1
  • useGatesInbox.useGatesInbox.refreshActiveContext (cyclomatic 27) web/src/lib/inbox/useGatesInbox.ts:2830 — useGatesInbox.useGatesInbox.refreshActiveContext has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to 2 function items 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 · Handlers.runDetailDTO (cyclomatic 26) · ×1
  • Handlers.runDetailDTO (cyclomatic 26) server/internal/handlers/dto.go:278 — Handlers.runDetailDTO 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 · Host.ServeRunHTTP (cyclomatic 26) · ×1
  • Host.ServeRunHTTP (cyclomatic 26) server/internal/mcp/http.go:35 — Host.ServeRunHTTP 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 · models.NormalizeGitScope (cyclomatic 26) · ×1
  • models.NormalizeGitScope (cyclomatic 26) server/internal/models/git_scope.go:19 — models.NormalizeGitScope has cyclomatic complexity 26 (threshold 15). Of this number, 25 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 · RunService.ConversationChain (cyclomatic 26) · ×1
  • RunService.ConversationChain (cyclomatic 26) server/internal/services/conversation_chain.go:161 — RunService.ConversationChain 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 · SandboxService.reconcileRecoveryState (cyclomatic 26) · ×1
  • SandboxService.reconcileRecoveryState (cyclomatic 26) server/internal/services/sandbox_recovery.go:525 — SandboxService.reconcileRecoveryState 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 · SandboxService.ChatWithTimeout (cyclomatic 26) · ×1
  • SandboxService.ChatWithTimeout (cyclomatic 26) server/internal/services/sandbox_studio.go:376 — SandboxService.ChatWithTimeout has cyclomatic complexity 26 (threshold 15). Of this number, 21 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 · SoloService.SetCurrentModelRouteSettings (cyclomatic 26) · ×1
  • SoloService.SetCurrentModelRouteSettings (cyclomatic 26) server/internal/services/solo_model_settings.go:50 — SoloService.SetCurrentModelRouteSettings 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 · SoloService.liveReasoningEfforts (cyclomatic 26) · ×1
  • SoloService.liveReasoningEfforts (cyclomatic 26) server/internal/services/solo_model_settings.go:226 — SoloService.liveReasoningEfforts 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 · useGatesInbox.useGatesInbox.projectClarifySessionAfterLoad (cyclomatic 26) · ×1
  • useGatesInbox.useGatesInbox.projectClarifySessionAfterLoad (cyclomatic 26) web/src/lib/inbox/useGatesInbox.ts:2297 — useGatesInbox.useGatesInbox.projectClarifySessionAfterLoad has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to one function item 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 · gateshare.SanitizeTurnsFrom (cyclomatic 25) · ×1
  • gateshare.SanitizeTurnsFrom (cyclomatic 25) server/internal/gateshare/sanitize.go:372 — gateshare.SanitizeTurnsFrom 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 · Service.AttachInboxStatus (cyclomatic 25) · ×1
  • Service.AttachInboxStatus (cyclomatic 25) server/internal/gateshare/service.go:665 — Service.AttachInboxStatus 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 · Handlers.PublicPreviewTicket (cyclomatic 25) · ×1
  • Handlers.PublicPreviewTicket (cyclomatic 25) server/internal/handlers/gate_share_public_preview.go:27 — Handlers.PublicPreviewTicket 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 · Handlers.writePreviewModelCatalog (cyclomatic 25) · ×1
  • Handlers.writePreviewModelCatalog (cyclomatic 25) server/internal/handlers/preview_model.go:27 — Handlers.writePreviewModelCatalog 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 · Host.setPreviewPort (cyclomatic 25) · ×1
  • Host.setPreviewPort (cyclomatic 25) server/internal/mcp/preview.go:425 — Host.setPreviewPort 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 · models.NextLiveState (cyclomatic 25) · ×1
  • models.NextLiveState (cyclomatic 25) server/internal/models/live.go:390 — models.NextLiveState 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 · SoloService.Create (cyclomatic 25) · ×1
  • SoloService.Create (cyclomatic 25) server/internal/services/solo.go:437 — SoloService.Create 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 · gateShareLink.publicGateContentKey (cyclomatic 25) · ×1
  • gateShareLink.publicGateContentKey (cyclomatic 25) REDACTED:537 — gateShareLink.publicGateContentKey has cyclomatic complexity 25 (threshold 15). 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, 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 · modelRouting.bindingProblem (cyclomatic 25) · ×1
  • modelRouting.bindingProblem (cyclomatic 25) web/src/lib/agent/modelRouting.ts:46 — modelRouting.bindingProblem has cyclomatic complexity 25 (threshold 15). 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: 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 · useClarifyChat.useClarifyChat.restoreUnsentQueued (cyclomatic 25) · ×1
  • useClarifyChat.useClarifyChat.restoreUnsentQueued (cyclomatic 25) web/src/lib/inbox/useClarifyChat.ts:1337 — useClarifyChat.useClarifyChat.restoreUnsentQueued has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 2 function items 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 · htmlPreviewSandbox.isValidInspectPickMessage (cyclomatic 25) · ×1
  • htmlPreviewSandbox.isValidInspectPickMessage (cyclomatic 25) web/src/lib/shared/htmlPreviewSandbox.ts:456 — htmlPreviewSandbox.isValidInspectPickMessage 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 · graphValidation.workflowGraphError (cyclomatic 25) · ×1
  • graphValidation.workflowGraphError (cyclomatic 25) web/src/lib/workflow/graphValidation.ts:27 — graphValidation.workflowGraphError 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 · Driver.PauseSnapshot (cyclomatic 24) · ×1
  • Driver.PauseSnapshot (cyclomatic 24) sandbox-gateway/gateway/internal/driver/e2b/driver.go:803 — Driver.PauseSnapshot 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 · Engine.saveState (cyclomatic 24) · ×1
  • Engine.saveState (cyclomatic 24) server/internal/engine/node_req.go:165 — Engine.saveState 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 · Engine.reconcileInterrupted (cyclomatic 24) · ×1
  • Engine.reconcileInterrupted (cyclomatic 24) server/internal/engine/reattach.go:37 — Engine.reconcileInterrupted 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 · Engine.executeReviewTurn (cyclomatic 24) · ×1
  • Engine.executeReviewTurn (cyclomatic 24) server/internal/engine/review_session.go:884 — Engine.executeReviewTurn 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 · Engine.startRun (cyclomatic 24) · ×1
  • Engine.startRun (cyclomatic 24) server/internal/engine/start_run.go:126 — Engine.startRun has cyclomatic complexity 24 (threshold 15). Of this number, 21 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 · Handlers.ManageAppPreviewShare (cyclomatic 24) · ×1
  • Handlers.ManageAppPreviewShare (cyclomatic 24) server/internal/handlers/app_preview_share.go:27 — Handlers.ManageAppPreviewShare 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 · Handlers.PublicGateCancel (cyclomatic 24) · ×1
  • Handlers.PublicGateCancel (cyclomatic 24) server/internal/handlers/gate_share_public.go:303 — Handlers.PublicGateCancel 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 · models.normalizeGitScopeHost (cyclomatic 24) · ×1
  • models.normalizeGitScopeHost (cyclomatic 24) server/internal/models/git_scope.go:90 — models.normalizeGitScopeHost 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 · acpProvider.spec (cyclomatic 24) · ×1
  • acpProvider.spec (cyclomatic 24) server/internal/runtime/acp_sandbox.go:477 — acpProvider.spec 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 · services.parseZipAgent (cyclomatic 24) · ×1
  • services.parseZipAgent (cyclomatic 24) server/internal/services/agent_zip.go:141 — services.parseZipAgent 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 · SandboxService.RetryRecoveryCleanup (cyclomatic 24) · ×1
  • SandboxService.RetryRecoveryCleanup (cyclomatic 24) server/internal/services/sandbox_recovery.go:442 — SandboxService.RetryRecoveryCleanup 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 · SandboxService.ensureConnected (cyclomatic 24) · ×1
  • SandboxService.ensureConnected (cyclomatic 24) server/internal/services/sandbox_studio.go:486 — SandboxService.ensureConnected 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 · SandboxService.ReconcileOnStartup (cyclomatic 24) · ×1
  • SandboxService.ReconcileOnStartup (cyclomatic 24) server/internal/services/sandbox_studio.go:754 — SandboxService.ReconcileOnStartup 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 · SoloService.buildTurnInput (cyclomatic 24) · ×1
  • SoloService.buildTurnInput (cyclomatic 24) server/internal/services/solo_turn.go:259 — SoloService.buildTurnInput 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 · mock-agent-model.decide (cyclomatic 24) · ×1
  • mock-agent-model.decide (cyclomatic 24) sandbox-gateway/scripts/mock-agent-model.mjs:277 — mock-agent-model.decide has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent 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 · useGateApproval.useGateApproval.loadOneProductContent (cyclomatic 24) · ×1
  • useGateApproval.useGateApproval.loadOneProductContent (cyclomatic 24) web/src/lib/inbox/useGateApproval.ts:818 — useGateApproval.useGateApproval.loadOneProductContent 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 · useRunDetail.useRunDetail.readRunData (cyclomatic 24) · ×1
  • useRunDetail.useRunDetail.readRunData (cyclomatic 24) web/src/lib/run/useRunDetail.ts:489 — useRunDetail.useRunDetail.readRunData has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function item 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 · useRunLive.useRunLive.loadOnce (cyclomatic 24) · ×1
  • useRunLive.useRunLive.loadOnce (cyclomatic 24) web/src/lib/run/useRunLive.ts:430 — useRunLive.useRunLive.loadOnce has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function item 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 · useSoloChat.useSoloChat.historyCoversLive (cyclomatic 24) · ×1
  • useSoloChat.useSoloChat.historyCoversLive (cyclomatic 24) web/src/lib/solo/useSoloChat.ts:302 — useSoloChat.useSoloChat.historyCoversLive has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 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 · overlay.createOverlay.onKeydown (cyclomatic 24) · ×1
  • overlay.createOverlay.onKeydown (cyclomatic 24) web/src/liveoverlay/overlay.ts:909 — overlay.createOverlay.onKeydown 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 · Driver.refresh (cyclomatic 23) · ×1
  • Driver.refresh (cyclomatic 23) sandbox-gateway/gateway/internal/driver/e2b/driver.go:647 — Driver.refresh 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 · Engine.reactReplyLiveCtx (cyclomatic 23) · ×1
  • Engine.reactReplyLiveCtx (cyclomatic 23) server/internal/engine/live.go:330 — Engine.reactReplyLiveCtx 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 · Engine.resumeGateLocked (cyclomatic 23) · ×1
  • Engine.resumeGateLocked (cyclomatic 23) server/internal/engine/resume.go:86 — Engine.resumeGateLocked 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 · structured.RenderTestResultMarkdown (cyclomatic 23) · ×1
  • structured.RenderTestResultMarkdown (cyclomatic 23) server/internal/mcp/structured/doc.go:989 — structured.RenderTestResultMarkdown 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 · models.NormalizeLiveMarks (cyclomatic 23) · ×1
  • models.NormalizeLiveMarks (cyclomatic 23) server/internal/models/live.go:604 — models.NormalizeLiveMarks 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 · services.currentCredential (cyclomatic 23) · ×1
  • services.currentCredential (cyclomatic 23) server/internal/services/credential_domain.go:20 — services.currentCredential has cyclomatic complexity 23 (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 · OnboardingService.Bootstrap (cyclomatic 23) · ×1
  • OnboardingService.Bootstrap (cyclomatic 23) server/internal/services/onboarding.go:269 — OnboardingService.Bootstrap 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 · SettingsService.UpdateWithBrand (cyclomatic 23) · ×1
  • SettingsService.UpdateWithBrand (cyclomatic 23) server/internal/services/settings.go:158 — SettingsService.UpdateWithBrand has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 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 · Handler.stream (cyclomatic 23) · ×1
  • Handler.stream (cyclomatic 23) sandbox-gateway/gateway/internal/driver/e2b/relay.py:215 — Handler.stream 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 · home.playParallel (cyclomatic 23) · ×1
  • home.playParallel (cyclomatic 23) docs/site/js/home.js:579 — home.playParallel 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 · clarifyDraftStash.sweepClarifyStash (cyclomatic 23) · ×1
  • clarifyDraftStash.sweepClarifyStash (cyclomatic 23) web/src/lib/inbox/clarifyDraftStash.ts:133 — clarifyDraftStash.sweepClarifyStash 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 · useGateApproval.useGateApproval.editReactQueuedItem (cyclomatic 23) · ×1
  • useGateApproval.useGateApproval.editReactQueuedItem (cyclomatic 23) web/src/lib/inbox/useGateApproval.ts:1388 — useGateApproval.useGateApproval.editReactQueuedItem 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 · acpTurn.toolDetail (cyclomatic 23) · ×1
  • acpTurn.toolDetail (cyclomatic 23) web/src/lib/solo/acpTurn.ts:62 — acpTurn.toolDetail has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 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 · SandboxService.StartPrepared (cyclomatic 22) · ×1
  • SandboxService.StartPrepared (cyclomatic 22) sandbox-gateway/gateway/internal/service/recovery.go:136 — SandboxService.StartPrepared has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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 · Engine.SaveRunArtifact (cyclomatic 22) · ×1
  • Engine.SaveRunArtifact (cyclomatic 22) server/internal/engine/run_artifact.go:114 — Engine.SaveRunArtifact 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 · gateshare.applyPreviewArtifacts (cyclomatic 22) · ×1
  • gateshare.applyPreviewArtifacts (cyclomatic 22) server/internal/gateshare/preview.go:194 — gateshare.applyPreviewArtifacts 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 · Handlers.PreviewProxy (cyclomatic 22) · ×1
  • Handlers.PreviewProxy (cyclomatic 22) server/internal/handlers/preview.go:62 — Handlers.PreviewProxy 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, separate the cases: extract each independent 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 · acpProvider.ReviseInPlace (cyclomatic 22) · ×1
  • acpProvider.ReviseInPlace (cyclomatic 22) server/internal/runtime/acp_react.go:308 — acpProvider.ReviseInPlace has cyclomatic complexity 22 (threshold 15). Of this number, 18 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 · WorkflowService.SaveAs (cyclomatic 22) · ×1
  • WorkflowService.SaveAs (cyclomatic 22) server/internal/services/workflow.go:224 — WorkflowService.SaveAs 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 · useGatesInbox.useGatesInbox.loadList (cyclomatic 22) · ×1
  • useGatesInbox.useGatesInbox.loadList (cyclomatic 22) web/src/lib/inbox/useGatesInbox.ts:1714 — useGatesInbox.useGatesInbox.loadList has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 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 · llmTranscript.buildLlmTranscript (cyclomatic 22) · ×1
  • llmTranscript.buildLlmTranscript (cyclomatic 22) web/src/lib/run/llmTranscript.ts:328 — llmTranscript.buildLlmTranscript has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 3 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 · overlay.createOverlay.renderPanel (cyclomatic 22) · ×1
  • overlay.createOverlay.renderPanel (cyclomatic 22) web/src/liveoverlay/overlay.ts:468 — overlay.createOverlay.renderPanel has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 3 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 · config.Load (cyclomatic 21) · ×1
  • config.Load (cyclomatic 21) sandbox-gateway/gateway/internal/config/config.go:62 — config.Load 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 · Engine.fireClarifyFirstMessage (cyclomatic 21) · ×1
  • Engine.fireClarifyFirstMessage (cyclomatic 21) server/internal/engine/clarify_first_message.go:86 — Engine.fireClarifyFirstMessage has cyclomatic complexity 21 (threshold 15). Of this number, 14 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 · Handlers.serveSandboxUpstream (cyclomatic 21) · ×1
  • Handlers.serveSandboxUpstream (cyclomatic 21) REDACTED:451 — Handlers.serveSandboxUpstream has cyclomatic complexity 21 (threshold 15). Of this number, 16 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 · Handlers.handleRunWSControl (cyclomatic 21) · ×1
  • Handlers.handleRunWSControl (cyclomatic 21) server/internal/handlers/ws.go:138 — Handlers.handleRunWSControl has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent 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 · runtime.renderRecoveryTranscript (cyclomatic 21) · ×1
  • runtime.renderRecoveryTranscript (cyclomatic 21) server/internal/runtime/acp_react.go:801 — runtime.renderRecoveryTranscript 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 · SandboxService.startContainer (cyclomatic 21) · ×1
  • SandboxService.startContainer (cyclomatic 21) server/internal/services/sandbox_studio.go:164 — SandboxService.startContainer has cyclomatic complexity 21 (threshold 15). 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: 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 · SandboxService.IDEUpstream (cyclomatic 21) · ×1
  • SandboxService.IDEUpstream (cyclomatic 21) server/internal/services/sandbox_view.go:171 — SandboxService.IDEUpstream 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 · SoloService.view (cyclomatic 21) · ×1
  • SoloService.view (cyclomatic 21) server/internal/services/solo.go:319 — SoloService.view 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 · mock-agent-model.pagedHistoryAction (cyclomatic 21) · ×1
  • mock-agent-model.pagedHistoryAction (cyclomatic 21) sandbox-gateway/scripts/mock-agent-model.mjs:245 — mock-agent-model.pagedHistoryAction has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent 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 · modelCapabilities.mergeModelMetadata (cyclomatic 21) · ×1
  • modelCapabilities.mergeModelMetadata (cyclomatic 21) web/src/lib/agent/modelCapabilities.ts:14 — modelCapabilities.mergeModelMetadata 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 · useClarifyChat.useClarifyChat.mergeIntoComposer (cyclomatic 21) · ×1
  • useClarifyChat.useClarifyChat.mergeIntoComposer (cyclomatic 21) web/src/lib/inbox/useClarifyChat.ts:1162 — useClarifyChat.useClarifyChat.mergeIntoComposer has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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 · useGatesInbox.useGatesInbox.fillFollowFromNodeEvents (cyclomatic 21) · ×1
  • useGatesInbox.useGatesInbox.fillFollowFromNodeEvents (cyclomatic 21) web/src/lib/inbox/useGatesInbox.ts:698 — useGatesInbox.useGatesInbox.fillFollowFromNodeEvents 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 · useSoloChat.useSoloChat.saveModelSetting.request (cyclomatic 21) · ×1
  • useSoloChat.useSoloChat.saveModelSetting.request (cyclomatic 21) web/src/lib/solo/useSoloChat.ts:1006 — useSoloChat.useSoloChat.saveModelSetting.request 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 · useSoloLauncher.useSoloLauncher.start (cyclomatic 21) · ×1
  • useSoloLauncher.useSoloLauncher.start (cyclomatic 21) web/src/lib/solo/useSoloLauncher.ts:167 — useSoloLauncher.useSoloLauncher.start 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 · api.relayTunnel (cyclomatic 20) · ×1
  • api.relayTunnel (cyclomatic 20) REDACTED:131 — api.relayTunnel has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 163, 141). 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 · Client.StartDetached (cyclomatic 20) · ×1
  • Client.StartDetached (cyclomatic 20) sandbox-gateway/gateway/internal/driver/e2b/envd.go:95 — Client.StartDetached 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 · Driver.Start (cyclomatic 20) · ×1
  • Driver.Start (cyclomatic 20) sandbox-gateway/gateway/internal/driver/e2b/driver.go:902 — Driver.Start 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 · Driver.captureRecoveryPoint (cyclomatic 20) · ×1
  • Driver.captureRecoveryPoint (cyclomatic 20) sandbox-gateway/gateway/internal/driver/e2b/snapshot.go:109 — Driver.captureRecoveryPoint 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 · Handlers.runPreviewMainStream (cyclomatic 20) · ×1
  • Handlers.runPreviewMainStream (cyclomatic 20) server/internal/handlers/app_preview_stream.go:192 — Handlers.runPreviewMainStream has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 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 · Handlers.serveDesktopVNC (cyclomatic 20) · ×1
  • Handlers.serveDesktopVNC (cyclomatic 20) REDACTED:89 — Handlers.serveDesktopVNC has cyclomatic complexity 20 (threshold 15). Of this number, 11 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 · services.resolveGlobalWindow (cyclomatic 20) · ×1
  • services.resolveGlobalWindow (cyclomatic 20) server/internal/services/global_token_stats.go:382 — services.resolveGlobalWindow 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 · CodexDeviceFlowService.Poll (cyclomatic 20) · ×1
  • CodexDeviceFlowService.Poll (cyclomatic 20) server/internal/services/codex_device_flow.go:166 — CodexDeviceFlowService.Poll 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 · githubRefClient.get (cyclomatic 20) · ×1
  • githubRefClient.get (cyclomatic 20) server/internal/services/solo_reference_github.go:297 — githubRefClient.get 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 · WorkspaceService.TokenUsageEvents (cyclomatic 20) · ×1
  • WorkspaceService.TokenUsageEvents (cyclomatic 20) server/internal/services/token_usage_events_query.go:57 — WorkspaceService.TokenUsageEvents 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 · useGatesInbox.useGatesInbox.onFollowAcp (cyclomatic 20) · ×1
  • useGatesInbox.useGatesInbox.onFollowAcp (cyclomatic 20) web/src/lib/inbox/useGatesInbox.ts:673 — useGatesInbox.useGatesInbox.onFollowAcp has cyclomatic complexity 20 (threshold 15). 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, 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 · useGatesInbox.useGatesInbox.followStep (cyclomatic 20) · ×1
  • useGatesInbox.useGatesInbox.followStep (cyclomatic 20) web/src/lib/inbox/useGatesInbox.ts:865 — useGatesInbox.useGatesInbox.followStep 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 · useSoloChat.useSoloChat.beginTurn (cyclomatic 20) · ×1
  • useSoloChat.useSoloChat.beginTurn (cyclomatic 20) web/src/lib/solo/useSoloChat.ts:439 — useSoloChat.useSoloChat.beginTurn 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 · useSoloChat.useSoloChat.saveModelSetting (cyclomatic 20) · ×1
  • useSoloChat.useSoloChat.saveModelSetting (cyclomatic 20) web/src/lib/solo/useSoloChat.ts:988 — useSoloChat.useSoloChat.saveModelSetting has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function items 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 · gitCredentials.validGitScope (cyclomatic 20) · ×1
  • gitCredentials.validGitScope (cyclomatic 20) web/src/lib/workspace/gitCredentials.ts:49 — gitCredentials.validGitScope 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 · overlay.createOverlay.layout (cyclomatic 20) · ×1
  • overlay.createOverlay.layout (cyclomatic 20) web/src/liveoverlay/overlay.ts:731 — overlay.createOverlay.layout has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 2 function items 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 · Driver.Create (cyclomatic 19) · ×1
  • Driver.Create (cyclomatic 19) sandbox-gateway/gateway/internal/driver/docker/docker.go:105 — Driver.Create 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 · Engine.executeVisitorTurn (cyclomatic 19) · ×1
  • Engine.executeVisitorTurn (cyclomatic 19) server/internal/engine/visitor_lane.go:334 — Engine.executeVisitorTurn 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 · parser.parseCall (cyclomatic 19) · ×1
  • parser.parseCall (cyclomatic 19) server/internal/engine/guard.go:274 — parser.parseCall 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 · handlers.readPreviewGuestRequests (cyclomatic 19) · ×1
  • handlers.readPreviewGuestRequests (cyclomatic 19) REDACTED:235 — handlers.readPreviewGuestRequests 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 · handlers.writePreviewGuestTurn (cyclomatic 19) · ×1
  • handlers.writePreviewGuestTurn (cyclomatic 19) REDACTED:294 — handlers.writePreviewGuestTurn has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 309). 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 · Handlers.RunEvents (cyclomatic 19) · ×1
  • Handlers.RunEvents (cyclomatic 19) server/internal/handlers/ws.go:59 — Handlers.RunEvents has cyclomatic complexity 19 (threshold 15). 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, separate the cases: extract each independent 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 · mcp.pageCommand (cyclomatic 19) · ×1
  • mcp.pageCommand (cyclomatic 19) REDACTED:77 — mcp.pageCommand has cyclomatic complexity 19 (threshold 15). 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, separate the cases: extract each independent 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 · modelrouting.ValidateConfigurationReference (cyclomatic 19) · ×1
  • modelrouting.ValidateConfigurationReference (cyclomatic 19) server/internal/modelrouting/configuration_reference.go:10 — modelrouting.ValidateConfigurationReference 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 · models.NormalizeGitCredentialHost (cyclomatic 19) · ×1
  • models.NormalizeGitCredentialHost (cyclomatic 19) server/internal/models/git_credential_host.go:13 — models.NormalizeGitCredentialHost 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 · acpProvider.AbortRun (cyclomatic 19) · ×1
  • acpProvider.AbortRun (cyclomatic 19) REDACTED:444 — acpProvider.AbortRun 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 · services.ClarifySlimNodeIDs (cyclomatic 19) · ×1
  • services.ClarifySlimNodeIDs (cyclomatic 19) server/internal/services/inbox_context.go:135 — services.ClarifySlimNodeIDs has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 162, 138). 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 · GitHubDeviceFlowService.Poll (cyclomatic 19) · ×1
  • GitHubDeviceFlowService.Poll (cyclomatic 19) server/internal/services/github_device_flow.go:225 — GitHubDeviceFlowService.Poll 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 · soloChat.waitSandbox (cyclomatic 19) · ×1
  • soloChat.waitSandbox (cyclomatic 19) server/internal/services/solo_turn.go:73 — soloChat.waitSandbox 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 · home.runHeroFlow (cyclomatic 19) · ×1
  • home.runHeroFlow (cyclomatic 19) docs/site/js/home.js:179 — home.runHeroFlow has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 4 function items 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 · home.renderApproveList (cyclomatic 19) · ×1
  • home.renderApproveList (cyclomatic 19) docs/site/js/home.js:799 — home.renderApproveList has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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 · mock-chat-model.handle (cyclomatic 19) · ×1
  • mock-chat-model.handle (cyclomatic 19) sandbox-gateway/scripts/mock-chat-model.mjs:141 — mock-chat-model.handle has cyclomatic complexity 19 (threshold 15). Of this number, 10 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 · reactArtifactPreview.restoreStageOpenState (cyclomatic 19) · ×1
  • reactArtifactPreview.restoreStageOpenState (cyclomatic 19) web/src/lib/run/reactArtifactPreview.ts:794 — reactArtifactPreview.restoreStageOpenState 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 · useAgentFilesPanel.useAgentFilesPanel.onCtxAction (cyclomatic 19) · ×1
  • useAgentFilesPanel.useAgentFilesPanel.onCtxAction (cyclomatic 19) web/src/lib/agent/useAgentFilesPanel.ts:167 — useAgentFilesPanel.useAgentFilesPanel.onCtxAction 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 · inboxStartingCards.isClarifyStillStarting (cyclomatic 19) · ×1
  • inboxStartingCards.isClarifyStillStarting (cyclomatic 19) web/src/lib/inbox/inboxStartingCards.ts:100 — inboxStartingCards.isClarifyStillStarting 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 · useClarifyChat.useClarifyChat.sendFromComposer (cyclomatic 19) · ×1
  • useClarifyChat.useClarifyChat.sendFromComposer (cyclomatic 19) web/src/lib/inbox/useClarifyChat.ts:841 — useClarifyChat.useClarifyChat.sendFromComposer has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item 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 · busySeedRetry.runBusySeedRetry (cyclomatic 19) · ×1
  • busySeedRetry.runBusySeedRetry (cyclomatic 19) web/src/lib/run/busySeedRetry.ts:35 — busySeedRetry.runBusySeedRetry has cyclomatic complexity 19 (threshold 15). 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, separate the cases: extract each independent 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 · llmTranscript.applyReplyEvent (cyclomatic 19) · ×1
  • llmTranscript.applyReplyEvent (cyclomatic 19) web/src/lib/run/llmTranscript.ts:115 — llmTranscript.applyReplyEvent 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 · useRunBoard.useRunBoard.load (cyclomatic 19) · ×1
  • useRunBoard.useRunBoard.load (cyclomatic 19) web/src/lib/run/useRunBoard.ts:139 — useRunBoard.useRunBoard.load has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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 · highlightJson.highlightJson (cyclomatic 19) · ×1
  • highlightJson.highlightJson (cyclomatic 19) web/src/lib/shared/highlightJson.ts:15 — highlightJson.highlightJson has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item 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 · overlay.createOverlay.checkMounts (cyclomatic 19) · ×1
  • overlay.createOverlay.checkMounts (cyclomatic 19) web/src/liveoverlay/overlay.ts:335 — overlay.createOverlay.checkMounts 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 · config.applyEnv (cyclomatic 18) · ×1
  • config.applyEnv (cyclomatic 18) sandbox-gateway/gateway/internal/config/env.go:12 — config.applyEnv 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 · ResourceDefaults.Resolve (cyclomatic 18) · ×1
  • ResourceDefaults.Resolve (cyclomatic 18) sandbox-gateway/gateway/internal/config/resources.go:19 — ResourceDefaults.Resolve 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 · Driver.cleanupSnapshots (cyclomatic 18) · ×1
  • Driver.cleanupSnapshots (cyclomatic 18) sandbox-gateway/gateway/internal/driver/e2b/snapshot.go:194 — Driver.cleanupSnapshots 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 · Driver.List (cyclomatic 18) · ×1
  • Driver.List (cyclomatic 18) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:834 — Driver.List has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 851). 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 · SandboxService.PublishPort (cyclomatic 18) · ×1
  • SandboxService.PublishPort (cyclomatic 18) sandbox-gateway/gateway/internal/service/service.go:558 — SandboxService.PublishPort 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 · config.validateSoloBackup (cyclomatic 18) · ×1
  • config.validateSoloBackup (cyclomatic 18) server/internal/config/config.go:873 — config.validateSoloBackup 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 · Engine.SaveGateArtifact (cyclomatic 18) · ×1
  • Engine.SaveGateArtifact (cyclomatic 18) server/internal/engine/gate_artifact.go:59 — Engine.SaveGateArtifact 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 · Engine.pendingTransitionTarget (cyclomatic 18) · ×1
  • Engine.pendingTransitionTarget (cyclomatic 18) server/internal/engine/reattach.go:162 — Engine.pendingTransitionTarget 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 · Engine.sweepVisitorLanes (cyclomatic 18) · ×1
  • Engine.sweepVisitorLanes (cyclomatic 18) server/internal/engine/visitor_lane.go:261 — Engine.sweepVisitorLanes 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 · plugin.Initialize (cyclomatic 18) · ×1
  • plugin.Initialize (cyclomatic 18) server/internal/filestore/serializer.go:37 — plugin.Initialize has cyclomatic complexity 18 (threshold 15). 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 53). 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 · gateshare.SanitizeStructured (cyclomatic 18) · ×1
  • gateshare.SanitizeStructured (cyclomatic 18) server/internal/gateshare/sanitize.go:150 — gateshare.SanitizeStructured 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 · previewMainSnapshot.withLive (cyclomatic 18) · ×1
  • previewMainSnapshot.withLive (cyclomatic 18) server/internal/handlers/app_preview_stream.go:60 — previewMainSnapshot.withLive 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 · Handlers.PublicEmbedTicket (cyclomatic 18) · ×1
  • Handlers.PublicEmbedTicket (cyclomatic 18) server/internal/handlers/embed.go:134 — Handlers.PublicEmbedTicket 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 · Handlers.publicReviewDecide (cyclomatic 18) · ×1
  • Handlers.publicReviewDecide (cyclomatic 18) server/internal/handlers/gate_share_public.go:670 — Handlers.publicReviewDecide 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 · Host.ExecutionDetail (cyclomatic 18) · ×1
  • Host.ExecutionDetail (cyclomatic 18) server/internal/mcp/history.go:280 — Host.ExecutionDetail 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 · Host.listedTools (cyclomatic 18) · ×1
  • Host.listedTools (cyclomatic 18) server/internal/mcp/outcome.go:257 — Host.listedTools 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 · Host.readReference (cyclomatic 18) · ×1
  • Host.readReference (cyclomatic 18) server/internal/mcp/reference.go:34 — Host.readReference 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 · structured.RenderRootCauseMarkdown (cyclomatic 18) · ×1
  • structured.RenderRootCauseMarkdown (cyclomatic 18) server/internal/mcp/structured/root_cause.go:235 — structured.RenderRootCauseMarkdown 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 · services.conversationTools (cyclomatic 18) · ×1
  • services.conversationTools (cyclomatic 18) server/internal/services/conversation_history.go:285 — services.conversationTools 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 · SharedAgentService.Save (cyclomatic 18) · ×1
  • SharedAgentService.Save (cyclomatic 18) server/internal/services/shared_agent.go:104 — SharedAgentService.Save 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 · prepare-template.validate (cyclomatic 18) · ×1
  • prepare-template.validate (cyclomatic 18) sandbox-gateway/deploy/e2b/prepare-template.py:71 — prepare-template.validate 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 · home.playApproveFullGate (cyclomatic 18) · ×1
  • home.playApproveFullGate (cyclomatic 18) docs/site/js/home.js:978 — home.playApproveFullGate 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 · mock-agent-model.historyPage · ×1
  • mock-agent-model.historyPage::find (cyclomatic 18) sandbox-gateway/scripts/mock-agent-model.mjs:213 — mock-agent-model.historyPage::find 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 · useGateApproval.useGateApproval.buildProductLoadFingerprint (cyclomatic 18) · ×1
  • useGateApproval.useGateApproval.buildProductLoadFingerprint (cyclomatic 18) web/src/lib/inbox/useGateApproval.ts:748 — useGateApproval.useGateApproval.buildProductLoadFingerprint 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: useGateApproval.useGateApproval.sameReactImages (cyclomatic 20) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · useGatesInbox.useGatesInbox.writeFollowParts (cyclomatic 18) · ×1
  • useGatesInbox.useGatesInbox.writeFollowParts (cyclomatic 18) web/src/lib/inbox/useGatesInbox.ts:614 — useGatesInbox.useGatesInbox.writeFollowParts 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, 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 · useGatesInbox.useGatesInbox.takeoverFollow (cyclomatic 18) · ×1
  • useGatesInbox.useGatesInbox.takeoverFollow (cyclomatic 18) web/src/lib/inbox/useGatesInbox.ts:987 — useGatesInbox.useGatesInbox.takeoverFollow 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 · useReviewTextSelection.analyzeSelection (cyclomatic 18) · ×1
  • useReviewTextSelection.analyzeSelection (cyclomatic 18) web/src/lib/inbox/useReviewTextSelection.ts:42 — useReviewTextSelection.analyzeSelection 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 · homeLaunchModel.resolveHomeLaunchModel (cyclomatic 18) · ×1
  • homeLaunchModel.resolveHomeLaunchModel (cyclomatic 18) web/src/lib/run/homeLaunchModel.ts:25 — homeLaunchModel.resolveHomeLaunchModel 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 · tokenUsage.mergeTokenUsageByModel (cyclomatic 18) · ×1
  • tokenUsage.mergeTokenUsageByModel (cyclomatic 18) web/src/lib/run/tokenUsage.ts:273 — tokenUsage.mergeTokenUsageByModel 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 · useArtifactPreview.useArtifactPreview (cyclomatic 18) · ×1
  • useArtifactPreview.useArtifactPreview (cyclomatic 18) web/src/lib/run/useArtifactPreview.ts:73 — useArtifactPreview.useArtifactPreview has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 464, 458, 160, …). 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 · useHomeApproveChat.useHomeApproveChat.send (cyclomatic 18) · ×1
  • useHomeApproveChat.useHomeApproveChat.send (cyclomatic 18) web/src/lib/run/useHomeApproveChat.ts:490 — useHomeApproveChat.useHomeApproveChat.send 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 · useRunDetail.useRunDetail.onGateResolve (cyclomatic 18) · ×1
  • useRunDetail.useRunDetail.onGateResolve (cyclomatic 18) web/src/lib/run/useRunDetail.ts:704 — useRunDetail.useRunDetail.onGateResolve 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 · useRunDetailLiveLog.useRunDetailLiveLog.fetchSandboxLog (cyclomatic 18) · ×1
  • useRunDetailLiveLog.useRunDetailLiveLog.fetchSandboxLog (cyclomatic 18) web/src/lib/run/useRunDetailLiveLog.ts:234 — useRunDetailLiveLog.useRunDetailLiveLog.fetchSandboxLog 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 · acpTurn.applyTool (cyclomatic 18) · ×1
  • acpTurn.applyTool (cyclomatic 18) web/src/lib/solo/acpTurn.ts:90 — acpTurn.applyTool 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 · acpTurn.applyAcp (cyclomatic 18) · ×1
  • acpTurn.applyAcp (cyclomatic 18) web/src/lib/solo/acpTurn.ts:114 — acpTurn.applyAcp 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 · useReferenceSearch.useReferenceSearch.run (cyclomatic 18) · ×1
  • useReferenceSearch.useReferenceSearch.run (cyclomatic 18) web/src/lib/solo/useReferenceSearch.ts:97 — useReferenceSearch.useReferenceSearch.run has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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 · useSoloChat.useSoloChat.applyResumeSnapshot (cyclomatic 18) · ×1
  • useSoloChat.useSoloChat.applyResumeSnapshot (cyclomatic 18) web/src/lib/solo/useSoloChat.ts:178 — useSoloChat.useSoloChat.applyResumeSnapshot 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 · useSoloLauncher.useSoloLauncher (cyclomatic 18) · ×1
  • useSoloLauncher.useSoloLauncher (cyclomatic 18) web/src/lib/solo/useSoloLauncher.ts:27 — useSoloLauncher.useSoloLauncher has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 62, 90, 71, …). 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 · Client.WriteFile (cyclomatic 17) · ×1
  • Client.WriteFile (cyclomatic 17) sandbox-gateway/gateway/internal/driver/e2b/envd.go:42 — Client.WriteFile 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 · TunnelManager.StartMapped (cyclomatic 17) · ×1
  • TunnelManager.StartMapped (cyclomatic 17) sandbox-gateway/gateway/internal/driver/e2b/tunnel.go:191 — TunnelManager.StartMapped has cyclomatic complexity 17 (threshold 15). Of this number, 12 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 · SandboxService.reconcileOne (cyclomatic 17) · ×1
  • SandboxService.reconcileOne (cyclomatic 17) sandbox-gateway/gateway/internal/service/service.go:749 — SandboxService.reconcileOne 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 · main.verifyArtifactIsolation (cyclomatic 17) · ×1
  • main.verifyArtifactIsolation (cyclomatic 17) server/cmd/doctor/main.go:185 — main.verifyArtifactIsolation 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, 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 · Session.pump (cyclomatic 17) · ×1
  • Session.pump (cyclomatic 17) server/internal/chatsession/session.go:516 — Session.pump 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 · engine.encodeBranchesVar (cyclomatic 17) · ×1
  • engine.encodeBranchesVar (cyclomatic 17) server/internal/engine/node_agent.go:278 — engine.encodeBranchesVar 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 · Engine.attachDialogueFiles (cyclomatic 17) · ×1
  • Engine.attachDialogueFiles (cyclomatic 17) server/internal/engine/artifact_delivery.go:52 — Engine.attachDialogueFiles 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 · Engine.ResumeFrom (cyclomatic 17) · ×1
  • Engine.ResumeFrom (cyclomatic 17) server/internal/engine/resume.go:655 — Engine.ResumeFrom 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.put (cyclomatic 17) · ×1
  • Store.put (cyclomatic 17) server/internal/filestore/store.go:148 — Store.put 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 · TicketStore.Issue (cyclomatic 17) · ×1
  • TicketStore.Issue (cyclomatic 17) server/internal/gateshare/preview_ticket.go:48 — TicketStore.Issue has cyclomatic complexity 17 (threshold 15). Of this number, 12 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 · Handlers.PublicAppPreviewMainChat (cyclomatic 17) · ×1
  • Handlers.PublicAppPreviewMainChat (cyclomatic 17) server/internal/handlers/app_preview_share.go:282 — Handlers.PublicAppPreviewMainChat 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 · Handlers.PublicGateQueueRemove (cyclomatic 17) · ×1
  • Handlers.PublicGateQueueRemove (cyclomatic 17) server/internal/handlers/gate_share_public.go:394 — Handlers.PublicGateQueueRemove 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. This shape REPEATS in the file: one other method here (Handlers.PublicGateQueueReorder) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · Handlers.PublicGateQueueReorder (cyclomatic 17) · ×1
  • Handlers.PublicGateQueueReorder (cyclomatic 17) server/internal/handlers/gate_share_public.go:450 — Handlers.PublicGateQueueReorder 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. This shape REPEATS in the file: one other method here (Handlers.PublicGateQueueRemove) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · Handlers.seedPublicDialogue (cyclomatic 17) · ×1
  • Handlers.seedPublicDialogue (cyclomatic 17) REDACTED:157 — Handlers.seedPublicDialogue 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 · Handlers.RunLlmTranscript (cyclomatic 17) · ×1
  • Handlers.RunLlmTranscript (cyclomatic 17) server/internal/handlers/run_llm_transcript.go:81 — Handlers.RunLlmTranscript has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 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 · mcp.PlanCoverageOK (cyclomatic 17) · ×1
  • mcp.PlanCoverageOK (cyclomatic 17) server/internal/mcp/plan_coverage.go:23 — mcp.PlanCoverageOK 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 · models.AsCompositeText (cyclomatic 17) · ×1
  • models.AsCompositeText (cyclomatic 17) server/internal/models/composite.go:46 — models.AsCompositeText 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 · Graph.Validate (cyclomatic 17) · ×1
  • Graph.Validate (cyclomatic 17) server/internal/models/graph.go:286 — Graph.Validate 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 · acpProvider.ensureRootCauseConsistency (cyclomatic 17) · ×1
  • acpProvider.ensureRootCauseConsistency (cyclomatic 17) server/internal/runtime/acp_ensure.go:189 — acpProvider.ensureRootCauseConsistency has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 190). 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 · CodexLoginHub.Recover (cyclomatic 17) · ×1
  • CodexLoginHub.Recover (cyclomatic 17) server/internal/runtime/codex_login_hub.go:289 — CodexLoginHub.Recover 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 · ArtifactService.OpenFile (cyclomatic 17) · ×1
  • ArtifactService.OpenFile (cyclomatic 17) server/internal/services/artifact_file.go:166 — ArtifactService.OpenFile 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 · CodexLoginManager.renewOnce (cyclomatic 17) · ×1
  • CodexLoginManager.renewOnce (cyclomatic 17) server/internal/services/codex_login_manager.go:450 — CodexLoginManager.renewOnce 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 · NotificationService.ListPage (cyclomatic 17) · ×1
  • NotificationService.ListPage (cyclomatic 17) server/internal/services/notifications.go:72 — NotificationService.ListPage 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 · SandboxService.prepareRunRecoveryInputs (cyclomatic 17) · ×1
  • SandboxService.prepareRunRecoveryInputs (cyclomatic 17) server/internal/services/sandbox_recovery_inputs.go:66 — SandboxService.prepareRunRecoveryInputs 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 · SandboxService.acpConnection (cyclomatic 17) · ×1
  • SandboxService.acpConnection (cyclomatic 17) server/internal/services/sandbox_view.go:28 — SandboxService.acpConnection 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 · SoloService.restoreSessionLocked (cyclomatic 17) · ×1
  • SoloService.restoreSessionLocked (cyclomatic 17) server/internal/services/solo_queue.go:175 — SoloService.restoreSessionLocked 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 · tokenledger.Rows (cyclomatic 17) · ×1
  • tokenledger.Rows (cyclomatic 17) server/internal/tokenledger/ledger.go:44 — tokenledger.Rows 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 · Recorder.Flush (cyclomatic 17) · ×1
  • Recorder.Flush (cyclomatic 17) server/internal/tokenledger/recorder.go:137 — Recorder.Flush 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 · sidebarHandoff.noteSidebarHandoffOutcome (cyclomatic 17) · ×1
  • sidebarHandoff.noteSidebarHandoffOutcome (cyclomatic 17) web/src/lib/inbox/sidebarHandoff.ts:165 — sidebarHandoff.noteSidebarHandoffOutcome 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 · useCanvasEditor.useCanvasEditor.addNode (cyclomatic 17) · ×1
  • useCanvasEditor.useCanvasEditor.addNode (cyclomatic 17) web/src/components/canvas/composables/useCanvasEditor.ts:115 — useCanvasEditor.useCanvasEditor.addNode 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 · useGatesInbox.useGatesInbox.onResolve (cyclomatic 17) · ×1
  • useGatesInbox.useGatesInbox.onResolve (cyclomatic 17) web/src/lib/inbox/useGatesInbox.ts:3154 — useGatesInbox.useGatesInbox.onResolve 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 · useArtifactEditor.useArtifactEditor.save (cyclomatic 17) · ×1
  • useArtifactEditor.useArtifactEditor.save (cyclomatic 17) web/src/lib/run/useArtifactEditor.ts:187 — useArtifactEditor.useArtifactEditor.save 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 · configuredModels.boundModelChoices (cyclomatic 17) · ×1
  • configuredModels.boundModelChoices (cyclomatic 17) web/src/lib/solo/configuredModels.ts:25 — configuredModels.boundModelChoices has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 36, 48, 37, …). 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 · gitCredentials.validScopeHost (cyclomatic 17) · ×1
  • gitCredentials.validScopeHost (cyclomatic 17) web/src/lib/workspace/gitCredentials.ts:30 — gitCredentials.validScopeHost 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 · e2b.validateCredentials (cyclomatic 16) · ×1
  • e2b.validateCredentials (cyclomatic 16) sandbox-gateway/gateway/internal/driver/e2b/client.go:200 — e2b.validateCredentials 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 · SandboxService.Create (cyclomatic 16) · ×1
  • SandboxService.Create (cyclomatic 16) sandbox-gateway/gateway/internal/service/service.go:124 — SandboxService.Create has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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 · SandboxService.Reinstall (cyclomatic 16) · ×1
  • SandboxService.Reinstall (cyclomatic 16) sandbox-gateway/gateway/internal/service/service.go:386 — SandboxService.Reinstall 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, 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 · ServerConfig.FrameAncestorOrigins (cyclomatic 16) · ×1
  • ServerConfig.FrameAncestorOrigins (cyclomatic 16) server/internal/config/config.go:249 — ServerConfig.FrameAncestorOrigins has cyclomatic complexity 16 (threshold 15). 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, 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 · engine.settleLiveState (cyclomatic 16) · ×1
  • engine.settleLiveState (cyclomatic 16) server/internal/engine/live.go:647 — engine.settleLiveState 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 · payloadSerializer.Value (cyclomatic 16) · ×1
  • payloadSerializer.Value (cyclomatic 16) server/internal/filestore/serializer.go:217 — payloadSerializer.Value 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 · handlers.serveOpenedArtifact (cyclomatic 16) · ×1
  • handlers.serveOpenedArtifact (cyclomatic 16) server/internal/handlers/artifact_file.go:51 — handlers.serveOpenedArtifact 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 · Handlers.ReactReply (cyclomatic 16) · ×1
  • Handlers.ReactReply (cyclomatic 16) server/internal/handlers/gate.go:145 — Handlers.ReactReply 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 · Handlers.PublicGateImage (cyclomatic 16) · ×1
  • Handlers.PublicGateImage (cyclomatic 16) server/internal/handlers/gate_share_public_images.go:20 — Handlers.PublicGateImage 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 · Handlers.PublicAppPreviewModel (cyclomatic 16) · ×1
  • Handlers.PublicAppPreviewModel (cyclomatic 16) server/internal/handlers/preview_model.go:172 — Handlers.PublicAppPreviewModel 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 · Handlers.applyVncMsg (cyclomatic 16) · ×1
  • Handlers.applyVncMsg (cyclomatic 16) REDACTED:209 — Handlers.applyVncMsg 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 · Handlers.SandboxTerminal (cyclomatic 16) · ×1
  • Handlers.SandboxTerminal (cyclomatic 16) REDACTED:320 — Handlers.SandboxTerminal has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent 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 · Host.RunHistory (cyclomatic 16) · ×1
  • Host.RunHistory (cyclomatic 16) server/internal/mcp/history.go:144 — Host.RunHistory 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 · Host.serveToolStream (cyclomatic 16) · ×1
  • Host.serveToolStream (cyclomatic 16) server/internal/mcp/http.go:219 — Host.serveToolStream 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, separate the cases: extract each independent 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 · modelrouting.ReasoningEfforts (cyclomatic 16) · ×1
  • modelrouting.ReasoningEfforts (cyclomatic 16) server/internal/modelrouting/reasoning.go:20 — modelrouting.ReasoningEfforts 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 · models.RenderLiveEvent (cyclomatic 16) · ×1
  • models.RenderLiveEvent (cyclomatic 16) server/internal/models/live.go:538 — models.RenderLiveEvent 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 · models.RenderAnnotations (cyclomatic 16) · ×1
  • models.RenderAnnotations (cyclomatic 16) server/internal/models/models.go:729 — models.RenderAnnotations 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 · ArtifactDeliveryService.deliver (cyclomatic 16) · ×1
  • ArtifactDeliveryService.deliver (cyclomatic 16) server/internal/services/artifact_delivery.go:133 — ArtifactDeliveryService.deliver has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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 · ModelConfigurationService.validate (cyclomatic 16) · ×1
  • ModelConfigurationService.validate (cyclomatic 16) server/internal/services/model_configurations.go:108 — ModelConfigurationService.validate 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 · SoloService.contextPreambleChecked (cyclomatic 16) · ×1
  • SoloService.contextPreambleChecked (cyclomatic 16) server/internal/services/conversation_history.go:428 — SoloService.contextPreambleChecked 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 · SoloService.sendSoloTurn (cyclomatic 16) · ×1
  • SoloService.sendSoloTurn (cyclomatic 16) server/internal/services/solo_queue.go:92 — SoloService.sendSoloTurn 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 · agent-ws-check.ws.addEventListener("message") (cyclomatic 16) · ×1
  • agent-ws-check.ws.addEventListener("message") (cyclomatic 16) sandbox-gateway/scripts/agent-ws-check.mjs:33 — agent-ws-check.ws.addEventListener("message") 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 · statsClient.tokenStatsQuery (cyclomatic 16) · ×1
  • statsClient.tokenStatsQuery (cyclomatic 16) web/src/lib/api/clients/statsClient.ts:33 — statsClient.tokenStatsQuery 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 · useRunTerminalNotifications.refresh (cyclomatic 16) · ×1
  • useRunTerminalNotifications.refresh (cyclomatic 16) web/src/lib/run/useRunTerminalNotifications.ts:401 — useRunTerminalNotifications.refresh has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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 · reactArtifactPreview.extractVisualHtmlSummary (cyclomatic 16) · ×1
  • reactArtifactPreview.extractVisualHtmlSummary (cyclomatic 16) web/src/lib/run/reactArtifactPreview.ts:616 — reactArtifactPreview.extractVisualHtmlSummary 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 · edgeHandoffs.collectEdgeHandoffs (cyclomatic 16) · ×1
  • edgeHandoffs.collectEdgeHandoffs (cyclomatic 16) web/src/components/canvas/composables/edgeHandoffs.ts:32 — edgeHandoffs.collectEdgeHandoffs has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · useCommentPins.saveCommentPin (cyclomatic 16) · ×1
  • useCommentPins.saveCommentPin (cyclomatic 16) web/src/lib/inbox/useCommentPins.ts:137 — useCommentPins.saveCommentPin 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 · useGateApproval.useGateApproval.loadProduct (cyclomatic 16) · ×1
  • useGateApproval.useGateApproval.loadProduct (cyclomatic 16) web/src/lib/inbox/useGateApproval.ts:859 — useGateApproval.useGateApproval.loadProduct 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: useGateApproval.useGateApproval.sameReactImages (cyclomatic 20) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · acpUnpack.extractAgentMessageDelta (cyclomatic 16) · ×1
  • acpUnpack.extractAgentMessageDelta (cyclomatic 16) web/src/lib/run/acpUnpack.ts:56 — acpUnpack.extractAgentMessageDelta 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 · artifactEdit.countLeafChanges (cyclomatic 16) · ×1
  • artifactEdit.countLeafChanges (cyclomatic 16) web/src/lib/run/artifactEdit.ts:88 — artifactEdit.countLeafChanges 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 · runLive.decideLive (cyclomatic 16) · ×1
  • runLive.decideLive (cyclomatic 16) web/src/lib/run/runLive.ts:29 — runLive.decideLive 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 · takeoverTimeline.autoPhaseRows (cyclomatic 16) · ×1
  • takeoverTimeline.autoPhaseRows (cyclomatic 16) web/src/lib/run/takeoverTimeline.ts:12 — takeoverTimeline.autoPhaseRows has cyclomatic complexity 16 (threshold 15). Of this number, 11 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 · useRunDetailLiveLog.useRunDetailLiveLog.fetchNodeEvents (cyclomatic 16) · ×1
  • useRunDetailLiveLog.useRunDetailLiveLog.fetchNodeEvents (cyclomatic 16) web/src/lib/run/useRunDetailLiveLog.ts:110 — useRunDetailLiveLog.useRunDetailLiveLog.fetchNodeEvents 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 · agentCapabilities.validateCapabilities (cyclomatic 16) · ×1
  • agentCapabilities.validateCapabilities (cyclomatic 16) web/src/lib/workflow/agentCapabilities.ts:100 — agentCapabilities.validateCapabilities 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 · compositeText.formatVarValue (cyclomatic 16) · ×1
  • compositeText.formatVarValue (cyclomatic 16) web/src/lib/shared/compositeText.ts:77 — compositeText.formatVarValue 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 · previewPickUrl.readPreviewMessage (cyclomatic 16) · ×1
  • previewPickUrl.readPreviewMessage (cyclomatic 16) web/src/lib/shared/previewPickUrl.ts:78 — previewPickUrl.readPreviewMessage 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 · acpTurn.turnsFromMessages (cyclomatic 16) · ×1
  • acpTurn.turnsFromMessages (cyclomatic 16) web/src/lib/solo/acpTurn.ts:161 — acpTurn.turnsFromMessages 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 · useSoloChat.useSoloChat.noteSeq (cyclomatic 16) · ×1
  • useSoloChat.useSoloChat.noteSeq (cyclomatic 16) web/src/lib/solo/useSoloChat.ts:531 — useSoloChat.useSoloChat.noteSeq 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 · overlay.createOverlay.go (cyclomatic 16) · ×1
  • overlay.createOverlay.go (cyclomatic 16) web/src/liveoverlay/overlay.ts:946 — overlay.createOverlay.go has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · useGatesInbox.useGatesInbox.connectActiveRunWs (cognitive 175) · ×1
  • useGatesInbox.useGatesInbox.connectActiveRunWs (cognitive 175) web/src/lib/inbox/useGatesInbox.ts:2352 — useGatesInbox.useGatesInbox.connectActiveRunWs has cognitive complexity 175 (threshold 15). Drivers by points: if/else 57 (113 pts), boolean chains 42, ternaries 6 (20 pts) (nesting depth added 70). Most of this is not in the body itself: 5 of the 175 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 2400, 2460, 2453, …). 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 · useGatesInbox.useGatesInbox.onClarifySend (cognitive 122) · ×1
  • useGatesInbox.useGatesInbox.onClarifySend (cognitive 122) web/src/lib/inbox/useGatesInbox.ts:3322 — useGatesInbox.useGatesInbox.onClarifySend has cognitive complexity 122 (threshold 15). Drivers by points: if/else 45 (92 pts), boolean chains 19, ternaries 6 (8 pts), error handling 2 (3 pts) (nesting depth added 50). Of this number, 119 points are the body's own statements and 3 belong to 2 function items 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 · filestore.Migrate (cognitive 111) · ×1
  • filestore.Migrate (cognitive 111) server/internal/filestore/migration.go:27 — filestore.Migrate has cognitive complexity 111 (threshold 15). Drivers by points: if/else 25 (91 pts), loops 5 (12 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useSoloChat.useSoloChat.onFrame (cognitive 105) · ×1
  • useSoloChat.useSoloChat.onFrame (cognitive 105) web/src/lib/solo/useSoloChat.ts:609 — useSoloChat.useSoloChat.onFrame has cognitive complexity 105 (threshold 15). Drivers by points: if/else 38 (71 pts), boolean chains 25, loops 2 (4 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 37). Of this number, 103 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 · Engine.reactReply (cognitive 99) · ×1
  • Engine.reactReply (cognitive 99) server/internal/engine/resume.go:380 — Engine.reactReply has cognitive complexity 99 (threshold 15). Drivers by points: if/else 40 (91 pts), boolean chains 8 (nesting depth added 51). 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 · structured.RenderClarifiedRequirementMarkdown (cognitive 90) · ×1
  • structured.RenderClarifiedRequirementMarkdown (cognitive 90) server/internal/mcp/structured/doc.go:459 — structured.RenderClarifiedRequirementMarkdown has cognitive complexity 90 (threshold 15). Drivers by points: if/else 30 (64 pts), loops 11 (25 pts), boolean chains 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch 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.RenderPlanMarkdown (cognitive 87) · ×1
  • mcp.RenderPlanMarkdown (cognitive 87) server/internal/mcp/plan.go:669 — mcp.RenderPlanMarkdown has cognitive complexity 87 (threshold 15). Drivers by points: if/else 20 (61 pts), loops 8 (23 pts), boolean chains 3 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handlers.PublicAppPreviewGuestChat (cognitive 82) · ×1
  • Handlers.PublicAppPreviewGuestChat (cognitive 82) REDACTED:93 — Handlers.PublicAppPreviewGuestChat has cognitive complexity 82 (threshold 15). Drivers by points: if/else 25 (71 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 47). Of this number, 80 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 · useGateApproval.useGateApproval.applyReviewFrame (cognitive 75) · ×1
  • useGateApproval.useGateApproval.applyReviewFrame (cognitive 75) web/src/lib/inbox/useGateApproval.ts:1501 — useGateApproval.useGateApproval.applyReviewFrame has cognitive complexity 75 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 19, ternaries 4 (9 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 28). Of this number, 72 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 · Engine.ReactLiveWithAttachmentsAs (cognitive 74) · ×1
  • Engine.ReactLiveWithAttachmentsAs (cognitive 74) server/internal/engine/live.go:132 — Engine.ReactLiveWithAttachmentsAs has cognitive complexity 74 (threshold 15). Drivers by points: if/else 37 (56 pts), boolean chains 13, match/switch 2 (3 pts), loops 1 (2 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 · services.aggregateGlobalRows (cognitive 72) · ×1
  • services.aggregateGlobalRows (cognitive 72) server/internal/services/global_token_stats.go:693 — services.aggregateGlobalRows has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (64 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Driver.cleanup (cognitive 70) · ×1
  • Driver.cleanup (cognitive 70) sandbox-gateway/gateway/internal/driver/e2b/driver.go:967 — Driver.cleanup has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (53 pts), boolean chains 10, loops 3 (7 pts) (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 · overlay.createOverlay (cognitive 70) · ×1
  • overlay.createOverlay (cognitive 70) web/src/liveoverlay/overlay.ts:150 — overlay.createOverlay has cognitive complexity 70 (threshold 15). Drivers by points: if/else 25 (42 pts), boolean chains 16, ternaries 5 (11 pts), match/switch 1 (nesting depth added 23). Most of this is not in the body itself: 4 of the 70 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1132, 1259, 1270, …). 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 · overlay.createOverlay.onDrawer (cognitive 70) · ×1
  • overlay.createOverlay.onDrawer (cognitive 70) web/src/liveoverlay/overlay.ts:1317 — overlay.createOverlay.onDrawer has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 12, ternaries 4 (9 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 33). 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 · useRunDetailWs.useRunDetailWs.connectWs (cognitive 69) · ×1
  • useRunDetailWs.useRunDetailWs.connectWs (cognitive 69) web/src/lib/run/useRunDetailWs.ts:465 — useRunDetailWs.useRunDetailWs.connectWs has cognitive complexity 69 (threshold 15). Drivers by points: if/else 27 (49 pts), boolean chains 14, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 25). Most of this is not in the body itself: 2 of the 69 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 493, 534, 528, …). 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 · CredentialService.updateOnce (cognitive 68) · ×1
  • CredentialService.updateOnce (cognitive 68) server/internal/services/workspace_credentials.go:356 — CredentialService.updateOnce has cognitive complexity 68 (threshold 15). Drivers by points: if/else 41 (59 pts), boolean chains 9 (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 · mock-agent-model.resolveAction (cognitive 67) · ×1
  • mock-agent-model.resolveAction (cognitive 67) sandbox-gateway/scripts/mock-agent-model.mjs:163 — mock-agent-model.resolveAction has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (36 pts), ternaries 5 (15 pts), boolean chains 12, loops 2 (4 pts) (nesting depth added 30). Of this number, 66 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · useClarifyChat.useClarifyChat (cognitive 67) · ×1
  • useClarifyChat.useClarifyChat (cognitive 67) web/src/lib/inbox/useClarifyChat.ts:122 — useClarifyChat.useClarifyChat has cognitive complexity 67 (threshold 15). Drivers by points: if/else 34 (46 pts), boolean chains 19, loops 2 (nesting depth added 12). None of this is in the body itself: all 67 points belong to 16 function literals inside it that branch (lines 1445, 324, 683, …). 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 · Driver.Create (cognitive 63) · ×1
  • Driver.Create (cognitive 63) sandbox-gateway/gateway/internal/driver/e2b/driver.go:297 — Driver.Create has cognitive complexity 63 (threshold 15). Drivers by points: if/else 36 (48 pts), boolean chains 9, loops 4, match/switch 1 (2 pts) (nesting depth added 13). Of this number, 61 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 · structured.ParseClarifiedRequirement (cognitive 63) · ×1
  • structured.ParseClarifiedRequirement (cognitive 63) server/internal/mcp/structured/doc.go:231 — structured.ParseClarifiedRequirement has cognitive complexity 63 (threshold 15). Drivers by points: if/else 31 (51 pts), loops 9 (10 pts), boolean chains 2 (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 · Engine.executeFrom (cognitive 62) · ×1
  • Engine.executeFrom (cognitive 62) server/internal/engine/execute.go:298 — Engine.executeFrom has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (51 pts), boolean chains 6, match/switch 2 (4 pts), loops 1 (nesting depth added 31). Of this number, 61 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 · TunnelManager.forward (cognitive 61) · ×1
  • TunnelManager.forward (cognitive 61) sandbox-gateway/gateway/internal/driver/e2b/tunnel.go:322 — TunnelManager.forward has cognitive complexity 61 (threshold 15). Drivers by points: if/else 27 (53 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 27). Of this number, 46 points are the body's own statements and 15 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 · modelrouting.ValidateBinding (cognitive 61) · ×1
  • modelrouting.ValidateBinding (cognitive 61) server/internal/modelrouting/capabilities.go:69 — modelrouting.ValidateBinding has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (49 pts), boolean chains 7, loops 4 (5 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 · useGatesInbox.useGatesInbox (cognitive 60) · ×1
  • useGatesInbox.useGatesInbox (cognitive 60) web/src/lib/inbox/useGatesInbox.ts:107 — useGatesInbox.useGatesInbox has cognitive complexity 60 (threshold 15). Drivers by points: if/else 28 (29 pts), boolean chains 20, ternaries 11 (nesting depth added 1). None of this is in the body itself: all 60 points belong to 29 function literals inside it that branch (lines 1961, 1987, 1044, …). 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 · main.main (cognitive 59) · ×1
  • main.main (cognitive 59) REDACTED:56 — main.main has cognitive complexity 59 (threshold 15). Drivers by points: if/else 45 (48 pts), boolean chains 9, loops 2 (nesting depth added 3). Of this number, 22 points are the body's own statements and 37 belong to 16 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 · Engine.ResumeGateExternal (cognitive 59) · ×1
  • Engine.ResumeGateExternal (cognitive 59) server/internal/engine/resume_external.go:23 — Engine.ResumeGateExternal has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (46 pts), boolean chains 10, loops 1 (2 pts), 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 · useGraphIssues.collectGraphIssues (cognitive 59) · ×1
  • useGraphIssues.collectGraphIssues (cognitive 59) web/src/components/canvas/composables/useGraphIssues.ts:17 — useGraphIssues.collectGraphIssues has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 9, loops 5 (9 pts), ternaries 1 (nesting depth added 26). Of this number, 58 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · useRunLive.useRunLive.onFrame (cognitive 59) · ×1
  • useRunLive.useRunLive.onFrame (cognitive 59) web/src/lib/run/useRunLive.ts:505 — useRunLive.useRunLive.onFrame has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (43 pts), boolean chains 8, ternaries 3 (8 pts) (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 · Engine.buildOutputCard (cognitive 58) · ×1
  • Engine.buildOutputCard (cognitive 58) server/internal/engine/output.go:159 — Engine.buildOutputCard has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (48 pts), boolean chains 9, match/switch 1 (nesting depth added 28). 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 · mcp.ValidateHumanArtifactContent (cognitive 57) · ×1
  • mcp.ValidateHumanArtifactContent (cognitive 57) server/internal/mcp/human_artifact.go:27 — mcp.ValidateHumanArtifactContent has cognitive complexity 57 (threshold 15). Drivers by points: if/else 26 (53 pts), match/switch 2 (3 pts), boolean chains 1 (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 · LiveEvent.Normalize (cognitive 55) · ×1
  • LiveEvent.Normalize (cognitive 55) server/internal/models/live.go:256 — LiveEvent.Normalize has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 15, loops 1, 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 · services.normalizeCredentialDomainInput (cognitive 55) · ×1
  • services.normalizeCredentialDomainInput (cognitive 55) server/internal/services/credential_domain.go:40 — services.normalizeCredentialDomainInput has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (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 · RunService.CurrentNodes (cognitive 55) · ×1
  • RunService.CurrentNodes (cognitive 55) server/internal/services/run_current.go:88 — RunService.CurrentNodes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (41 pts), boolean chains 6, loops 4, match/switch 2 (4 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 · httpCore.req (cognitive 55) · ×1
  • httpCore.req (cognitive 55) web/src/lib/api/httpCore.ts:81 — httpCore.req has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 10, error handling 2 (5 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 · mock-agent-model.validateScenario (cognitive 54) · ×1
  • mock-agent-model.validateScenario (cognitive 54) sandbox-gateway/scripts/mock-agent-model.mjs:131 — mock-agent-model.validateScenario has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 20, loops 3 (5 pts) (nesting depth added 20). Of this number, 53 points are the body's own statements and 1 belongs to one function item 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 · overlay.createOverlay.renderSwitchers (cognitive 54) · ×1
  • overlay.createOverlay.renderSwitchers (cognitive 54) web/src/liveoverlay/overlay.ts:570 — overlay.createOverlay.renderSwitchers has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 6 (20 pts), boolean chains 18, if/else 6 (11 pts), loops 3 (5 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 · Service.LookupByToken (cognitive 52) · ×1
  • Service.LookupByToken (cognitive 52) server/internal/gateshare/service.go:491 — Service.LookupByToken has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (45 pts), boolean chains 6, match/switch 1 (nesting depth added 24). 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 · acpProvider.ReactReply (cognitive 52) · ×1
  • acpProvider.ReactReply (cognitive 52) server/internal/runtime/acp_react.go:124 — acpProvider.ReactReply has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 6, loops 1 (nesting depth added 16). Of this number, 48 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 · AgentService.ImportWorkspaceAgentsZIP (cognitive 52) · ×1
  • AgentService.ImportWorkspaceAgentsZIP (cognitive 52) server/internal/services/workspace_agents_bundle.go:117 — AgentService.ImportWorkspaceAgentsZIP has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (40 pts), loops 7, match/switch 2 (3 pts), boolean chains 2 (nesting depth added 18). Of this number, 49 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 · ModelConnectionService.DiscoverModels (cognitive 52) · ×1
  • ModelConnectionService.DiscoverModels (cognitive 52) server/internal/services/model_discovery.go:29 — ModelConnectionService.DiscoverModels has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (40 pts), boolean chains 9, 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 · SandboxService.AlignSoloModelRoute (cognitive 52) · ×1
  • SandboxService.AlignSoloModelRoute (cognitive 52) server/internal/services/sandbox_solo_route.go:83 — SandboxService.AlignSoloModelRoute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 38 (45 pts), boolean chains 7 (nesting depth added 7). Of this number, 46 points are the body's own statements and 6 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 · mock-agent-model.normalizeRequest (cognitive 52) · ×1
  • mock-agent-model.normalizeRequest (cognitive 52) sandbox-gateway/scripts/mock-agent-model.mjs:53 — mock-agent-model.normalizeRequest has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 13, ternaries 4 (9 pts), loops 5 (7 pts) (nesting depth added 16). Of this number, 26 points are the body's own statements and 26 belong to 2 function items 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 · Driver.load (cognitive 51) · ×1
  • Driver.load (cognitive 51) sandbox-gateway/gateway/internal/driver/e2b/state.go:94 — Driver.load has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 11, loops 3 (5 pts), match/switch 1 (2 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 · runtime.renderRecoveryTranscript (cognitive 51) · ×1
  • runtime.renderRecoveryTranscript (cognitive 51) server/internal/runtime/acp_react.go:801 — runtime.renderRecoveryTranscript has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 7 (17 pts), boolean chains 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 · artifactForms.pruneObject (cognitive 51) · ×1
  • artifactForms.pruneObject (cognitive 51) web/src/lib/run/artifactForms.ts:405 — artifactForms.pruneObject has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (27 pts), ternaries 4 (13 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 25). Of this number, 47 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 · Handlers.PublicGateEvents (cognitive 48) · ×1
  • Handlers.PublicGateEvents (cognitive 48) REDACTED:34 — Handlers.PublicGateEvents has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 20). Of this number, 45 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 · SandboxService.ensureRunningLocked (cognitive 47) · ×1
  • SandboxService.ensureRunningLocked (cognitive 47) server/internal/services/sandbox_recovery.go:291 — SandboxService.ensureRunningLocked has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 12 (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, 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 · liveVariants.parseMarks (cognitive 47) · ×1
  • liveVariants.parseMarks (cognitive 47) web/src/lib/inbox/liveVariants.ts:135 — liveVariants.parseMarks has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 9, loops 3 (6 pts), ternaries 1 (4 pts) (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 · useRunLive.useRunLive.applyRun (cognitive 47) · ×1
  • useRunLive.useRunLive.applyRun (cognitive 47) web/src/lib/run/useRunLive.ts:305 — useRunLive.useRunLive.applyRun has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 12, ternaries 2 (6 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 · Engine.buildDialogue (cognitive 46) · ×1
  • Engine.buildDialogue (cognitive 46) server/internal/engine/dialogue_state.go:114 — Engine.buildDialogue has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 11, 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 · clarifyDraftStash.sweepClarifyStash (cognitive 46) · ×1
  • clarifyDraftStash.sweepClarifyStash (cognitive 46) web/src/lib/inbox/clarifyDraftStash.ts:133 — clarifyDraftStash.sweepClarifyStash has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (9 pts), boolean chains 7, ternaries 1 (4 pts), error handling 1 (3 pts) (nesting depth added 22). Of this number, 45 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 · useGatesInbox.useGatesInbox.loadActiveRun (cognitive 46) · ×1
  • useGatesInbox.useGatesInbox.loadActiveRun (cognitive 46) web/src/lib/inbox/useGatesInbox.ts:2899 — useGatesInbox.useGatesInbox.loadActiveRun has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 12). Of this number, 44 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 · useRunDetail.useRunDetail.onClarifySend (cognitive 46) · ×1
  • useRunDetail.useRunDetail.onClarifySend (cognitive 46) web/src/lib/run/useRunDetail.ts:737 — useRunDetail.useRunDetail.onClarifySend has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 10, ternaries 4 (7 pts), error handling 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 · Handlers.handleRunWSControl (cognitive 45) · ×1
  • Handlers.handleRunWSControl (cognitive 45) server/internal/handlers/ws.go:138 — Handlers.handleRunWSControl has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 2, match/switch 1 (nesting depth added 24). Of this number, 44 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · ModelConnectionService.Resolve (cognitive 45) · ×1
  • ModelConnectionService.Resolve (cognitive 45) server/internal/services/model_connections.go:175 — ModelConnectionService.Resolve has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 8 (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 · configuredModels.configuredModelChoices (cognitive 45) · ×1
  • configuredModels.configuredModelChoices (cognitive 45) web/src/lib/solo/configuredModels.ts:62 — configuredModels.configuredModelChoices has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 20, ternaries 8 (19 pts), if/else 3 (5 pts), loops 1 (nesting depth added 13). Of this number, 43 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 · Engine.ResumeReviewExternalOpts (cognitive 44) · ×1
  • Engine.ResumeReviewExternalOpts (cognitive 44) server/internal/engine/resume_review_external.go:15 — Engine.ResumeReviewExternalOpts has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 7, 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 · useGatesInbox.useGatesInbox.recoverClarifySession (cognitive 44) · ×1
  • useGatesInbox.useGatesInbox.recoverClarifySession (cognitive 44) web/src/lib/inbox/useGatesInbox.ts:2727 — useGatesInbox.useGatesInbox.recoverClarifySession has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 10, ternaries 3 (4 pts), error handling 1 (nesting depth added 7). Of this number, 42 points are the body's own statements and 2 belong to 3 function items 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 · structured.RenderTestResultMarkdown (cognitive 43) · ×1
  • structured.RenderTestResultMarkdown (cognitive 43) server/internal/mcp/structured/doc.go:989 — structured.RenderTestResultMarkdown has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 4 (8 pts), match/switch 1 (3 pts), boolean chains 1 (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 · models.AsCompositeText (cognitive 43) · ×1
  • models.AsCompositeText (cognitive 43) server/internal/models/composite.go:46 — models.AsCompositeText has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (33 pts), match/switch 2 (6 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 31). 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 · home.playParallel (cognitive 43) · ×1
  • home.playParallel (cognitive 43) docs/site/js/home.js:579 — home.playParallel has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 3 (5 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 · Engine.ApplyLiveReport (cognitive 42) · ×1
  • Engine.ApplyLiveReport (cognitive 42) server/internal/engine/live.go:481 — Engine.ApplyLiveReport has cognitive complexity 42 (threshold 15). Drivers by points: if/else 25 (36 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 · Engine.TakeoverNode (cognitive 42) · ×1
  • Engine.TakeoverNode (cognitive 42) server/internal/engine/takeover.go:132 — Engine.TakeoverNode has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 13, 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 · Handlers.PublicGateDecide (cognitive 42) · ×1
  • Handlers.PublicGateDecide (cognitive 42) server/internal/handlers/gate_share_public.go:531 — Handlers.PublicGateDecide has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 10 (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 · Handlers.PublicPreviewAPIProxy (cognitive 42) · ×1
  • Handlers.PublicPreviewAPIProxy (cognitive 42) server/internal/handlers/gate_share_public_preview.go:191 — Handlers.PublicPreviewAPIProxy has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 13). Of this number, 36 points are the body's own statements and 6 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 · services.dropOnboardingAgentNode (cognitive 42) · ×1
  • services.dropOnboardingAgentNode (cognitive 42) server/internal/services/onboarding.go:477 — services.dropOnboardingAgentNode has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 9, loops 7 (9 pts), match/switch 1 (2 pts) (nesting depth added 15). Of this number, 38 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 · SoloService.view (cognitive 42) · ×1
  • SoloService.view (cognitive 42) server/internal/services/solo.go:319 — SoloService.view has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 4 (nesting depth added 21). 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 · SoloService.alignSessionModel (cognitive 42) · ×1
  • SoloService.alignSessionModel (cognitive 42) server/internal/services/solo_model_settings.go:325 — SoloService.alignSessionModel has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 7 (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 · githubRefClient.Search (cognitive 41) · ×1
  • githubRefClient.Search (cognitive 41) server/internal/services/solo_reference_github.go:411 — githubRefClient.Search has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 2, 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 · useGatesInbox.useGatesInbox.confirmIncomingGhostStillNeeded (cognitive 41) · ×1
  • useGatesInbox.useGatesInbox.confirmIncomingGhostStillNeeded (cognitive 41) web/src/lib/inbox/useGatesInbox.ts:1336 — useGatesInbox.useGatesInbox.confirmIncomingGhostStillNeeded has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 12, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 10). Of this number, 38 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 · llmTranscriptThread.clarifyTurnsFromLlm (cognitive 41) · ×1
  • llmTranscriptThread.clarifyTurnsFromLlm (cognitive 41) web/src/lib/run/llmTranscriptThread.ts:95 — llmTranscriptThread.clarifyTurnsFromLlm has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 18, if/else 6 (11 pts), ternaries 5 (11 pts), loops 1 (nesting depth added 11). Of this number, 20 points are the body's own statements and 21 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 · Driver.cleanupSnapshots (cognitive 40) · ×1
  • Driver.cleanupSnapshots (cognitive 40) sandbox-gateway/gateway/internal/driver/e2b/snapshot.go:194 — Driver.cleanupSnapshots has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (36 pts), boolean chains 3, 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 · config.applyEnvOverrides (cognitive 40) · ×1
  • config.applyEnvOverrides (cognitive 40) server/internal/config/config.go:499 — config.applyEnvOverrides has cognitive complexity 40 (threshold 15). Drivers by points: if/else 38 (39 pts), boolean chains 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 · services.parseZipAgent (cognitive 40) · ×1
  • services.parseZipAgent (cognitive 40) server/internal/services/agent_zip.go:141 — services.parseZipAgent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 3, 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 · api.relayTunnel (cognitive 39) · ×1
  • api.relayTunnel (cognitive 39) REDACTED:131 — api.relayTunnel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (30 pts), jumps 3, loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 18). Most of this is not in the body itself: 12 of the 39 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 163, 141). 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 · Engine.finish (cognitive 39) · ×1
  • Engine.finish (cognitive 39) server/internal/engine/finish.go:146 — Engine.finish has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 8, match/switch 1 (2 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 · Service.AttachInboxStatus (cognitive 39) · ×1
  • Service.AttachInboxStatus (cognitive 39) server/internal/gateshare/service.go:665 — Service.AttachInboxStatus has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5, match/switch 2 (4 pts), boolean chains 3 (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 · Handlers.runDetailDTO (cognitive 39) · ×1
  • Handlers.runDetailDTO (cognitive 39) server/internal/handlers/dto.go:278 — Handlers.runDetailDTO has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (34 pts), loops 4, 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 · useCanvasShortcuts.resolveShortcut (cognitive 39) · ×1
  • useCanvasShortcuts.resolveShortcut (cognitive 39) web/src/components/canvas/composables/useCanvasShortcuts.ts:70 — useCanvasShortcuts.resolveShortcut has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 6, ternaries 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 · config.setDefaults (cognitive 38) · ×1
  • config.setDefaults (cognitive 38) server/internal/config/config.go:619 — config.setDefaults has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34 (36 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, 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 · Handlers.writePreviewModelCatalog (cognitive 38) · ×1
  • Handlers.writePreviewModelCatalog (cognitive 38) server/internal/handlers/preview_model.go:27 — Handlers.writePreviewModelCatalog has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (8 pts), boolean chains 6 (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 · models.RenderAnnotations (cognitive 38) · ×1
  • models.RenderAnnotations (cognitive 38) server/internal/models/models.go:729 — models.RenderAnnotations has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (37 pts), 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 · acpProvider.runAgentOnce (cognitive 38) · ×1
  • acpProvider.runAgentOnce (cognitive 38) REDACTED:74 — acpProvider.runAgentOnce has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 5 (nesting depth added 6). Of this number, 28 points are the body's own statements and 10 belong to 3 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 · AgentService.prepareSave (cognitive 38) · ×1
  • AgentService.prepareSave (cognitive 38) server/internal/services/agent.go:412 — AgentService.prepareSave has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 5, loops 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 · RunService.ConversationChain (cognitive 38) · ×1
  • RunService.ConversationChain (cognitive 38) server/internal/services/conversation_chain.go:161 — RunService.ConversationChain has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, loops 4 (5 pts), match/switch 2 (4 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 · SandboxService.RetryRecoveryCleanup (cognitive 38) · ×1
  • SandboxService.RetryRecoveryCleanup (cognitive 38) server/internal/services/sandbox_recovery.go:442 — SandboxService.RetryRecoveryCleanup has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 6, loops 1 (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 · executor.createExecutor.exec (cognitive 38) · ×1
  • executor.createExecutor.exec (cognitive 38) web/src/pagecontrol/executor.ts:215 — executor.createExecutor.exec has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 7 (15 pts), boolean chains 4, match/switch 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 · soloChat.waitSandbox (cognitive 37) · ×1
  • soloChat.waitSandbox (cognitive 37) server/internal/services/solo_turn.go:73 — soloChat.waitSandbox has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 3 (9 pts), boolean chains 2, loops 1 (nesting depth added 23). 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 · WorkspaceService.GlobalTokenStats (cognitive 37) · ×1
  • WorkspaceService.GlobalTokenStats (cognitive 37) server/internal/services/global_token_stats.go:201 — WorkspaceService.GlobalTokenStats has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (31 pts), loops 3 (4 pts), boolean chains 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 · useFlowElements.useFlowElements.flowEdges (cognitive 37) · ×1
  • useFlowElements.useFlowElements.flowEdges (cognitive 37) web/src/components/canvas/composables/useFlowElements.ts:213 — useFlowElements.useFlowElements.flowEdges has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 12 (23 pts), boolean chains 11, if/else 1 (2 pts), loops 1 (nesting depth added 12). Of this number, 31 points are the body's own statements and 6 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 · graphValidation.workflowGraphError (cognitive 37) · ×1
  • graphValidation.workflowGraphError (cognitive 37) web/src/lib/workflow/graphValidation.ts:27 — graphValidation.workflowGraphError has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 6, loops 4 (5 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 · Engine.executeClarifyTurn (cognitive 36) · ×1
  • Engine.executeClarifyTurn (cognitive 36) server/internal/engine/review_session.go:713 — Engine.executeClarifyTurn has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (26 pts), boolean chains 9, 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, 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 · Handlers.PublicAppPreviewMainEvents (cognitive 36) · ×1
  • Handlers.PublicAppPreviewMainEvents (cognitive 36) REDACTED:19 — Handlers.PublicAppPreviewMainEvents has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 5, match/switch 2 (3 pts), loops 2 (nesting depth added 12). 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 into named stages: move each independent step or branch 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.parseQuestions (cognitive 36) · ×1
  • mcp.parseQuestions (cognitive 36) server/internal/mcp/tools.go:170 — mcp.parseQuestions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 1 (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 · ModelConnectionService.validateConnection (cognitive 36) · ×1
  • ModelConnectionService.validateConnection (cognitive 36) server/internal/services/model_connections.go:94 — ModelConnectionService.validateConnection has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (23 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 · liveVariants.parseEmbedLiveMessage (cognitive 36) · ×1
  • liveVariants.parseEmbedLiveMessage (cognitive 36) web/src/lib/inbox/liveVariants.ts:201 — liveVariants.parseEmbedLiveMessage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 9, ternaries 1 (2 pts) (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 · scan.parseParams (cognitive 36) · ×1
  • scan.parseParams (cognitive 36) web/src/liveoverlay/scan.ts:23 — scan.parseParams has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (2 pts), error handling 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 · Config.validate (cognitive 35) · ×1
  • Config.validate (cognitive 35) sandbox-gateway/gateway/internal/config/validation.go:13 — Config.validate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 8, loops 3 (4 pts), match/switch 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 · Handlers.PublicGateReply (cognitive 35) · ×1
  • Handlers.PublicGateReply (cognitive 35) server/internal/handlers/gate_share_public.go:179 — Handlers.PublicGateReply has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 6 (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 · SandboxService.IDEUpstream (cognitive 35) · ×1
  • SandboxService.IDEUpstream (cognitive 35) server/internal/services/sandbox_view.go:171 — SandboxService.IDEUpstream has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 5 (nesting depth added 16). 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 · Handler.stream (cognitive 35) · ×1
  • Handler.stream (cognitive 35) sandbox-gateway/gateway/internal/driver/e2b/relay.py:215 — Handler.stream has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 5, error handling 2, 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 · mock-agent-model.decide (cognitive 35) · ×1
  • mock-agent-model.decide (cognitive 35) sandbox-gateway/scripts/mock-agent-model.mjs:277 — mock-agent-model.decide has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 7, error handling 2 (5 pts), loops 3 (nesting depth added 13). 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 · config.applyEnv (cognitive 34) · ×1
  • config.applyEnv (cognitive 34) sandbox-gateway/gateway/internal/config/env.go:12 — config.applyEnv has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (31 pts), match/switch 1 (2 pts), 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 · Session.pump (cognitive 34) · ×1
  • Session.pump (cognitive 34) server/internal/chatsession/session.go:516 — Session.pump has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (8 pts), boolean chains 3 (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 · engine.tokenize (cognitive 34) · ×1
  • engine.tokenize (cognitive 34) server/internal/engine/guard.go:90 — engine.tokenize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (10 pts), boolean chains 9, match/switch 1 (2 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 · Handlers.runPreviewMainStream (cognitive 34) · ×1
  • Handlers.runPreviewMainStream (cognitive 34) server/internal/handlers/app_preview_stream.go:192 — Handlers.runPreviewMainStream has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). Of this number, 31 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 · Handlers.PreviewProxy (cognitive 34) · ×1
  • Handlers.PreviewProxy (cognitive 34) server/internal/handlers/preview.go:62 — Handlers.PreviewProxy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 7 (nesting depth added 13). Of this number, 31 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 · mock-agent-model.createMockAgentServer.server (cognitive 34) · ×1
  • mock-agent-model.createMockAgentServer.server (cognitive 34) sandbox-gateway/scripts/mock-agent-model.mjs:426 — mock-agent-model.createMockAgentServer.server has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 5 (9 pts), boolean chains 7, loops 1 (2 pts), error handling 1 (nesting depth added 6). 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 · highlightJson.highlightJson (cognitive 34) · ×1
  • highlightJson.highlightJson (cognitive 34) web/src/lib/shared/highlightJson.ts:15 — highlightJson.highlightJson has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (11 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 17). Of this number, 29 points are the body's own statements and 5 belong to one function item 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 · Driver.PauseSnapshot (cognitive 33) · ×1
  • Driver.PauseSnapshot (cognitive 33) sandbox-gateway/gateway/internal/driver/e2b/driver.go:803 — Driver.PauseSnapshot has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 3, loops 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 · Handlers.serveSandboxUpstream (cognitive 33) · ×1
  • Handlers.serveSandboxUpstream (cognitive 33) REDACTED:451 — Handlers.serveSandboxUpstream has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 13). Of this number, 26 points are the body's own statements and 7 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 · ArtifactService.SaveFile (cognitive 33) · ×1
  • ArtifactService.SaveFile (cognitive 33) server/internal/services/artifact_file.go:65 — ArtifactService.SaveFile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 106). 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 · SandboxService.reconcileRecoveryState (cognitive 33) · ×1
  • SandboxService.reconcileRecoveryState (cognitive 33) server/internal/services/sandbox_recovery.go:525 — SandboxService.reconcileRecoveryState has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (27 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 · home.runHeroFlow (cognitive 33) · ×1
  • home.runHeroFlow (cognitive 33) docs/site/js/home.js:179 — home.runHeroFlow has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 1, ternaries 1 (nesting depth added 15). Of this number, 28 points are the body's own statements and 5 belong to 4 function items 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 · tokenAnalyticsCharts.listDrillBreakdowns (cognitive 33) · ×1
  • tokenAnalyticsCharts.listDrillBreakdowns (cognitive 33) web/src/components/token-analytics/tokenAnalyticsCharts.ts:447 — tokenAnalyticsCharts.listDrillBreakdowns has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 11, if/else 8 (nesting depth added 7). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 502, a function literal at line 541, a function literal at line 468, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useGateApproval.useGateApproval.buildProductLoadFingerprint (cognitive 33) · ×1
  • useGateApproval.useGateApproval.buildProductLoadFingerprint (cognitive 33) web/src/lib/inbox/useGateApproval.ts:748 — useGateApproval.useGateApproval.buildProductLoadFingerprint has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 3 (7 pts), boolean chains 6, 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 · useGateApproval.useGateApproval.loadOneProductContent (cognitive 33) · ×1
  • useGateApproval.useGateApproval.loadOneProductContent (cognitive 33) web/src/lib/inbox/useGateApproval.ts:818 — useGateApproval.useGateApproval.loadOneProductContent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 11, ternaries 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 · acpTurn.turnsFromMessages (cognitive 33) · ×1
  • acpTurn.turnsFromMessages (cognitive 33) web/src/lib/solo/acpTurn.ts:161 — acpTurn.turnsFromMessages has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (4 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 · OnboardingService.Bootstrap (cognitive 32) · ×1
  • OnboardingService.Bootstrap (cognitive 32) server/internal/services/onboarding.go:269 — OnboardingService.Bootstrap has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 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 · SandboxService.reclaimLocked (cognitive 32) · ×1
  • SandboxService.reclaimLocked (cognitive 32) server/internal/services/sandbox_recovery.go:47 — SandboxService.reclaimLocked has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24 (27 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 · SandboxService.ChatWithTimeout (cognitive 32) · ×1
  • SandboxService.ChatWithTimeout (cognitive 32) server/internal/services/sandbox_studio.go:376 — SandboxService.ChatWithTimeout has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 7 (nesting depth added 7). Of this number, 25 points are the body's own statements and 7 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 · useGateApproval.useGateApproval.editReactQueuedItem (cognitive 32) · ×1
  • useGateApproval.useGateApproval.editReactQueuedItem (cognitive 32) web/src/lib/inbox/useGateApproval.ts:1388 — useGateApproval.useGateApproval.editReactQueuedItem has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, error handling 2 (6 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 · htmlPreviewSandbox.isValidInspectPickMessage (cognitive 32) · ×1
  • htmlPreviewSandbox.isValidInspectPickMessage (cognitive 32) web/src/lib/shared/htmlPreviewSandbox.ts:456 — htmlPreviewSandbox.isValidInspectPickMessage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9, loops 2 (4 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 · SandboxService.StartPrepared (cognitive 31) · ×1
  • SandboxService.StartPrepared (cognitive 31) sandbox-gateway/gateway/internal/service/recovery.go:136 — SandboxService.StartPrepared has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 4 (nesting depth added 10). Of this number, 28 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 · Engine.reconcileInterrupted (cognitive 31) · ×1
  • Engine.reconcileInterrupted (cognitive 31) server/internal/engine/reattach.go:37 — Engine.reconcileInterrupted has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 4, boolean chains 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 · acpProvider.spec (cognitive 31) · ×1
  • acpProvider.spec (cognitive 31) server/internal/runtime/acp_sandbox.go:477 — acpProvider.spec has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 4 (5 pts), boolean chains 4 (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 · SandboxService.ensureConnected (cognitive 31) · ×1
  • SandboxService.ensureConnected (cognitive 31) server/internal/services/sandbox_studio.go:486 — SandboxService.ensureConnected has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 3 (nesting depth added 6). 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 · SandboxService.ReconcileOnStartup (cognitive 31) · ×1
  • SandboxService.ReconcileOnStartup (cognitive 31) server/internal/services/sandbox_studio.go:754 — SandboxService.ReconcileOnStartup has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, loops 2, match/switch 1 (2 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 · busySeedRetry.runBusySeedRetry (cognitive 31) · ×1
  • busySeedRetry.runBusySeedRetry (cognitive 31) web/src/lib/run/busySeedRetry.ts:35 — busySeedRetry.runBusySeedRetry has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). Of this number, 26 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 · useHomeApproveChat.useHomeApproveChat (cognitive 31) · ×1
  • useHomeApproveChat.useHomeApproveChat (cognitive 31) web/src/lib/run/useHomeApproveChat.ts:114 — useHomeApproveChat.useHomeApproveChat has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (13 pts), ternaries 4 (nesting depth added 2). None of this is in the body itself: all 31 points belong to 6 function literals inside it that branch (lines 282, 313, 274, …). 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 · Driver.refresh (cognitive 30) · ×1
  • Driver.refresh (cognitive 30) sandbox-gateway/gateway/internal/driver/e2b/driver.go:647 — Driver.refresh has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (25 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 · Handlers.serveDesktopVNC (cognitive 30) · ×1
  • Handlers.serveDesktopVNC (cognitive 30) REDACTED:89 — Handlers.serveDesktopVNC has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 12). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 173, 162). 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 · acpProvider.AbortRun (cognitive 30) · ×1
  • acpProvider.AbortRun (cognitive 30) REDACTED:444 — acpProvider.AbortRun has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5, boolean chains 2 (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 · services.ClarifySlimNodeIDs (cognitive 30) · ×1
  • services.ClarifySlimNodeIDs (cognitive 30) server/internal/services/inbox_context.go:135 — services.ClarifySlimNodeIDs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 6 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 162, 138). 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 · SettingsService.UpdateWithBrand (cognitive 30) · ×1
  • SettingsService.UpdateWithBrand (cognitive 30) server/internal/services/settings.go:158 — SettingsService.UpdateWithBrand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, loops 4 (nesting depth added 9). Of this number, 17 points are the body's own statements and 13 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 · WorkflowService.SaveAs (cognitive 30) · ×1
  • WorkflowService.SaveAs (cognitive 30) server/internal/services/workflow.go:224 — WorkflowService.SaveAs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (27 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 · CredentialService.create (cognitive 30) · ×1
  • CredentialService.create (cognitive 30) server/internal/services/workspace_credentials.go:257 — CredentialService.create has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 8 (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 · runtime.installRuntimeIconMotion (cognitive 30) · ×1
  • runtime.installRuntimeIconMotion (cognitive 30) web/src/lib/icons/runtime.ts:32 — runtime.installRuntimeIconMotion has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 11, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 10 function items inside it that branch (enter, leave, pointerover, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Config.validateE2B (cognitive 29) · ×1
  • Config.validateE2B (cognitive 29) sandbox-gateway/gateway/internal/config/validation.go:80 — Config.validateE2B has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, 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 · Driver.captureRecoveryPoint (cognitive 29) · ×1
  • Driver.captureRecoveryPoint (cognitive 29) sandbox-gateway/gateway/internal/driver/e2b/snapshot.go:109 — Driver.captureRecoveryPoint has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 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 · Driver.restoreLatest (cognitive 29) · ×1
  • Driver.restoreLatest (cognitive 29) sandbox-gateway/gateway/internal/driver/e2b/snapshot_restore.go:59 — Driver.restoreLatest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (26 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 · Engine.resumeGateLocked (cognitive 29) · ×1
  • Engine.resumeGateLocked (cognitive 29) server/internal/engine/resume.go:86 — Engine.resumeGateLocked has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 3, loops 1, 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 · Engine.SegmentTasks (cognitive 29) · ×1
  • Engine.SegmentTasks (cognitive 29) REDACTED:30 — Engine.SegmentTasks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 1 (nesting depth added 19). 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, 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 · Host.ExecutionDetail (cognitive 29) · ×1
  • Host.ExecutionDetail (cognitive 29) server/internal/mcp/history.go:280 — Host.ExecutionDetail has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 2 (3 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 · SoloService.SetCurrentModelRouteSettings (cognitive 29) · ×1
  • SoloService.SetCurrentModelRouteSettings (cognitive 29) server/internal/services/solo_model_settings.go:50 — SoloService.SetCurrentModelRouteSettings has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (26 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 · mock-agent-model.pagedHistoryAction (cognitive 29) · ×1
  • mock-agent-model.pagedHistoryAction (cognitive 29) sandbox-gateway/scripts/mock-agent-model.mjs:245 — mock-agent-model.pagedHistoryAction has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useGatesInbox.useGatesInbox.refreshActiveContext (cognitive 29) · ×1
  • useGatesInbox.useGatesInbox.refreshActiveContext (cognitive 29) web/src/lib/inbox/useGatesInbox.ts:2830 — useGatesInbox.useGatesInbox.refreshActiveContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5, error handling 1 (nesting depth added 6). Of this number, 27 points are the body's own statements and 2 belong to 2 function items 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 · useRunDetail.useRunDetail (cognitive 29) · ×1
  • useRunDetail.useRunDetail (cognitive 29) web/src/lib/run/useRunDetail.ts:62 — useRunDetail.useRunDetail has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16, boolean chains 11, ternaries 2. Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 688, 671, 1226, …). 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 · useRunDetailSelection.useRunDetailSelection (cognitive 29) · ×1
  • useRunDetailSelection.useRunDetailSelection (cognitive 29) web/src/lib/run/useRunDetailSelection.ts:16 — useRunDetailSelection.useRunDetailSelection has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, boolean chains 11, ternaries 1. Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 168, 189, 229, …). 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 · engine.normalizeAnnotationDoc (cognitive 28) · ×1
  • engine.normalizeAnnotationDoc (cognitive 28) server/internal/engine/annotation_artifact.go:168 — engine.normalizeAnnotationDoc has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (25 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 · Engine.executeReviewTurn (cognitive 28) · ×1
  • Engine.executeReviewTurn (cognitive 28) server/internal/engine/review_session.go:884 — Engine.executeReviewTurn has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 5, 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 · payloadSerializer.Value (cognitive 28) · ×1
  • payloadSerializer.Value (cognitive 28) server/internal/filestore/serializer.go:217 — payloadSerializer.Value has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 3 (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 · Handlers.PublicGateCancel (cognitive 28) · ×1
  • Handlers.PublicGateCancel (cognitive 28) server/internal/handlers/gate_share_public.go:303 — Handlers.PublicGateCancel has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 5 (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, 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 · Handlers.applyVncMsg (cognitive 28) · ×1
  • Handlers.applyVncMsg (cognitive 28) REDACTED:209 — Handlers.applyVncMsg has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 15). 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 · Host.ServeRunHTTP (cognitive 28) · ×1
  • Host.ServeRunHTTP (cognitive 28) server/internal/mcp/http.go:35 — Host.ServeRunHTTP has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, 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 · structured.RenderRootCauseMarkdown (cognitive 28) · ×1
  • structured.RenderRootCauseMarkdown (cognitive 28) server/internal/mcp/structured/root_cause.go:235 — structured.RenderRootCauseMarkdown has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (10 pts), boolean chains 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 · services.attributeGateTurns (cognitive 28) · ×1
  • services.attributeGateTurns (cognitive 28) server/internal/services/conversation_chain.go:371 — services.attributeGateTurns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5 (8 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 · services.fillBucketKeys (cognitive 28) · ×1
  • services.fillBucketKeys (cognitive 28) server/internal/services/workspace_token_stats.go:215 — services.fillBucketKeys has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (8 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 · ConversationHistoryService.readSession (cognitive 28) · ×1
  • ConversationHistoryService.readSession (cognitive 28) server/internal/services/conversation_history.go:101 — ConversationHistoryService.readSession has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 5, loops 1, match/switch 1 (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 · SoloService.adoptLegacyBackups (cognitive 28) · ×1
  • SoloService.adoptLegacyBackups (cognitive 28) server/internal/services/solo_backups.go:88 — SoloService.adoptLegacyBackups has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (5 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 · useGatesInbox.useGatesInbox.projectClarifySessionAfterLoad (cognitive 28) · ×1
  • useGatesInbox.useGatesInbox.projectClarifySessionAfterLoad (cognitive 28) web/src/lib/inbox/useGatesInbox.ts:2297 — useGatesInbox.useGatesInbox.projectClarifySessionAfterLoad has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, ternaries 1 (nesting depth added 6). Of this number, 27 points are the body's own statements and 1 belongs to one function item 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 · useSoloChat.useSoloChat.applyMessages · ×1
  • useSoloChat.useSoloChat.applyMessages::mergePair (cognitive 28) web/src/lib/solo/useSoloChat.ts:338 — useSoloChat.useSoloChat.applyMessages::mergePair has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (3 pts), boolean chains 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. This shape REPEATS in the file: one other method here (useSoloChat.useSoloChat.applyMessages) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · useSoloChat.useSoloChat.saveModelSetting.request (cognitive 28) · ×1
  • useSoloChat.useSoloChat.saveModelSetting.request (cognitive 28) web/src/lib/solo/useSoloChat.ts:1006 — useSoloChat.useSoloChat.saveModelSetting.request has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, ternaries 2 (3 pts), error handling 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 · Engine.attachDialogueFiles (cognitive 27) · ×1
  • Engine.attachDialogueFiles (cognitive 27) server/internal/engine/artifact_delivery.go:52 — Engine.attachDialogueFiles has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), boolean chains 3 (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 · Engine.SaveGateArtifact (cognitive 27) · ×1
  • Engine.SaveGateArtifact (cognitive 27) server/internal/engine/gate_artifact.go:59 — Engine.SaveGateArtifact has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (27 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 · gateshare.SanitizeTurnsFrom (cognitive 27) · ×1
  • gateshare.SanitizeTurnsFrom (cognitive 27) server/internal/gateshare/sanitize.go:372 — gateshare.SanitizeTurnsFrom has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, 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 · Handlers.appPreviewMainHistory (cognitive 27) · ×1
  • Handlers.appPreviewMainHistory (cognitive 27) server/internal/handlers/app_preview_transcript.go:100 — Handlers.appPreviewMainHistory has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (8 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 · Handlers.PublicPreviewTicket (cognitive 27) · ×1
  • Handlers.PublicPreviewTicket (cognitive 27) server/internal/handlers/gate_share_public_preview.go:27 — Handlers.PublicPreviewTicket has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6, loops 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, 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 · SandboxService.reconcileSoloSandbox (cognitive 27) · ×1
  • SandboxService.reconcileSoloSandbox (cognitive 27) server/internal/services/sandbox_solo_recovery.go:20 — SandboxService.reconcileSoloSandbox has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 1 (3 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 · SharedAgentService.Save (cognitive 27) · ×1
  • SharedAgentService.Save (cognitive 27) server/internal/services/shared_agent.go:104 — SharedAgentService.Save has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (26 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 · SoloService.liveReasoningEfforts (cognitive 27) · ×1
  • SoloService.liveReasoningEfforts (cognitive 27) server/internal/services/solo_model_settings.go:226 — SoloService.liveReasoningEfforts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, loops 1 (2 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 · inboxStartingCards.isClarifyStillStarting (cognitive 27) · ×1
  • inboxStartingCards.isClarifyStillStarting (cognitive 27) web/src/lib/inbox/inboxStartingCards.ts:100 — inboxStartingCards.isClarifyStillStarting has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, loops 1 (2 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 · useRunDetail.useRunDetail.readRunData (cognitive 27) · ×1
  • useRunDetail.useRunDetail.readRunData (cognitive 27) web/src/lib/run/useRunDetail.ts:489 — useRunDetail.useRunDetail.readRunData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 7, error handling 1 (nesting depth added 5). Of this number, 26 points are the body's own statements and 1 belongs to one function item 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 · useSoloChat.useSoloChat.beginTurn (cognitive 27) · ×1
  • useSoloChat.useSoloChat.beginTurn (cognitive 27) web/src/lib/solo/useSoloChat.ts:439 — useSoloChat.useSoloChat.beginTurn has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 4 (8 pts), boolean chains 7 (nesting depth added 8). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · overlay.createOverlay.layout (cognitive 27) · ×1
  • overlay.createOverlay.layout (cognitive 27) web/src/liveoverlay/overlay.ts:731 — overlay.createOverlay.layout has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (nesting depth added 10). Of this number, 18 points are the body's own statements and 9 belong to 2 function items 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 · overlay.createOverlay.onKeydown (cognitive 27) · ×1
  • overlay.createOverlay.onKeydown (cognitive 27) web/src/liveoverlay/overlay.ts:909 — overlay.createOverlay.onKeydown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 2 (3 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 · Client.List (cognitive 26) · ×1
  • Client.List (cognitive 26) sandbox-gateway/gateway/internal/driver/e2b/client.go:247 — Client.List has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 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 · Driver.Start (cognitive 26) · ×1
  • Driver.Start (cognitive 26) sandbox-gateway/gateway/internal/driver/e2b/driver.go:902 — Driver.Start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (25 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 · Engine.reactReplyLiveCtx (cognitive 26) · ×1
  • Engine.reactReplyLiveCtx (cognitive 26) server/internal/engine/live.go:330 — Engine.reactReplyLiveCtx has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 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 · gateshare.SanitizeStructured (cognitive 26) · ×1
  • gateshare.SanitizeStructured (cognitive 26) server/internal/gateshare/sanitize.go:150 — gateshare.SanitizeStructured has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3 (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 · Handlers.RunEvents (cognitive 26) · ×1
  • Handlers.RunEvents (cognitive 26) server/internal/handlers/ws.go:59 — Handlers.RunEvents has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). Of this number, 23 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 · Host.RunHistory (cognitive 26) · ×1
  • Host.RunHistory (cognitive 26) server/internal/mcp/history.go:144 — Host.RunHistory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, 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 · Host.setPreviewPort (cognitive 26) · ×1
  • Host.setPreviewPort (cognitive 26) server/internal/mcp/preview.go:425 — Host.setPreviewPort has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, match/switch 2 (3 pts) (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 · services.parseVcsMessage (cognitive 26) · ×1
  • services.parseVcsMessage (cognitive 26) REDACTED:216 — services.parseVcsMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (24 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 · previewPickUrl.readPreviewMessage (cognitive 26) · ×1
  • previewPickUrl.readPreviewMessage (cognitive 26) web/src/lib/shared/previewPickUrl.ts:78 — previewPickUrl.readPreviewMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (6 pts), boolean chains 4, error handling 1 (3 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 · config.Load (cognitive 25) · ×1
  • config.Load (cognitive 25) sandbox-gateway/gateway/internal/config/config.go:62 — config.Load has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). 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 · Driver.Create (cognitive 25) · ×1
  • Driver.Create (cognitive 25) sandbox-gateway/gateway/internal/driver/docker/docker.go:105 — Driver.Create has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 3, match/switch 1 (2 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 · e2b.New (cognitive 25) · ×1
  • e2b.New (cognitive 25) sandbox-gateway/gateway/internal/driver/e2b/driver.go:145 — e2b.New has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, loops 2 (3 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 · engine.resolveStartVars (cognitive 25) · ×1
  • engine.resolveStartVars (cognitive 25) server/internal/engine/start_run.go:293 — engine.resolveStartVars has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3, boolean chains 2 (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 · parser.parseCall (cognitive 25) · ×1
  • parser.parseCall (cognitive 25) server/internal/engine/guard.go:274 — parser.parseCall has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 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 · plugin.Initialize (cognitive 25) · ×1
  • plugin.Initialize (cognitive 25) server/internal/filestore/serializer.go:37 — plugin.Initialize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, loops 2 (nesting depth added 10). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 53). 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 · handlers.pumpChatSubscription (cognitive 25) · ×1
  • handlers.pumpChatSubscription (cognitive 25) server/internal/handlers/chat_subscription.go:24 — handlers.pumpChatSubscription has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (5 pts), boolean chains 1, 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 · Handlers.publicReviewDecide (cognitive 25) · ×1
  • Handlers.publicReviewDecide (cognitive 25) server/internal/handlers/gate_share_public.go:670 — Handlers.publicReviewDecide has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4 (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.pageCommand (cognitive 25) · ×1
  • mcp.pageCommand (cognitive 25) REDACTED:77 — mcp.pageCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 11). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models.NextLiveState (cognitive 25) · ×1
  • models.NextLiveState (cognitive 25) server/internal/models/live.go:390 — models.NextLiveState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, match/switch 3 (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 · acpProvider.ensureRootCauseConsistency (cognitive 25) · ×1
  • acpProvider.ensureRootCauseConsistency (cognitive 25) server/internal/runtime/acp_ensure.go:189 — acpProvider.ensureRootCauseConsistency has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, loops 1 (nesting depth added 9). 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 190). 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 · acpProvider.ReviseInPlace (cognitive 25) · ×1
  • acpProvider.ReviseInPlace (cognitive 25) server/internal/runtime/acp_react.go:308 — acpProvider.ReviseInPlace has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4, loops 1 (nesting depth added 5). Of this number, 21 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 · services.conversationTools (cognitive 25) · ×1
  • services.conversationTools (cognitive 25) server/internal/services/conversation_history.go:285 — services.conversationTools has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, loops 3 (4 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 · services.resolveGlobalWindow (cognitive 25) · ×1
  • services.resolveGlobalWindow (cognitive 25) server/internal/services/global_token_stats.go:382 — services.resolveGlobalWindow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2, 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 · services.buildTopRuns (cognitive 25) · ×1
  • services.buildTopRuns (cognitive 25) server/internal/services/global_token_stats.go:1170 — services.buildTopRuns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). 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 · services.mergeWorkspaceVars (cognitive 25) · ×1
  • services.mergeWorkspaceVars (cognitive 25) server/internal/services/workspace_vars.go:80 — services.mergeWorkspaceVars has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2, boolean chains 1 (nesting depth added 13). 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 · ArtifactService.OpenFile (cognitive 25) · ×1
  • ArtifactService.OpenFile (cognitive 25) server/internal/services/artifact_file.go:166 — ArtifactService.OpenFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 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 · useCanvasEditor.useCanvasEditor.addNode (cognitive 25) · ×1
  • useCanvasEditor.useCanvasEditor.addNode (cognitive 25) web/src/components/canvas/composables/useCanvasEditor.ts:115 — useCanvasEditor.useCanvasEditor.addNode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (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 · modelRouting.bindingProblem (cognitive 25) · ×1
  • modelRouting.bindingProblem (cognitive 25) web/src/lib/agent/modelRouting.ts:46 — modelRouting.bindingProblem has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 9, ternaries 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 · useSoloChat.useSoloChat.send (cognitive 25) · ×1
  • useSoloChat.useSoloChat.send (cognitive 25) web/src/lib/solo/useSoloChat.ts:907 — useSoloChat.useSoloChat.send has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, ternaries 3, error handling 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 · gitCredentials.validGitScope (cognitive 25) · ×1
  • gitCredentials.validGitScope (cognitive 25) web/src/lib/workspace/gitCredentials.ts:49 — gitCredentials.validGitScope has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, ternaries 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 · Driver.endpoints (cognitive 24) · ×1
  • Driver.endpoints (cognitive 24) sandbox-gateway/gateway/internal/driver/docker/docker.go:354 — Driver.endpoints has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 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 · Driver.waitHealthy (cognitive 24) · ×1
  • Driver.waitHealthy (cognitive 24) sandbox-gateway/gateway/internal/driver/e2b/driver.go:555 — Driver.waitHealthy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, match/switch 1 (2 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 · SandboxService.PublishPort (cognitive 24) · ×1
  • SandboxService.PublishPort (cognitive 24) sandbox-gateway/gateway/internal/service/service.go:558 — SandboxService.PublishPort has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (2 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 · handlers.readPreviewGuestRequests (cognitive 24) · ×1
  • handlers.readPreviewGuestRequests (cognitive 24) REDACTED:235 — handlers.readPreviewGuestRequests has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, match/switch 1 (2 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 · Handlers.ManageAppPreviewShare (cognitive 24) · ×1
  • Handlers.ManageAppPreviewShare (cognitive 24) server/internal/handlers/app_preview_share.go:27 — Handlers.ManageAppPreviewShare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6 (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 · mcp.PlanCoverageOK (cognitive 24) · ×1
  • mcp.PlanCoverageOK (cognitive 24) server/internal/mcp/plan_coverage.go:23 — mcp.PlanCoverageOK has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (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 · modelrouting.providerForConnection (cognitive 24) · ×1
  • modelrouting.providerForConnection (cognitive 24) server/internal/modelrouting/provider_efforts.go:54 — modelrouting.providerForConnection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (10 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 · modelrouting.ReasoningEfforts (cognitive 24) · ×1
  • modelrouting.ReasoningEfforts (cognitive 24) server/internal/modelrouting/reasoning.go:20 — modelrouting.ReasoningEfforts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, loops 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 · models.normalizeGitScopeHost (cognitive 24) · ×1
  • models.normalizeGitScopeHost (cognitive 24) server/internal/models/git_scope.go:90 — models.normalizeGitScopeHost has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (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 · models.eventsForReply (cognitive 24) · ×1
  • models.eventsForReply (cognitive 24) server/internal/models/graph.go:146 — models.eventsForReply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (5 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 · models.NormalizeLiveMarks (cognitive 24) · ×1
  • models.NormalizeLiveMarks (cognitive 24) server/internal/models/live.go:604 — models.NormalizeLiveMarks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, 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 · SoloService.Create (cognitive 24) · ×1
  • SoloService.Create (cognitive 24) server/internal/services/solo.go:437 — SoloService.Create has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (19 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 · mock-agent-model.historyPage · ×1
  • mock-agent-model.historyPage::find (cognitive 24) sandbox-gateway/scripts/mock-agent-model.mjs:213 — mock-agent-model.historyPage::find has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 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 · gateShareLink.publicGateContentKey (cognitive 24) · ×1
  • gateShareLink.publicGateContentKey (cognitive 24) REDACTED:537 — gateShareLink.publicGateContentKey has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 20, ternaries 3, if/else 1. 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, 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 · llmTranscript.buildLlmTranscript (cognitive 24) · ×1
  • llmTranscript.buildLlmTranscript (cognitive 24) web/src/lib/run/llmTranscript.ts:328 — llmTranscript.buildLlmTranscript has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (7 pts), if/else 3 (5 pts), loops 2 (nesting depth added 5). Of this number, 18 points are the body's own statements and 6 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 · runLive.decideLive (cognitive 24) · ×1
  • runLive.decideLive (cognitive 24) web/src/lib/run/runLive.ts:29 — runLive.decideLive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (9 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 · useSoloLauncher.useSoloLauncher.start (cognitive 24) · ×1
  • useSoloLauncher.useSoloLauncher.start (cognitive 24) web/src/lib/solo/useSoloLauncher.ts:167 — useSoloLauncher.useSoloLauncher.start has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 6 (7 pts), error handling 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 · Engine.execClarifyEnter (cognitive 23) · ×1
  • Engine.execClarifyEnter (cognitive 23) server/internal/engine/node_react.go:15 — Engine.execClarifyEnter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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 · Engine.ResumeFrom (cognitive 23) · ×1
  • Engine.ResumeFrom (cognitive 23) server/internal/engine/resume.go:655 — Engine.ResumeFrom has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 1, 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 · Engine.routeFailure (cognitive 23) · ×1
  • Engine.routeFailure (cognitive 23) server/internal/engine/route.go:36 — Engine.routeFailure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (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 · Engine.startRun (cognitive 23) · ×1
  • Engine.startRun (cognitive 23) server/internal/engine/start_run.go:126 — Engine.startRun has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (20 pts), loops 2, boolean chains 1 (nesting depth added 2). Of this number, 19 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 · gateshare.applyPreviewArtifacts (cognitive 23) · ×1
  • gateshare.applyPreviewArtifacts (cognitive 23) server/internal/gateshare/preview.go:194 — gateshare.applyPreviewArtifacts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 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, 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 · gateshare.sanitizeJSONValue (cognitive 23) · ×1
  • gateshare.sanitizeJSONValue (cognitive 23) server/internal/gateshare/sanitize.go:226 — gateshare.sanitizeJSONValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2, match/switch 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 · handlers.writeStateRun (cognitive 23) · ×1
  • handlers.writeStateRun (cognitive 23) REDACTED:121 — handlers.writeStateRun has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (5 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 · previewMainSnapshot.withLive (cognitive 23) · ×1
  • previewMainSnapshot.withLive (cognitive 23) server/internal/handlers/app_preview_stream.go:60 — previewMainSnapshot.withLive 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 · Handlers.SandboxTerminal (cognitive 23) · ×1
  • Handlers.SandboxTerminal (cognitive 23) REDACTED:320 — Handlers.SandboxTerminal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 9). Of this number, 15 points are the body's own statements and 8 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 · Host.serveToolStream (cognitive 23) · ×1
  • Host.serveToolStream (cognitive 23) server/internal/mcp/http.go:219 — Host.serveToolStream has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). 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 · models.NormalizeGitScope (cognitive 23) · ×1
  • models.NormalizeGitScope (cognitive 23) server/internal/models/git_scope.go:19 — models.NormalizeGitScope has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8 (nesting depth added 4). 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 · Recorder.Flush (cognitive 23) · ×1
  • Recorder.Flush (cognitive 23) server/internal/tokenledger/recorder.go:137 — Recorder.Flush has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, 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 · edgeHandoffs.collectEdgeHandoffs (cognitive 23) · ×1
  • edgeHandoffs.collectEdgeHandoffs (cognitive 23) web/src/components/canvas/composables/edgeHandoffs.ts:32 — edgeHandoffs.collectEdgeHandoffs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 9). 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 · useAgentFilesPanel.useAgentFilesPanel.onCtxAction (cognitive 23) · ×1
  • useAgentFilesPanel.useAgentFilesPanel.onCtxAction (cognitive 23) web/src/lib/agent/useAgentFilesPanel.ts:167 — useAgentFilesPanel.useAgentFilesPanel.onCtxAction has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (9 pts), boolean chains 2, 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 · useClarifyChat.useClarifyChat.sendFromComposer (cognitive 23) · ×1
  • useClarifyChat.useClarifyChat.sendFromComposer (cognitive 23) web/src/lib/inbox/useClarifyChat.ts:841 — useClarifyChat.useClarifyChat.sendFromComposer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5 (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function item 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 · useGatesInbox.useGatesInbox.takeoverFollow (cognitive 23) · ×1
  • useGatesInbox.useGatesInbox.takeoverFollow (cognitive 23) web/src/lib/inbox/useGatesInbox.ts:987 — useGatesInbox.useGatesInbox.takeoverFollow has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 6 (9 pts), boolean chains 3, error handling 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 · compositeText.formatVarValue (cognitive 23) · ×1
  • compositeText.formatVarValue (cognitive 23) web/src/lib/shared/compositeText.ts:77 — compositeText.formatVarValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (7 pts), boolean chains 2, error handling 1 (2 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 · useSoloChat.useSoloChat.applyMessages (cognitive 23) · ×1
  • useSoloChat.useSoloChat.applyMessages (cognitive 23) web/src/lib/solo/useSoloChat.ts:318 — useSoloChat.useSoloChat.applyMessages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 6 (8 pts), boolean chains 5 (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. This shape REPEATS in the file: one other method here (useSoloChat.useSoloChat.applyMessages::mergePair) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · e2b.validateRecovery (cognitive 22) · ×1
  • e2b.validateRecovery (cognitive 22) sandbox-gateway/gateway/internal/driver/e2b/snapshot_restore.go:134 — e2b.validateRecovery has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (10 pts), loops 1 (nesting depth added 4). 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 · Driver.List (cognitive 22) · ×1
  • Driver.List (cognitive 22) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:834 — Driver.List has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 3 (nesting depth added 5). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 851). 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 · engine.settleLiveState (cognitive 22) · ×1
  • engine.settleLiveState (cognitive 22) server/internal/engine/live.go:647 — engine.settleLiveState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, 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 · Handlers.ConversationChain (cognitive 22) · ×1
  • Handlers.ConversationChain (cognitive 22) server/internal/handlers/conversation_chain.go:20 — Handlers.ConversationChain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (5 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 · Handlers.seedPublicDialogue (cognitive 22) · ×1
  • Handlers.seedPublicDialogue (cognitive 22) REDACTED:157 — Handlers.seedPublicDialogue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 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 · mcp.applyPlanStatus (cognitive 22) · ×1
  • mcp.applyPlanStatus (cognitive 22) server/internal/mcp/plan.go:509 — mcp.applyPlanStatus has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), boolean chains 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 · Host.releaseDisplacedPreviews (cognitive 22) · ×1
  • Host.releaseDisplacedPreviews (cognitive 22) server/internal/mcp/preview.go:583 — Host.releaseDisplacedPreviews has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, 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 · Graph.HandoffTargets (cognitive 22) · ×1
  • Graph.HandoffTargets (cognitive 22) server/internal/models/handoff.go:65 — Graph.HandoffTargets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 72). 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 · runtime.MCPServersJSON (cognitive 22) · ×1
  • runtime.MCPServersJSON (cognitive 22) server/internal/runtime/acp_config.go:419 — runtime.MCPServersJSON has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (9 pts), match/switch 1 (2 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 · acpProvider.rehydrateReact (cognitive 22) · ×1
  • acpProvider.rehydrateReact (cognitive 22) server/internal/runtime/acp_react.go:71 — acpProvider.rehydrateReact has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, 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 · services.emojiIdentityPresent (cognitive 22) · ×1
  • services.emojiIdentityPresent (cognitive 22) server/internal/services/agent_icon.go:85 — services.emojiIdentityPresent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 13). 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 · services.gateVisitFor (cognitive 22) · ×1
  • services.gateVisitFor (cognitive 22) server/internal/services/conversation_chain.go:411 — services.gateVisitFor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, 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 · services.resolveOnboardingTeam (cognitive 22) · ×1
  • services.resolveOnboardingTeam (cognitive 22) server/internal/services/onboarding.go:405 — services.resolveOnboardingTeam has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (5 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 · NotificationService.ListPage (cognitive 22) · ×1
  • NotificationService.ListPage (cognitive 22) server/internal/services/notifications.go:72 — NotificationService.ListPage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 2 (3 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 · SandboxService.startContainer (cognitive 22) · ×1
  • SandboxService.startContainer (cognitive 22) server/internal/services/sandbox_studio.go:164 — SandboxService.startContainer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 3, boolean chains 2 (nesting depth added 2). Of this number, 21 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 · SoloService.contextPreambleChecked (cognitive 22) · ×1
  • SoloService.contextPreambleChecked (cognitive 22) server/internal/services/conversation_history.go:428 — SoloService.contextPreambleChecked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (7 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 · SoloService.restoreSessionLocked (cognitive 22) · ×1
  • SoloService.restoreSessionLocked (cognitive 22) server/internal/services/solo_queue.go:175 — SoloService.restoreSessionLocked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, 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 · useFlowElements.useFlowElements.flowNodes.out (cognitive 22) · ×1
  • useFlowElements.useFlowElements.flowNodes.out (cognitive 22) web/src/components/canvas/composables/useFlowElements.ts:134 — useFlowElements.useFlowElements.flowNodes.out has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12, boolean chains 8, if/else 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 · useSidebarNavigation.provideSidebarNavigation (cognitive 22) · ×1
  • useSidebarNavigation.provideSidebarNavigation (cognitive 22) web/src/lib/composables/useSidebarNavigation.ts:15 — useSidebarNavigation.provideSidebarNavigation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 25, 22, 23, …). 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 · useRunLive.useRunLive.seed (cognitive 22) · ×1
  • useRunLive.useRunLive.seed (cognitive 22) web/src/lib/run/useRunLive.ts:473 — useRunLive.useRunLive.seed has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, if/else 5, ternaries 2, error handling 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 · Service.sweep (cognitive 21) · ×1
  • Service.sweep (cognitive 21) server/internal/browser/service.go:844 — Service.sweep has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 6 (7 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 · config.WatchAndReload (cognitive 21) · ×1
  • config.WatchAndReload (cognitive 21) server/internal/config/watcher.go:105 — config.WatchAndReload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 129). 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 · engine.encodeBranchesVar (cognitive 21) · ×1
  • engine.encodeBranchesVar (cognitive 21) server/internal/engine/node_agent.go:278 — engine.encodeBranchesVar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 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 · gateshare.imagesFromAny (cognitive 21) · ×1
  • gateshare.imagesFromAny (cognitive 21) server/internal/gateshare/sanitize.go:580 — gateshare.imagesFromAny has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, loops 1 (2 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 · Handlers.lookupPreviewRegistration (cognitive 21) · ×1
  • Handlers.lookupPreviewRegistration (cognitive 21) server/internal/handlers/preview.go:349 — Handlers.lookupPreviewRegistration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 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 · Handlers.RunLlmTranscript (cognitive 21) · ×1
  • Handlers.RunLlmTranscript (cognitive 21) server/internal/handlers/run_llm_transcript.go:81 — Handlers.RunLlmTranscript has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 2 (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Hub.waitActive (cognitive 21) · ×1
  • Hub.waitActive (cognitive 21) server/internal/pagebridge/hub.go:324 — Hub.waitActive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 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 · services.buildGlobalModelStats (cognitive 21) · ×1
  • services.buildGlobalModelStats (cognitive 21) server/internal/services/global_token_stats.go:1067 — services.buildGlobalModelStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (5 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 · GitHubDeviceFlowService.Poll (cognitive 21) · ×1
  • GitHubDeviceFlowService.Poll (cognitive 21) server/internal/services/github_device_flow.go:225 — GitHubDeviceFlowService.Poll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, match/switch 2 (4 pts) (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 · SandboxService.acpConnection (cognitive 21) · ×1
  • SandboxService.acpConnection (cognitive 21) server/internal/services/sandbox_view.go:28 — SandboxService.acpConnection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 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 · SoloService.turnExecutionSnapshot (cognitive 21) · ×1
  • SoloService.turnExecutionSnapshot (cognitive 21) server/internal/services/solo_execution.go:13 — SoloService.turnExecutionSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3 (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 · WorkspaceService.TokenUsageEvents (cognitive 21) · ×1
  • WorkspaceService.TokenUsageEvents (cognitive 21) server/internal/services/token_usage_events_query.go:57 — WorkspaceService.TokenUsageEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 3). 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: 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 · tokenledger.Rows (cognitive 21) · ×1
  • tokenledger.Rows (cognitive 21) server/internal/tokenledger/ledger.go:44 — tokenledger.Rows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3 (4 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 · sidebarHandoff.noteSidebarHandoffOutcome (cognitive 21) · ×1
  • sidebarHandoff.noteSidebarHandoffOutcome (cognitive 21) web/src/lib/inbox/sidebarHandoff.ts:165 — sidebarHandoff.noteSidebarHandoffOutcome has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 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 · useAgentFilesPanel.useAgentFilesPanel.onFolderPick (cognitive 21) · ×1
  • useAgentFilesPanel.useAgentFilesPanel.onFolderPick (cognitive 21) web/src/lib/agent/useAgentFilesPanel.ts:525 — useAgentFilesPanel.useAgentFilesPanel.onFolderPick has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 2 (3 pts), error handling 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 · takeoverTimeline.autoPhaseRows (cognitive 21) · ×1
  • takeoverTimeline.autoPhaseRows (cognitive 21) web/src/lib/run/takeoverTimeline.ts:12 — takeoverTimeline.autoPhaseRows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). Of this number, 17 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 · tokenUsage.mergeTokenUsageByModel (cognitive 21) · ×1
  • tokenUsage.mergeTokenUsageByModel (cognitive 21) web/src/lib/run/tokenUsage.ts:273 — tokenUsage.mergeTokenUsageByModel has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (7 pts), loops 2 (3 pts) (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 · useRunBoard.useRunBoard.load (cognitive 21) · ×1
  • useRunBoard.useRunBoard.load (cognitive 21) web/src/lib/run/useRunBoard.ts:139 — useRunBoard.useRunBoard.load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 7 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 · useRunLive.useRunLive.takeover (cognitive 21) · ×1
  • useRunLive.useRunLive.takeover (cognitive 21) web/src/lib/run/useRunLive.ts:626 — useRunLive.useRunLive.takeover has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 6 (9 pts), boolean chains 1, error handling 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 · markdown.cjkEmStrong (cognitive 21) · ×1
  • markdown.cjkEmStrong (cognitive 21) REDACTED:103 — markdown.cjkEmStrong has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (3 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 · useSoloChat.useSoloChat.historyCoversLive (cognitive 21) · ×1
  • useSoloChat.useSoloChat.historyCoversLive (cognitive 21) web/src/lib/solo/useSoloChat.ts:302 — useSoloChat.useSoloChat.historyCoversLive has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 8, ternaries 1. Of this number, 14 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.
D2 · Cognitive Complexity · useSoloChat.useSoloChat.noteSeq (cognitive 21) · ×1
  • useSoloChat.useSoloChat.noteSeq (cognitive 21) web/src/lib/solo/useSoloChat.ts:531 — useSoloChat.useSoloChat.noteSeq has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 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 · overlay.createOverlay.applyWrappers (cognitive 21) · ×1
  • overlay.createOverlay.applyWrappers (cognitive 21) web/src/liveoverlay/overlay.ts:291 — overlay.createOverlay.applyWrappers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (9 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 · Driver.connectForResume (cognitive 20) · ×1
  • Driver.connectForResume (cognitive 20) sandbox-gateway/gateway/internal/driver/e2b/driver.go:80 — Driver.connectForResume has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (6 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 · Engine.saveState (cognitive 20) · ×1
  • Engine.saveState (cognitive 20) server/internal/engine/node_req.go:165 — Engine.saveState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 6, loops 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 · Engine.pendingTransitionTarget (cognitive 20) · ×1
  • Engine.pendingTransitionTarget (cognitive 20) server/internal/engine/reattach.go:162 — Engine.pendingTransitionTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 2, match/switch 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 · Engine.snapshotRunRepos (cognitive 20) · ×1
  • Engine.snapshotRunRepos (cognitive 20) server/internal/engine/run_repos.go:16 — Engine.snapshotRunRepos has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 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 · Engine.executeVisitorTurn (cognitive 20) · ×1
  • Engine.executeVisitorTurn (cognitive 20) server/internal/engine/visitor_lane.go:334 — Engine.executeVisitorTurn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 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 · handlers.rewriteRedirectLocation (cognitive 20) · ×1
  • handlers.rewriteRedirectLocation (cognitive 20) server/internal/handlers/sandbox_proxy_auth.go:246 — handlers.rewriteRedirectLocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, 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 · Handlers.SandboxChat (cognitive 20) · ×1
  • Handlers.SandboxChat (cognitive 20) REDACTED:248 — Handlers.SandboxChat has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 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 · mcp.traceHistoryLines (cognitive 20) · ×1
  • mcp.traceHistoryLines (cognitive 20) server/internal/mcp/history.go:208 — mcp.traceHistoryLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 4, 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 · models.LiveReplyRows (cognitive 20) · ×1
  • models.LiveReplyRows (cognitive 20) server/internal/models/dialogue.go:103 — models.LiveReplyRows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 2, match/switch 1 (2 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 · ReactConversation.AfterFind (cognitive 20) · ×1
  • ReactConversation.AfterFind (cognitive 20) server/internal/models/artifact_delivery.go:48 — ReactConversation.AfterFind has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 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 · AgentService.writeAgentToZip (cognitive 20) · ×1
  • AgentService.writeAgentToZip (cognitive 20) server/internal/services/agent_zip.go:55 — AgentService.writeAgentToZip has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 90). 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 · CodexDeviceFlowService.Poll (cognitive 20) · ×1
  • CodexDeviceFlowService.Poll (cognitive 20) server/internal/services/codex_device_flow.go:166 — CodexDeviceFlowService.Poll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, match/switch 1 (2 pts) (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 · SandboxService.prepareRunRecoveryInputs (cognitive 20) · ×1
  • SandboxService.prepareRunRecoveryInputs (cognitive 20) server/internal/services/sandbox_recovery_inputs.go:66 — SandboxService.prepareRunRecoveryInputs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 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 · Handler.do_GET (cognitive 20) · ×1
  • Handler.do_GET (cognitive 20) sandbox-gateway/gateway/internal/driver/e2b/relay.py:104 — Handler.do_GET has cognitive complexity 20 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 6, 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 · mock-chat-model.handle (cognitive 20) · ×1
  • mock-chat-model.handle (cognitive 20) sandbox-gateway/scripts/mock-chat-model.mjs:141 — mock-chat-model.handle has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 8, error handling 1 (2 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 165, 180). 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 · reactArtifactPreview.extractVisualHtmlSummary (cognitive 20) · ×1
  • reactArtifactPreview.extractVisualHtmlSummary (cognitive 20) web/src/lib/run/reactArtifactPreview.ts:616 — reactArtifactPreview.extractVisualHtmlSummary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (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 · modelCapabilities.mergeModelMetadata (cognitive 20) · ×1
  • modelCapabilities.mergeModelMetadata (cognitive 20) web/src/lib/agent/modelCapabilities.ts:14 — modelCapabilities.mergeModelMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9, 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 · useGatesInbox.useGatesInbox.onResolve (cognitive 20) · ×1
  • useGatesInbox.useGatesInbox.onResolve (cognitive 20) web/src/lib/inbox/useGatesInbox.ts:3154 — useGatesInbox.useGatesInbox.onResolve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, error handling 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 · acpTools.timelineBlocks (cognitive 20) · ×1
  • acpTools.timelineBlocks (cognitive 20) web/src/lib/run/acpTools.ts:91 — acpTools.timelineBlocks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4 (nesting depth added 6). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 93). 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 · Driver.Endpoints (cognitive 19) · ×1
  • Driver.Endpoints (cognitive 19) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:958 — Driver.Endpoints has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 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 · SandboxService.SweepOrphans (cognitive 19) · ×1
  • SandboxService.SweepOrphans (cognitive 19) sandbox-gateway/gateway/internal/service/service.go:616 — SandboxService.SweepOrphans has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, 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 · Engine.fireClarifyFirstMessage (cognitive 19) · ×1
  • Engine.fireClarifyFirstMessage (cognitive 19) server/internal/engine/clarify_first_message.go:86 — Engine.fireClarifyFirstMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 127, 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 · gateshare.reviewPreviewCopy (cognitive 19) · ×1
  • gateshare.reviewPreviewCopy (cognitive 19) server/internal/gateshare/preview.go:360 — gateshare.reviewPreviewCopy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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 · Handlers.PublicAppPreviewMainChat (cognitive 19) · ×1
  • Handlers.PublicAppPreviewMainChat (cognitive 19) server/internal/handlers/app_preview_share.go:282 — Handlers.PublicAppPreviewMainChat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 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 · Handlers.ReactReply (cognitive 19) · ×1
  • Handlers.ReactReply (cognitive 19) server/internal/handlers/gate.go:145 — Handlers.ReactReply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 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, 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 · Handlers.PublicAppPreviewModel (cognitive 19) · ×1
  • Handlers.PublicAppPreviewModel (cognitive 19) server/internal/handlers/preview_model.go:172 — Handlers.PublicAppPreviewModel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 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 · mcp.parsePlan (cognitive 19) · ×1
  • mcp.parsePlan (cognitive 19) server/internal/mcp/plan.go:414 — mcp.parsePlan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 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 · structured.RenderPreflightMarkdown (cognitive 19) · ×1
  • structured.RenderPreflightMarkdown (cognitive 19) server/internal/mcp/structured/preflight.go:141 — structured.RenderPreflightMarkdown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 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 · models.NormalizeRunTags (cognitive 19) · ×1
  • models.NormalizeRunTags (cognitive 19) server/internal/models/models.go:213 — models.NormalizeRunTags has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 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 · Graph.Validate (cognitive 19) · ×1
  • Graph.Validate (cognitive 19) server/internal/models/graph.go:286 — Graph.Validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 5, match/switch 1 (2 pts), 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 · opencodecatalog.slim (cognitive 19) · ×1
  • opencodecatalog.slim (cognitive 19) server/internal/opencodecatalog/catalog.go:153 — opencodecatalog.slim has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 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 · CodexLoginHub.Recover (cognitive 19) · ×1
  • CodexLoginHub.Recover (cognitive 19) server/internal/runtime/codex_login_hub.go:289 — CodexLoginHub.Recover has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, 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 · ArtifactDeliveryService.deliver (cognitive 19) · ×1
  • ArtifactDeliveryService.deliver (cognitive 19) server/internal/services/artifact_delivery.go:133 — ArtifactDeliveryService.deliver has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2 (nesting depth added 4). 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 146). 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 · SandboxService.Open (cognitive 19) · ×1
  • SandboxService.Open (cognitive 19) server/internal/services/sandbox_studio.go:64 — SandboxService.Open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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 · SettingsService.migrateSandboxSettings (cognitive 19) · ×1
  • SettingsService.migrateSandboxSettings (cognitive 19) server/internal/services/settings_migrate.go:16 — SettingsService.migrateSandboxSettings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (2 pts) (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 17). 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 · SoloService.buildTurnInput (cognitive 19) · ×1
  • SoloService.buildTurnInput (cognitive 19) server/internal/services/solo_turn.go:259 — SoloService.buildTurnInput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), 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 · TeamService.runRetry (cognitive 19) · ×1
  • TeamService.runRetry (cognitive 19) server/internal/services/team.go:249 — TeamService.runRetry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 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 · home.playApprove (cognitive 19) · ×1
  • home.playApprove (cognitive 19) docs/site/js/home.js:1074 — home.playApprove has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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 · useAgentFilesPanel.useAgentFilesPanel.commitRename (cognitive 19) · ×1
  • useAgentFilesPanel.useAgentFilesPanel.commitRename (cognitive 19) web/src/lib/agent/useAgentFilesPanel.ts:405 — useAgentFilesPanel.useAgentFilesPanel.commitRename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 4). Of this number, 10 points are the body's own statements and 9 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 · reviewSessionState.createReviewSessionState.reduceSnapshot (cognitive 19) · ×1
  • reviewSessionState.createReviewSessionState.reduceSnapshot (cognitive 19) web/src/lib/chat/reviewSessionState.ts:161 — reviewSessionState.createReviewSessionState.reduceSnapshot 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 · useClarifyChat.useClarifyChat.mergeIntoComposer (cognitive 19) · ×1
  • useClarifyChat.useClarifyChat.mergeIntoComposer (cognitive 19) web/src/lib/inbox/useClarifyChat.ts:1162 — useClarifyChat.useClarifyChat.mergeIntoComposer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 8 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 · useClarifyChat.useClarifyChat.restoreUnsentQueued (cognitive 19) · ×1
  • useClarifyChat.useClarifyChat.restoreUnsentQueued (cognitive 19) web/src/lib/inbox/useClarifyChat.ts:1337 — useClarifyChat.useClarifyChat.restoreUnsentQueued has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 3. Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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 · useGatesInbox.useGatesInbox.writeFollowParts (cognitive 19) · ×1
  • useGatesInbox.useGatesInbox.writeFollowParts (cognitive 19) web/src/lib/inbox/useGatesInbox.ts:614 — useGatesInbox.useGatesInbox.writeFollowParts has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), ternaries 2 (4 pts) (nesting depth added 4). Of this number, 18 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 · homeLaunchModel.resolveHomeLaunchModel (cognitive 19) · ×1
  • homeLaunchModel.resolveHomeLaunchModel (cognitive 19) web/src/lib/run/homeLaunchModel.ts:25 — homeLaunchModel.resolveHomeLaunchModel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 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 · llmTranscript.applyReplyEvent (cognitive 19) · ×1
  • llmTranscript.applyReplyEvent (cognitive 19) web/src/lib/run/llmTranscript.ts:115 — llmTranscript.applyReplyEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (4 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 · useRunLive.useRunLive.loadOnce (cognitive 19) · ×1
  • useRunLive.useRunLive.loadOnce (cognitive 19) web/src/lib/run/useRunLive.ts:430 — useRunLive.useRunLive.loadOnce has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), error handling 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 2 belong to one function item 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 · useSoloLauncher.useSoloLauncher (cognitive 19) · ×1
  • useSoloLauncher.useSoloLauncher (cognitive 19) web/src/lib/solo/useSoloLauncher.ts:27 — useSoloLauncher.useSoloLauncher has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 7 function literals inside it that branch (lines 62, 90, 71, …). 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 · codexoauth.parseError (cognitive 18) · ×1
  • codexoauth.parseError (cognitive 18) server/internal/codexoauth/client.go:296 — codexoauth.parseError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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 · engine.firstClarifySuccessNode (cognitive 18) · ×1
  • engine.firstClarifySuccessNode (cognitive 18) server/internal/engine/launch_model.go:56 — engine.firstClarifySuccessNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3, 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 · Engine.sweepVisitorLanes (cognitive 18) · ×1
  • Engine.sweepVisitorLanes (cognitive 18) server/internal/engine/visitor_lane.go:261 — Engine.sweepVisitorLanes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, loops 4 (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 · gateshare.SanitizeLiveEvents (cognitive 18) · ×1
  • gateshare.SanitizeLiveEvents (cognitive 18) server/internal/gateshare/public_events.go:18 — gateshare.SanitizeLiveEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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 · gateshare.sanitizeUpstream (cognitive 18) · ×1
  • gateshare.sanitizeUpstream (cognitive 18) server/internal/gateshare/sanitize.go:704 — gateshare.sanitizeUpstream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 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, 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 · handlers.addCookiesToRequest (cognitive 18) · ×1
  • handlers.addCookiesToRequest (cognitive 18) server/internal/handlers/sandbox_proxy_auth.go:73 — handlers.addCookiesToRequest 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 · Handlers.EmbedChatPage (cognitive 18) · ×1
  • Handlers.EmbedChatPage (cognitive 18) server/internal/handlers/embed.go:255 — Handlers.EmbedChatPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). 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 · Handlers.firstClarifyAgent (cognitive 18) · ×1
  • Handlers.firstClarifyAgent (cognitive 18) server/internal/handlers/run_references.go:76 — Handlers.firstClarifyAgent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 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 · mcp.parseDataDesign (cognitive 18) · ×1
  • mcp.parseDataDesign (cognitive 18) server/internal/mcp/plan.go:284 — mcp.parseDataDesign has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 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 · Host.listedTools (cognitive 18) · ×1
  • Host.listedTools (cognitive 18) server/internal/mcp/outcome.go:257 — Host.listedTools has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 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 · structured.RenderReviewMarkdown (cognitive 18) · ×1
  • structured.RenderReviewMarkdown (cognitive 18) server/internal/mcp/structured/doc.go:1152 — structured.RenderReviewMarkdown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 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 · structured.normalizeRootCauseDiagrams (cognitive 18) · ×1
  • structured.normalizeRootCauseDiagrams (cognitive 18) server/internal/mcp/structured/root_cause.go:191 — structured.normalizeRootCauseDiagrams has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 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 · models.RenderLiveEvent (cognitive 18) · ×1
  • models.RenderLiveEvent (cognitive 18) server/internal/models/live.go:538 — models.RenderLiveEvent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), 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 · runtime.recoveryToolLines (cognitive 18) · ×1
  • runtime.recoveryToolLines (cognitive 18) server/internal/runtime/acp_react.go:887 — runtime.recoveryToolLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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 · runtime.CloneRepos (cognitive 18) · ×1
  • runtime.CloneRepos (cognitive 18) server/internal/runtime/acp_repos.go:106 — runtime.CloneRepos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 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 · acpProvider.reuseSharedSandbox (cognitive 18) · ×1
  • acpProvider.reuseSharedSandbox (cognitive 18) server/internal/runtime/acp_shared.go:230 — acpProvider.reuseSharedSandbox has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), 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 · services.ApplyCreateTemplate (cognitive 18) · ×1
  • services.ApplyCreateTemplate (cognitive 18) server/internal/services/team_embed.go:110 — services.ApplyCreateTemplate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3, 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, 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 · SandboxService.startAgentContainer (cognitive 18) · ×1
  • SandboxService.startAgentContainer (cognitive 18) server/internal/services/sandbox_agent.go:78 — SandboxService.startAgentContainer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 1 (nesting depth added 4). 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: 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 · githubRefClient.get (cognitive 18) · ×1
  • githubRefClient.get (cognitive 18) server/internal/services/solo_reference_github.go:297 — githubRefClient.get has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, match/switch 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 · home.playApproveFullGate (cognitive 18) · ×1
  • home.playApproveFullGate (cognitive 18) docs/site/js/home.js:978 — home.playApproveFullGate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 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 · agent-ws-check.ws.addEventListener("message") (cognitive 18) · ×1
  • agent-ws-check.ws.addEventListener("message") (cognitive 18) sandbox-gateway/scripts/agent-ws-check.mjs:33 — agent-ws-check.ws.addEventListener("message") has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 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 · useAutoLayout.findBackEdges (cognitive 18) · ×1
  • useAutoLayout.findBackEdges (cognitive 18) web/src/components/canvas/composables/useAutoLayout.ts:36 — useAutoLayout.findBackEdges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 2 (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 · clarifyVisitEnded.handleClarifyVisitEnded (cognitive 18) · ×1
  • clarifyVisitEnded.handleClarifyVisitEnded (cognitive 18) web/src/lib/inbox/clarifyVisitEnded.ts:59 — clarifyVisitEnded.handleClarifyVisitEnded has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (5 pts), boolean chains 4 (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 · useGatesInbox.useGatesInbox.loadList (cognitive 18) · ×1
  • useGatesInbox.useGatesInbox.loadList (cognitive 18) web/src/lib/inbox/useGatesInbox.ts:1714 — useGatesInbox.useGatesInbox.loadList has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), error handling 1, ternaries 1 (nesting depth added 1). Of this number, 10 points are the body's own statements and 8 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 · llmTranscript.splitTurns (cognitive 18) · ×1
  • llmTranscript.splitTurns (cognitive 18) web/src/lib/run/llmTranscript.ts:174 — llmTranscript.splitTurns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 2 belong to 2 function items 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 · mergeRunChrome.applyPersistedClarify (cognitive 18) · ×1
  • mergeRunChrome.applyPersistedClarify (cognitive 18) web/src/lib/run/mergeRunChrome.ts:175 — mergeRunChrome.applyPersistedClarify has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 1 (2 pts), ternaries 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 · useHomeApproveChat.useHomeApproveChat.send (cognitive 18) · ×1
  • useHomeApproveChat.useHomeApproveChat.send (cognitive 18) web/src/lib/run/useHomeApproveChat.ts:490 — useHomeApproveChat.useHomeApproveChat.send has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (5 pts), boolean chains 3, error handling 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 · useRunDetail.useRunDetail.onGateResolve (cognitive 18) · ×1
  • useRunDetail.useRunDetail.onGateResolve (cognitive 18) web/src/lib/run/useRunDetail.ts:704 — useRunDetail.useRunDetail.onGateResolve has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3 (5 pts), error handling 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 · agentCapabilities.validateCapabilities (cognitive 18) · ×1
  • agentCapabilities.validateCapabilities (cognitive 18) web/src/lib/workflow/agentCapabilities.ts:100 — agentCapabilities.validateCapabilities has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, 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 · loadingRequest.runWithTimeout (cognitive 18) · ×1
  • loadingRequest.runWithTimeout (cognitive 18) web/src/lib/shared/loadingRequest.ts:73 — loadingRequest.runWithTimeout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 5). Of this number, 14 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 · acpTurn.applyTool (cognitive 18) · ×1
  • acpTurn.applyTool (cognitive 18) web/src/lib/solo/acpTurn.ts:90 — acpTurn.applyTool has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts), ternaries 1 (nesting depth added 2). 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 · useSoloChat.useSoloChat.applyResumeSnapshot (cognitive 18) · ×1
  • useSoloChat.useSoloChat.applyResumeSnapshot (cognitive 18) web/src/lib/solo/useSoloChat.ts:178 — useSoloChat.useSoloChat.applyResumeSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, ternaries 1 (2 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.
D2 · Cognitive Complexity · nodeOutlets.nodeOutlets (cognitive 18) · ×1
  • nodeOutlets.nodeOutlets (cognitive 18) web/src/lib/workflow/nodeOutlets.ts:57 — nodeOutlets.nodeOutlets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3, 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 · overlay.createOverlay.checkMounts (cognitive 18) · ×1
  • overlay.createOverlay.checkMounts (cognitive 18) web/src/liveoverlay/overlay.ts:335 — overlay.createOverlay.checkMounts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 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 · SandboxService.restoreSpec (cognitive 17) · ×1
  • SandboxService.restoreSpec (cognitive 17) sandbox-gateway/gateway/internal/service/recovery.go:64 — SandboxService.restoreSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 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 · blob.IngestPromptImages (cognitive 17) · ×1
  • blob.IngestPromptImages (cognitive 17) server/internal/blob/ingest.go:17 — blob.IngestPromptImages 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 · rodPage.presentFullscreenLocked (cognitive 17) · ×1
  • rodPage.presentFullscreenLocked (cognitive 17) server/internal/browser/rod.go:403 — rodPage.presentFullscreenLocked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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 · database.stripSessionRuntimeSnapshots (cognitive 17) · ×1
  • database.stripSessionRuntimeSnapshots (cognitive 17) REDACTED:72 — database.stripSessionRuntimeSnapshots 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 · Engine.syncAfterPrimaryArtifactWrite (cognitive 17) · ×1
  • Engine.syncAfterPrimaryArtifactWrite (cognitive 17) server/internal/engine/gate_artifact.go:289 — Engine.syncAfterPrimaryArtifactWrite 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, 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 · Engine.SaveRunArtifact (cognitive 17) · ×1
  • Engine.SaveRunArtifact (cognitive 17) server/internal/engine/run_artifact.go:114 — Engine.SaveRunArtifact has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 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 · payloadSerializer.Scan (cognitive 17) · ×1
  • payloadSerializer.Scan (cognitive 17) server/internal/filestore/serializer.go:174 — payloadSerializer.Scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 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 · gateshare.sanitizeQuestions (cognitive 17) · ×1
  • gateshare.sanitizeQuestions (cognitive 17) server/internal/gateshare/sanitize.go:276 — gateshare.sanitizeQuestions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 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 · handlers.writePreviewGuestTurn (cognitive 17) · ×1
  • handlers.writePreviewGuestTurn (cognitive 17) REDACTED:294 — handlers.writePreviewGuestTurn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 309). 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 · Handlers.PublicGateQueueRemove (cognitive 17) · ×1
  • Handlers.PublicGateQueueRemove (cognitive 17) server/internal/handlers/gate_share_public.go:394 — Handlers.PublicGateQueueRemove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3 (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. This shape REPEATS in the file: one other method here (Handlers.PublicGateQueueReorder) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Handlers.PublicGateQueueReorder (cognitive 17) · ×1
  • Handlers.PublicGateQueueReorder (cognitive 17) server/internal/handlers/gate_share_public.go:450 — Handlers.PublicGateQueueReorder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3 (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. This shape REPEATS in the file: one other method here (Handlers.PublicGateQueueRemove) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Handlers.publicGateArtifacts (cognitive 17) · ×1
  • Handlers.publicGateArtifacts (cognitive 17) server/internal/handlers/gate_share_public.go:876 — Handlers.publicGateArtifacts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, 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 · Handlers.NodeEvents (cognitive 17) · ×1
  • Handlers.NodeEvents (cognitive 17) server/internal/handlers/run.go:421 — Handlers.NodeEvents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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 · Handlers.serveSoloChat (cognitive 17) · ×1
  • Handlers.serveSoloChat (cognitive 17) REDACTED:570 — Handlers.serveSoloChat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 12 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 · Handlers.V1StartRun (cognitive 17) · ×1
  • Handlers.V1StartRun (cognitive 17) server/internal/handlers/v1_handlers.go:84 — Handlers.V1StartRun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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 · mcp.formatMCPAuditAction (cognitive 17) · ×1
  • mcp.formatMCPAuditAction (cognitive 17) server/internal/mcp/audit_summary.go:56 — mcp.formatMCPAuditAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 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 · Host.readReference (cognitive 17) · ×1
  • Host.readReference (cognitive 17) server/internal/mcp/reference.go:34 — Host.readReference has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 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.
D2 · Cognitive Complexity · structured.ParsePreflight (cognitive 17) · ×1
  • structured.ParsePreflight (cognitive 17) server/internal/mcp/structured/preflight.go:56 — structured.ParsePreflight has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, 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 · runtime.mergeAuthEnv (cognitive 17) · ×1
  • runtime.mergeAuthEnv (cognitive 17) server/internal/runtime/acp_backend.go:315 — runtime.mergeAuthEnv 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 · runtime.ApplyModelBinding (cognitive 17) · ×1
  • runtime.ApplyModelBinding (cognitive 17) server/internal/runtime/model_binding.go:34 — runtime.ApplyModelBinding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 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 · acpProvider.CheckGit (cognitive 17) · ×1
  • acpProvider.CheckGit (cognitive 17) server/internal/runtime/acp_review_git.go:20 — acpProvider.CheckGit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6 (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 · services.buildGlobalWorkflowRank (cognitive 17) · ×1
  • services.buildGlobalWorkflowRank (cognitive 17) server/internal/services/global_token_stats.go:1125 — services.buildGlobalWorkflowRank has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 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 · services.ValidateImport (cognitive 17) · ×1
  • services.ValidateImport (cognitive 17) server/internal/services/workflow_import.go:36 — services.ValidateImport has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 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 · CodexLoginManager.renewOnce (cognitive 17) · ×1
  • CodexLoginManager.renewOnce (cognitive 17) server/internal/services/codex_login_manager.go:450 — CodexLoginManager.renewOnce has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, 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 · ModelConfigurationService.validate (cognitive 17) · ×1
  • ModelConfigurationService.validate (cognitive 17) server/internal/services/model_configurations.go:108 — ModelConfigurationService.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 3). 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 · prepare-template.validate (cognitive 17) · ×1
  • prepare-template.validate (cognitive 17) sandbox-gateway/deploy/e2b/prepare-template.py:71 — prepare-template.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. 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 · edgePath.backLaneIndexes (cognitive 17) · ×1
  • edgePath.backLaneIndexes (cognitive 17) web/src/components/canvas/composables/edgePath.ts:220 — edgePath.backLaneIndexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 5). Of this number, 10 points are the body's own statements and 7 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 · tokenAnalyticsCharts.trendChartOption (cognitive 17) · ×1
  • tokenAnalyticsCharts.trendChartOption (cognitive 17) web/src/components/token-analytics/tokenAnalyticsCharts.ts:126 — tokenAnalyticsCharts.trendChartOption has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), boolean chains 6, if/else 4 (nesting depth added 4). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 140, 173, 207). 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 · clarifyReplyText.createReplyText.parseChoiceSummary (cognitive 17) · ×1
  • clarifyReplyText.createReplyText.parseChoiceSummary (cognitive 17) web/src/lib/inbox/clarifyReplyText.ts:118 — clarifyReplyText.createReplyText.parseChoiceSummary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1, ternaries 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 · useGateApproval.useGateApproval.loadProduct (cognitive 17) · ×1
  • useGateApproval.useGateApproval.loadProduct (cognitive 17) web/src/lib/inbox/useGateApproval.ts:859 — useGateApproval.useGateApproval.loadProduct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 3). 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 · useGatesInbox.useGatesInbox.followStep (cognitive 17) · ×1
  • useGatesInbox.useGatesInbox.followStep (cognitive 17) web/src/lib/inbox/useGatesInbox.ts:865 — useGatesInbox.useGatesInbox.followStep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 6, error handling 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 · homeComposerDraft.writeTextFallback (cognitive 17) · ×1
  • homeComposerDraft.writeTextFallback (cognitive 17) web/src/lib/run/homeComposerDraft.ts:135 — homeComposerDraft.writeTextFallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), error handling 2 (5 pts), boolean chains 1, ternaries 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 · runStats.pickDefaultTimelineNodeId (cognitive 17) · ×1
  • runStats.pickDefaultTimelineNodeId (cognitive 17) web/src/lib/run/runStats.ts:171 — runStats.pickDefaultTimelineNodeId has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (5 pts), ternaries 2 (5 pts), boolean chains 4, loops 3 (nesting depth added 5). 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 · useArtifactEditor.useArtifactEditor.save (cognitive 17) · ×1
  • useArtifactEditor.useArtifactEditor.save (cognitive 17) web/src/lib/run/useArtifactEditor.ts:187 — useArtifactEditor.useArtifactEditor.save has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), error handling 1, ternaries 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 · useArtifactPreview.useArtifactPreview (cognitive 17) · ×1
  • useArtifactPreview.useArtifactPreview (cognitive 17) web/src/lib/run/useArtifactPreview.ts:73 — useArtifactPreview.useArtifactPreview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 5 function literals inside it that branch (lines 464, 458, 160, …). 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 · useRunDetailLiveLog.useRunDetailLiveLog.fetchNodeEvents (cognitive 17) · ×1
  • useRunDetailLiveLog.useRunDetailLiveLog.fetchNodeEvents (cognitive 17) web/src/lib/run/useRunDetailLiveLog.ts:110 — useRunDetailLiveLog.useRunDetailLiveLog.fetchNodeEvents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, error handling 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 · useRunDetailLiveLog.useRunDetailLiveLog.fetchSandboxLog (cognitive 17) · ×1
  • useRunDetailLiveLog.useRunDetailLiveLog.fetchSandboxLog (cognitive 17) web/src/lib/run/useRunDetailLiveLog.ts:234 — useRunDetailLiveLog.useRunDetailLiveLog.fetchSandboxLog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 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 · useRunDetailWs.useRunDetailWs.initAfterLoadSuccess (cognitive 17) · ×1
  • useRunDetailWs.useRunDetailWs.initAfterLoadSuccess (cognitive 17) web/src/lib/run/useRunDetailWs.ts:401 — useRunDetailWs.useRunDetailWs.initAfterLoadSuccess has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, if/else 4. 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 · useSoloChat.useSoloChat.openWs (cognitive 17) · ×1
  • useSoloChat.useSoloChat.openWs (cognitive 17) web/src/lib/solo/useSoloChat.ts:752 — useSoloChat.useSoloChat.openWs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (deliver, flushReplay, a function literal at line 806, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ResourceDefaults.Resolve (cognitive 16) · ×1
  • ResourceDefaults.Resolve (cognitive 16) sandbox-gateway/gateway/internal/config/resources.go:19 — ResourceDefaults.Resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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 · Driver.convergeResumed (cognitive 16) · ×1
  • Driver.convergeResumed (cognitive 16) sandbox-gateway/gateway/internal/driver/e2b/driver.go:113 — Driver.convergeResumed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (6 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 · TunnelManager.StartMapped (cognitive 16) · ×1
  • TunnelManager.StartMapped (cognitive 16) sandbox-gateway/gateway/internal/driver/e2b/tunnel.go:191 — TunnelManager.StartMapped has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). 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, 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 · SandboxService.Create (cognitive 16) · ×1
  • SandboxService.Create (cognitive 16) sandbox-gateway/gateway/internal/service/service.go:124 — SandboxService.Create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 7 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 · SandboxService.reconcileOne (cognitive 16) · ×1
  • SandboxService.reconcileOne (cognitive 16) sandbox-gateway/gateway/internal/service/service.go:749 — SandboxService.reconcileOne 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 · engine.hasRemainingHumanGate (cognitive 16) · ×1
  • engine.hasRemainingHumanGate (cognitive 16) server/internal/engine/human_gate_reachability.go:16 — engine.hasRemainingHumanGate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (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 · Engine.restoreReviewSession (cognitive 16) · ×1
  • Engine.restoreReviewSession (cognitive 16) server/internal/engine/review_restore.go:46 — Engine.restoreReviewSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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 · Store.put (cognitive 16) · ×1
  • Store.put (cognitive 16) server/internal/filestore/store.go:148 — Store.put has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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 · Handlers.RenameAgent (cognitive 16) · ×1
  • Handlers.RenameAgent (cognitive 16) server/internal/handlers/agent.go:166 — Handlers.RenameAgent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 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 · Handlers.PublicAppPreviewImage (cognitive 16) · ×1
  • Handlers.PublicAppPreviewImage (cognitive 16) server/internal/handlers/app_preview_images.go:22 — Handlers.PublicAppPreviewImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 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 · Handlers.writeRunArtifactsZIP (cognitive 16) · ×1
  • Handlers.writeRunArtifactsZIP (cognitive 16) server/internal/handlers/artifact_pack.go:64 — Handlers.writeRunArtifactsZIP has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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 · Handlers.cliBackendModels (cognitive 16) · ×1
  • Handlers.cliBackendModels (cognitive 16) server/internal/handlers/cli_catalog.go:24 — Handlers.cliBackendModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 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 · Handlers.GetSoloResources (cognitive 16) · ×1
  • Handlers.GetSoloResources (cognitive 16) REDACTED:206 — Handlers.GetSoloResources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). 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 · Host.prepareDisplacedPreviews (cognitive 16) · ×1
  • Host.prepareDisplacedPreviews (cognitive 16) server/internal/mcp/preview.go:516 — Host.prepareDisplacedPreviews has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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 · Host.nodeComplete (cognitive 16) · ×1
  • Host.nodeComplete (cognitive 16) server/internal/mcp/tools.go:104 — Host.nodeComplete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 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 · structured.RenderResearchMarkdown (cognitive 16) · ×1
  • structured.RenderResearchMarkdown (cognitive 16) server/internal/mcp/structured/doc.go:676 — structured.RenderResearchMarkdown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 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 · structured.ParseMergeRequest (cognitive 16) · ×1
  • structured.ParseMergeRequest (cognitive 16) server/internal/mcp/structured/merge_request.go:44 — structured.ParseMergeRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 2 (4 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 · models.writeLiveMarks (cognitive 16) · ×1
  • models.writeLiveMarks (cognitive 16) server/internal/models/live.go:649 — models.writeLiveMarks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 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 · AgentCapabilities.Validate (cognitive 16) · ×1
  • AgentCapabilities.Validate (cognitive 16) server/internal/models/capabilities.go:70 — AgentCapabilities.Validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2, match/switch 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 · runtime.ApplyCredentialBindings (cognitive 16) · ×1
  • runtime.ApplyCredentialBindings (cognitive 16) server/internal/runtime/credential_selection.go:55 — runtime.ApplyCredentialBindings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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 · acpProvider.ensureOutcome (cognitive 16) · ×1
  • acpProvider.ensureOutcome (cognitive 16) server/internal/runtime/acp_ensure.go:42 — acpProvider.ensureOutcome has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acpProvider.ensurePlanComplete (cognitive 16) · ×1
  • acpProvider.ensurePlanComplete (cognitive 16) server/internal/runtime/acp_ensure.go:280 — acpProvider.ensurePlanComplete 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 · services.normalizeACPKind (cognitive 16) · ×1
  • services.normalizeACPKind (cognitive 16) server/internal/services/acp_text.go:52 — services.normalizeACPKind has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 4, 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 · services.discardLegacyBackups (cognitive 16) · ×1
  • services.discardLegacyBackups (cognitive 16) server/internal/services/solo_backups.go:28 — services.discardLegacyBackups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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 · AgentService.applyAgentExport (cognitive 16) · ×1
  • AgentService.applyAgentExport (cognitive 16) server/internal/services/agent_zip.go:219 — AgentService.applyAgentExport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, loops 1, match/switch 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 · SandboxService.pruneRecoveryPoints (cognitive 16) · ×1
  • SandboxService.pruneRecoveryPoints (cognitive 16) server/internal/services/sandbox_recovery.go:215 — SandboxService.pruneRecoveryPoints 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 · tokenledger.commitReport (cognitive 16) · ×1
  • tokenledger.commitReport (cognitive 16) server/internal/tokenledger/ledger.go:176 — tokenledger.commitReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 192). 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 · prepare-template.prepare (cognitive 16) · ×1
  • prepare-template.prepare (cognitive 16) sandbox-gateway/deploy/e2b/prepare-template.py:199 — prepare-template.prepare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (3 pts) (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 · home.renderApproveList (cognitive 16) · ×1
  • home.renderApproveList (cognitive 16) docs/site/js/home.js:799 — home.renderApproveList has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts) (nesting depth added 2). 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 · authGuard.installAuthGuard (cognitive 16) · ×1
  • authGuard.installAuthGuard (cognitive 16) web/src/lib/shared/authGuard.ts:18 — authGuard.installAuthGuard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (7 pts), boolean chains 1 (nesting depth added 8). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 19, 32). 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 · clarifyDemo.restoreChoiceAnswers (cognitive 16) · ×1
  • clarifyDemo.restoreChoiceAnswers (cognitive 16) web/src/lib/inbox/clarifyDemo.ts:53 — clarifyDemo.restoreChoiceAnswers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 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 · useGatesInbox.useGatesInbox.fillFollowFromNodeEvents (cognitive 16) · ×1
  • useGatesInbox.useGatesInbox.fillFollowFromNodeEvents (cognitive 16) web/src/lib/inbox/useGatesInbox.ts:698 — useGatesInbox.useGatesInbox.fillFollowFromNodeEvents has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 7, error handling 1, ternaries 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 · useGatesInbox.useGatesInbox.recordedHandoffSuccessor (cognitive 16) · ×1
  • useGatesInbox.useGatesInbox.recordedHandoffSuccessor (cognitive 16) web/src/lib/inbox/useGatesInbox.ts:777 — useGatesInbox.useGatesInbox.recordedHandoffSuccessor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7 (nesting depth added 3). Of this number, 14 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 · runStats.aggregateMultiRuns (cognitive 16) · ×1
  • runStats.aggregateMultiRuns (cognitive 16) web/src/lib/run/runStats.ts:402 — runStats.aggregateMultiRuns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useExecutionStats.useExecutionStats.candidateGroups (cognitive 16) · ×1
  • useExecutionStats.useExecutionStats.candidateGroups (cognitive 16) web/src/lib/run/useExecutionStats.ts:457 — useExecutionStats.useExecutionStats.candidateGroups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2, 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 · useReferenceSearch.useReferenceSearch.run (cognitive 16) · ×1
  • useReferenceSearch.useReferenceSearch.run (cognitive 16) web/src/lib/solo/useReferenceSearch.ts:97 — useReferenceSearch.useReferenceSearch.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 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 · useReferenceComposer.useReferenceComposer.onKeydown (cognitive 16) · ×1
  • useReferenceComposer.useReferenceComposer.onKeydown (cognitive 16) web/src/lib/solo/useReferenceComposer.ts:143 — useReferenceComposer.useReferenceComposer.onKeydown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 2 (6 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 · deviceLogin.useDeviceLogin.poll (cognitive 16) · ×1
  • deviceLogin.useDeviceLogin.poll (cognitive 16) web/src/lib/workspace/deviceLogin.ts:105 — deviceLogin.useDeviceLogin.poll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 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 · overlay.createOverlay.syncViews (cognitive 16) · ×1
  • overlay.createOverlay.syncViews (cognitive 16) web/src/liveoverlay/overlay.ts:230 — overlay.createOverlay.syncViews has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 2 (4 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 28 shared lines) · ×1
  • Near-duplicate member family (4 members, 28 shared lines) server/internal/handlers/gate_share_public.go:179 — server/internal/handlers/gate_share_public.go:179-277 | server/internal/handlers/gate_share_public.go:303-380 | server/internal/handlers/gate_share_public.go:394-448 | server/internal/handlers/gate_share_public.go:450-504 — These 4 members are variants of one another: a block of 28 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 family (3 members, 20 shared lines) · ×1
  • Near-duplicate member family (3 members, 20 shared lines) sandbox-gateway/sandbox/internal/provider/attach.go:124 — sandbox-gateway/sandbox/internal/provider/attach.go:124-146 | server/internal/runtime/profile_path.go:25-47 | server/internal/services/agent.go:330-352 — These 3 members are variants of one another: a block of 20 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 3 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 3 times.
D4 · Code Duplication · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) server/internal/runtime/acp_react.go:124 — server/internal/runtime/acp_react.go:124-298 | server/internal/runtime/acp_react.go:308-412 — These two members are variants of one another: 46 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 (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) server/internal/handlers/embed.go:134 — server/internal/handlers/embed.go:134-198 | server/internal/handlers/gate_share_public.go:74-136 | server/internal/handlers/gate_share_public.go:140-177 | server/internal/handlers/gate_share_public_images.go:20-66 | server/internal/handlers/gate_share_public_preview.go:27-108 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) server/internal/gateshare/review.go:108 — server/internal/gateshare/review.go:108-173 | server/internal/gateshare/review.go:176-238 | server/internal/gateshare/service.go:267-335 | server/internal/gateshare/service.go:338-400 — 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 (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) server/internal/services/inbox.go:269 — server/internal/services/inbox.go:269-333 | server/internal/services/inbox.go:340-400 — These two members are one piece of code written twice and then edited apart: 61 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 (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) server/internal/runtime/acp_ensure.go:42 — server/internal/runtime/acp_ensure.go:42-88 | server/internal/runtime/acp_ensure.go:100-136 — 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 (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) server/internal/gateshare/review.go:241 — server/internal/gateshare/review.go:241-280 | server/internal/gateshare/service.go:403-441 — These two members are one piece of code written twice and then edited apart: 39 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) server/internal/mcp/conversation_history.go:60 — server/internal/mcp/conversation_history.go:60-99 | server/internal/mcp/reference.go:34-77 — 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 copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) server/internal/gateshare/preview.go:116 — server/internal/gateshare/preview.go:116-154 | server/internal/gateshare/preview.go:157-192 — 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 (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) server/internal/gateshare/review.go:13 — server/internal/gateshare/review.go:13-47 | server/internal/gateshare/service.go:229-264 — 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 (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) server/internal/handlers/run.go:257 — server/internal/handlers/run.go:257-280 | server/internal/handlers/v1_handlers.go:201-229 — 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 copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) sandbox-gateway/sandbox/internal/provider/codex/codex.go:272 — sandbox-gateway/sandbox/internal/provider/codex/codex.go:272-305 | server/internal/runtime/codex_auth.go:281-333 — 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 copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) server/internal/mcp/plan.go:336 — server/internal/mcp/plan.go:336-361 | server/internal/mcp/plan.go:363-392 — 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 copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) server/internal/handlers/gate.go:268 — server/internal/handlers/gate.go:268-281 | server/internal/handlers/gate.go:284-297 | server/internal/handlers/gate.go:300-318 | server/internal/handlers/gate.go:321-339 — These 4 members are one piece of code written 4 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 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) sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:773 — sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:773-792 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:794-813 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:1071-1090 — 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 (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) REDACTED:92 — REDACTED:92-109 | REDACTED:112-128 | REDACTED:172-188 | REDACTED:242-260 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 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, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) REDACTED:38 — REDACTED:38-50 | REDACTED:169-181 | REDACTED:205-216 | REDACTED:219-233 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) server/internal/engine/start_run.go:48 — server/internal/engine/start_run.go:48-63 | server/internal/engine/start_run.go:88-101 | server/internal/engine/start_run.go:108-124 — 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 · Edited copies of one member (6 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 11+ corresponding lines) server/internal/handlers/gate_share.go:48 — server/internal/handlers/gate_share.go:48-61 | server/internal/handlers/gate_share.go:76-87 | server/internal/handlers/gate_share.go:89-99 | server/internal/handlers/review_share.go:12-25 | server/internal/handlers/review_share.go:40-51 | server/internal/handlers/review_share.go:53-63 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) sandbox-gateway/gateway/internal/config/types.go:61 — sandbox-gateway/gateway/internal/config/types.go:61-75 | sandbox-gateway/gateway/internal/driver/kubernetes/kubernetes.go:938-952 | sandbox-gateway/gateway/internal/service/service.go:837-851 — 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 (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) REDACTED:191 — REDACTED:191-202 | REDACTED:301-312 | REDACTED:315-326 | REDACTED:329-340 | REDACTED:370-381 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) server/internal/handlers/agent.go:20 — server/internal/handlers/agent.go:20-27 | server/internal/handlers/artifact.go:82-89 | server/internal/handlers/run.go:248-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) server/internal/mcp/history.go:92 — server/internal/mcp/history.go:92-102 | server/internal/mcp/structured/doc.go:890-902 | server/internal/modelrouting/reasoning.go:71-82 — 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 · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) REDACTED:130 — REDACTED:130-136 | server/internal/embed/store.go:66-72 | server/internal/gateshare/token.go:22-28 | server/internal/services/apikey.go:100-106 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) server/internal/browser/rod.go:471 — server/internal/browser/rod.go:471-482 | server/internal/services/sandbox_solo_recovery.go:204-216 | server/internal/services/sandbox_studio.go:694-705 — 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 copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) server/internal/services/sandbox_solo_recovery.go:71 — server/internal/services/sandbox_solo_recovery.go:71-75 | server/internal/services/sandbox_solo_stop.go:49-53 — 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 copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) server/internal/embed/store.go:61 — server/internal/embed/store.go:61-64 | server/internal/gateshare/token.go:31-34 — 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 (82–84 lines × 2) · ×1
  • Duplicated block (82–84 lines × 2) REDACTED:136 — REDACTED:136-217 | server/internal/sandbox/gateway_bridge.go:179-262 — 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:136` 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 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. Check import visibility before settling on that home: `REDACTED`, `server/internal/sandbox/gateway_bridge.go` sit 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) server/internal/gateshare/service.go:297 — server/internal/gateshare/service.go:297-319 | server/internal/gateshare/service.go:360-382 — 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 after the matched lines, `server/internal/gateshare/service.go:383` calls `notifyInvalidated` and `server/internal/gateshare/service.go:320` 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 (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) sandbox-gateway/sandbox/internal/provider/attach.go:127 — sandbox-gateway/sandbox/internal/provider/attach.go:127-146 | server/internal/runtime/profile_path.go:28-47 | server/internal/services/agent.go:333-352 — 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 `sandbox-gateway/sandbox/internal/provider/attach.go:127` 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: `sandbox-gateway/sandbox/internal/provider/attach.go`, `server/internal/runtime/profile_path.go`, `server/internal/services/agent.go` sit 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) server/internal/runtime/acp_react.go:126 — server/internal/runtime/acp_react.go:126-142 | server/internal/runtime/acp_react.go:309-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `ReactTurn` to `force bool) (out` in one and `images []models.PromptImage) (out` 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 (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) server/internal/handlers/gate_share_public.go:198 — server/internal/handlers/gate_share_public.go:198-213 | server/internal/handlers/gate_share_public.go:318-333 | server/internal/handlers/gate_share_public.go:409-424 | server/internal/handlers/gate_share_public.go:465-480 — 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 `server/internal/handlers/gate_share_public.go:198` 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 (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) server/internal/handlers/gate_share_public_preview.go:236 — server/internal/handlers/gate_share_public_preview.go:236-247 | server/internal/handlers/preview.go:80-95 — 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 `server/internal/handlers/gate_share_public_preview.go:236` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `server/internal/handlers/preview.go:96` calls `EnsureRunningByName`, `Context`, `Is` and `server/internal/handlers/gate_share_public_preview.go:248` 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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) server/internal/handlers/gate_share_public_preview.go:251 — server/internal/handlers/gate_share_public_preview.go:251-265 | server/internal/handlers/preview.go:110-125 — 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 `server/internal/handlers/gate_share_public_preview.go:251` 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) server/internal/mcp/plan.go:138 — server/internal/mcp/plan.go:138-152 | server/internal/mcp/structured/root_cause.go:195-207 — 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) server/internal/runtime/acp_ensure.go:76 — server/internal/runtime/acp_ensure.go:76-88 | server/internal/runtime/acp_ensure.go:123-136 | server/internal/runtime/acp_ensure.go:239-251 — 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 `server/internal/runtime/acp_ensure.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/internal/runtime/acp_ensure.go:74` calls `Warn`, `Err`, `Str` and `server/internal/runtime/acp_ensure.go:238` 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–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) REDACTED:109 — REDACTED:109-121 | server/internal/handlers/ws.go:100-113 — 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:109` 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 (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) server/internal/services/sandbox_studio.go:103 — server/internal/services/sandbox_studio.go:103-116 | server/internal/services/sandbox_studio.go:135-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) server/internal/handlers/gate_share_public.go:180 — server/internal/handlers/gate_share_public.go:180-191 | server/internal/handlers/gate_share_public.go:304-315 | server/internal/handlers/gate_share_public.go:395-406 | server/internal/handlers/gate_share_public.go:451-462 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) server/internal/handlers/embed.go:151 — server/internal/handlers/embed.go:151-161 | server/internal/handlers/gate_share_public.go:152-162 | server/internal/handlers/gate_share_public_images.go:35-45 | server/internal/handlers/gate_share_public_preview.go:58-68 — 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 `server/internal/handlers/embed.go:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) server/internal/handlers/app_preview_cancel.go:15 — server/internal/handlers/app_preview_cancel.go:15-25 | server/internal/handlers/app_preview_share.go:283-293 | server/internal/handlers/preview_model.go:173-183 — 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 · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) server/internal/handlers/embed.go:164 — server/internal/handlers/embed.go:164-173 | server/internal/handlers/gate_share_public.go:212-221 | server/internal/handlers/gate_share_public.go:423-432 | server/internal/handlers/gate_share_public.go:479-488 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/internal/handlers/embed.go:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) server/internal/gateshare/review.go:143 — server/internal/gateshare/review.go:143-149 | server/internal/gateshare/review.go:206-212 | server/internal/gateshare/service.go:306-312 | server/internal/gateshare/service.go:369-375 — before extracting anything, compare `server/internal/gateshare/review.go` and `server/internal/gateshare/service.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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 `server/internal/gateshare/review.go:143` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `server/internal/gateshare/service.go:305` calls `gateIDPtr` and `server/internal/gateshare/review.go:142` 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) server/internal/engine/review_session.go:962 — server/internal/engine/review_session.go:962-968 | server/internal/engine/visitor_lane.go:371-376 — 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 `server/internal/engine/review_session.go:962` 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) server/internal/engine/visitor_lane.go:500 — server/internal/engine/visitor_lane.go:500-506 | server/internal/models/models.go:666-672 | server/internal/services/solo.go:427-433 — 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) server/internal/runtime/acp_ensure.go:68 — server/internal/runtime/acp_ensure.go:68-75 | server/internal/runtime/acp_ensure.go:117-120 | server/internal/runtime/acp_ensure.go:297-301 — 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 `server/internal/runtime/acp_ensure.go:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) REDACTED:75 — REDACTED:75-115 | server/scripts/grasp-mcp-spa-proxy.py:75-115 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) REDACTED:176 — REDACTED:176-203 | server/scripts/grasp-mcp-spa-proxy.py:176-203 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) REDACTED:37 — REDACTED:37-60 | server/scripts/grasp-mcp-spa-proxy.py:37-60 — before extracting anything, compare `REDACTED` and `server/scripts/grasp-mcp-spa-proxy.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 131 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 · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) sandbox-gateway/sandbox/internal/acp/panel.go:381 — sandbox-gateway/sandbox/internal/acp/panel.go:381-411 | sandbox-gateway/sandbox/internal/acp/panel.go:419-445 | sandbox-gateway/sandbox/internal/acp/panel.go:459-481 | sandbox-gateway/sandbox/internal/acp/panel.go:488-513 | sandbox-gateway/sandbox/internal/acp/panel.go:515-530 | sandbox-gateway/sandbox/internal/acp/panel.go:532-546 | sandbox-gateway/sandbox/internal/acp/panel.go:548-562 — These 7 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 7 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 7 times.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) server/internal/sandbox/artifactcli.go:52 — server/internal/sandbox/artifactcli.go:52-97 | server/internal/sandbox/confighome_seed.go:40-80 — These two members are one piece of code written twice and then edited apart: 41 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) server/internal/sandbox/ssh.go:393 — server/internal/sandbox/ssh.go:393-438 | server/internal/sandbox/ssh.go:447-490 — 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 copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) server/internal/sandbox/sandboxtest/fakegw.go:283 — server/internal/sandbox/sandboxtest/fakegw.go:283-300 | server/internal/sandbox/sandboxtest/fakegw.go:313-330 | server/internal/sandbox/sandboxtest/fakegw.go:401-418 — 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 (5 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 6+ corresponding lines) sandbox-gateway/sandbox/internal/provider/antigravity/antigravity.go:32 — sandbox-gateway/sandbox/internal/provider/antigravity/antigravity.go:32-37 | sandbox-gateway/sandbox/internal/provider/copilot/copilot.go:28-33 | sandbox-gateway/sandbox/internal/provider/openclaw/openclaw.go:41-46 | sandbox-gateway/sandbox/internal/provider/opencodejson/opencodejson.go:37-42 | sandbox-gateway/sandbox/internal/provider/pi/pi.go:36-41 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 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 · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) sandbox-gateway/sandbox/internal/acp/conn.go:389 — sandbox-gateway/sandbox/internal/acp/conn.go:389-395 | sandbox-gateway/sandbox/internal/acp/conn.go:405-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sandbox-gateway/sandbox/internal/acp/conn.go:405` 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.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) sandbox-gateway/sandbox/internal/acp/panel.go:385 — sandbox-gateway/sandbox/internal/acp/panel.go:385-390 | sandbox-gateway/sandbox/internal/acp/panel.go:423-428 | sandbox-gateway/sandbox/internal/acp/panel.go:463-468 | sandbox-gateway/sandbox/internal/acp/panel.go:492-497 | sandbox-gateway/sandbox/internal/acp/panel.go:519-524 | sandbox-gateway/sandbox/internal/acp/panel.go:536-541 | sandbox-gateway/sandbox/internal/acp/panel.go:552-557 — all 7 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience server/internal/handlers/preview-pick.js:2124 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (63 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (63 clone groups) web/src/components/run/ExecutionStatsPanel.vue:16 — 63 duplicated blocks under web/src/ have copies in at least two of the sibling directories components, lib, views — 41 of them are reported below, and 22 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 63 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 63 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 63 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 11 sibling directories (31 clone groups) · ×1
  • Duplication concentrated across 11 sibling directories (31 clone groups) web/src/components/ui/AppSelect.vue:55 — 31 duplicated blocks under web/src/components/ have copies in at least two of the sibling directories agent, canvas, chat, dashboard, run, shell (+5 more sibling(s) not listed) — 20 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 31 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 31 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 31 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (19 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (19 clone groups) web/src/lib/inbox/useGatesInbox.ts:3585 — 19 duplicated blocks under web/src/lib/ have copies in at least two of the sibling directories agent, composables, inbox, run, shared, solo (+1 more sibling(s) not listed) — 17 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (175 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (175 matched lines × 2 locations) web/src/components/ui/AppSelect.vue:55 — web/src/components/ui/AppSelect.vue:55 · web/src/components/workspace/AuditFilterDropdown.vue:46 — the two spans are one implementation copied and then locally edited — 1556 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 with local edits (140 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (140 matched lines × 2 locations) web/src/components/agent/AgentTemplateSelect.vue:18 — web/src/components/agent/AgentTemplateSelect.vue:18 · web/src/components/dashboard/HomeWorkflowSelect.vue:6 — the two spans are one implementation copied and then locally edited — 930 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 with local edits (76 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (76 matched lines × 2 locations) web/src/lib/inbox/embedDemoPreview.ts:8 — web/src/lib/inbox/embedDemoPreview.ts:8 · web/src/lib/inbox/embedImagePreview.ts:14 — the two spans are one implementation copied and then locally edited — 553 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 (63 lines × 2 locations) · ×1
  • Duplicated block (63 lines × 2 locations) web/src/components/run/ExecutionStatsPanel.vue:16 — web/src/components/run/ExecutionStatsPanel.vue:16 · web/src/lib/run/useExecutionStats.ts:602 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block with local edits (58 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (58 matched lines × 2 locations) web/src/components/workspace/CodexDeviceLoginCard.vue:9 — web/src/components/workspace/CodexDeviceLoginCard.vue:9 · web/src/components/workspace/GitHubDeviceLoginCard.vue:9 — the two spans are one implementation copied and then locally edited — 665 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 with local edits (57 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (57 matched lines × 2 locations) web/src/views/EmbedNodeDemoView.vue:14 — web/src/views/EmbedNodeDemoView.vue:14 · web/src/views/EmbedNodeImageView.vue:18 — the two spans are one implementation copied and then locally edited — 424 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 with local edits (50 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (50 matched lines × 2 locations) web/src/components/agent/AgentChatTester.vue:920 — web/src/components/agent/AgentChatTester.vue:920 · web/src/lib/solo/acpTurn.ts:52 — the two spans are one implementation copied and then locally edited — 729 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) web/src/lib/run/useRunDetail.ts:1698 — web/src/lib/run/useRunDetail.ts:1698 · web/src/views/RunDetailView.vue:146 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block with local edits (42 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (42 matched lines × 2 locations) web/src/lib/solo/useSessionModelCatalog.ts:26 — web/src/lib/solo/useSessionModelCatalog.ts:26 · web/src/lib/solo/useSoloLauncher.ts:33 — the two spans are one implementation copied and then locally edited — 412 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 with local edits (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) web/src/components/ui/StatusFilter.vue:15 — web/src/components/ui/StatusFilter.vue:15 · web/src/components/ui/TagFilter.vue:22 — the two spans are one implementation copied and then locally edited — 295 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 (38 lines × 2 locations) · ×1
  • Duplicated block (38 lines × 2 locations) web/src/components/run/gateApproval/GateApprovalContentFit.vue:67 — web/src/components/run/gateApproval/GateApprovalContentFit.vue:67 · web/src/components/run/gateApproval/GateApprovalMobileFill.vue:58 — 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 (36 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (36 matched lines × 2 locations) web/src/components/run/RunClarifyPanel.vue:74 — web/src/components/run/RunClarifyPanel.vue:74 · web/src/components/run/RunReviewPanel.vue:66 — the two spans are one implementation copied and then locally edited — 290 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 with local edits (35 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (35 matched lines × 2 locations) web/src/components/token-analytics/tokenAnalyticsCharts.ts:433 — web/src/components/token-analytics/tokenAnalyticsCharts.ts:433 · web/src/views/TokenAnalyticsView.vue:267 — the two spans are one implementation copied and then locally edited — 347 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 (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) web/src/lib/run/runStats.ts:264 — web/src/lib/run/runStats.ts:264 · web/src/lib/run/runStats.ts:299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (33 lines × 2 locations) · ×1
  • Duplicated block (33 lines × 2 locations) web/src/lib/agent/useAgentStudio.ts:928 — web/src/lib/agent/useAgentStudio.ts:928 · web/src/views/AgentStudioView.vue:74 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) web/src/components/run/ClarifyChat.vue:367 — web/src/components/run/ClarifyChat.vue:367 · web/src/lib/inbox/useClarifyChat.ts:1631 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication · Duplicated block with local edits (31 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (31 matched lines × 2 locations) web/src/views/EmbedNodeArtifactsView.vue:153 — web/src/views/EmbedNodeArtifactsView.vue:153 · web/src/views/PublicGateApprovalView.vue:507 — the two spans are one implementation copied and then locally edited — 190 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 (28 lines × 2 locations) · ×1
  • Duplicated block (28 lines × 2 locations) web/src/lib/inbox/useGatesInbox.ts:3585 — web/src/lib/inbox/useGatesInbox.ts:3585 · web/src/lib/run/useRunDetail.ts:844 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) web/src/components/run/gateApproval/GateApprovalContentFit.vue:18 — web/src/components/run/gateApproval/GateApprovalContentFit.vue:18 · web/src/components/run/gateApproval/GateApprovalDesktopBody.vue:16 — the two spans are one implementation copied and then locally edited — 70 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 (25 lines × 2 locations) · ×1
  • Duplicated block (25 lines × 2 locations) web/src/lib/workspace/useWorkflows.ts:173 — web/src/lib/workspace/useWorkflows.ts:173 · web/src/views/DashboardView.vue:413 — 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 (24 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (24 matched lines × 2 locations) web/src/components/agent/AgentSidebar.vue:80 — web/src/components/agent/AgentSidebar.vue:80 · web/src/components/shell/SidebarAccountMenu.vue:68 — the two spans are one implementation copied and then locally edited — 167 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 (22 lines × 2 locations) · ×1
  • Duplicated block (22 lines × 2 locations) REDACTED:224 — REDACTED:224 · REDACTED:334 — 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.
R10 · Code Duplication · Duplicated block with local edits (22 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (22 matched lines × 2 locations) web/src/views/AgentStudioView.vue:171 — web/src/views/AgentStudioView.vue:171 · web/src/views/AgentStudioView.vue:197 — the two spans are one implementation copied and then locally edited — 105 tokens are still identical, in the same order in both spans, 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 (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) web/src/lib/inbox/useGatesInbox.ts:1822 — web/src/lib/inbox/useGatesInbox.ts:1822 · web/src/lib/run/useRunDetail.ts:284 — 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 (19 lines × 2 locations) · ×1
  • Duplicated block (19 lines × 2 locations) web/src/lib/run/useRunDetail.ts:889 — web/src/lib/run/useRunDetail.ts:889 · web/src/lib/run/useRunDetail.ts:945 — 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 (17 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (17 matched lines × 2 locations) web/src/components/run/ClarifyBootLoader.vue:40 — web/src/components/run/ClarifyBootLoader.vue:40 · web/src/components/solo/SoloStartupCard.vue:29 — the two spans are one implementation copied and then locally edited — 115 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 onFrame (cyclomatic 108, cognitive 165) · ×1
  • Complex function onFrame (cyclomatic 108, cognitive 165) web/src/lib/inbox/useGatesInbox.ts:2400 — onFrame has cyclomatic complexity 108 and cognitive complexity 165; 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 onFrame (cyclomatic 82, cognitive 105) · ×1
  • Complex function onFrame (cyclomatic 82, cognitive 105) web/src/lib/solo/useSoloChat.ts:609 — onFrame has cyclomatic complexity 82 and cognitive complexity 105; 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 onClarifySend (cyclomatic 70, cognitive 119) · ×1
  • Complex function onClarifySend (cyclomatic 70, cognitive 119) web/src/lib/inbox/useGatesInbox.ts:3322 — onClarifySend has cyclomatic complexity 70 and cognitive complexity 119; 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 renderSwitchers (cyclomatic 67, cognitive 106) · ×1
  • Complex function renderSwitchers (cyclomatic 67, cognitive 106) web/src/liveoverlay/overlay.ts:570 — renderSwitchers has cyclomatic complexity 67 and cognitive complexity 106; 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 59, cognitive 54) · ×1
  • Complex function (anonymous) (cyclomatic 59, cognitive 54) web/src/liveoverlay/overlay.ts:1132 — (anonymous) has cyclomatic complexity 59 and cognitive complexity 54; 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 fetch (cyclomatic 57, cognitive 72) · ×1
  • Complex function fetch (cyclomatic 57, cognitive 72) web/e2e/workspace-main.ts:50 — fetch has cyclomatic complexity 57 and cognitive complexity 72; 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 applyReviewFrame (cyclomatic 54, cognitive 71) · ×1
  • Complex function applyReviewFrame (cyclomatic 54, cognitive 71) web/src/lib/inbox/useGateApproval.ts:1501 — applyReviewFrame has cyclomatic complexity 54 and cognitive complexity 71; 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 recoverClarifySession (cyclomatic 53, cognitive 46) · ×1
  • Complex function recoverClarifySession (cyclomatic 53, cognitive 46) web/src/lib/inbox/useGatesInbox.ts:2727 — recoverClarifySession has cyclomatic complexity 53 and cognitive complexity 46; 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 fetch (cyclomatic 50, cognitive 78) · ×1
  • Complex function fetch (cyclomatic 50, cognitive 78) web/e2e/gate-share-link-main.ts:181 — fetch has cyclomatic complexity 50 and cognitive complexity 78; 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 onDrawer (cyclomatic 47, cognitive 77) · ×1
  • Complex function onDrawer (cyclomatic 47, cognitive 77) web/src/liveoverlay/overlay.ts:1317 — onDrawer has cyclomatic complexity 47 and cognitive complexity 77; 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 applyRun (cyclomatic 44, cognitive 48) · ×1
  • Complex function applyRun (cyclomatic 44, cognitive 48) web/src/lib/run/useRunLive.ts:305 — applyRun has cyclomatic complexity 44 and cognitive complexity 48; 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 onFrame (cyclomatic 43, cognitive 62) · ×1
  • Complex function onFrame (cyclomatic 43, cognitive 62) web/src/lib/run/useRunLive.ts:505 — onFrame has cyclomatic complexity 43 and cognitive complexity 62; 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 onSend (cyclomatic 42, cognitive 57) · ×1
  • Complex function onSend (cyclomatic 42, cognitive 57) web/src/views/PublicGateApprovalView.vue:1061 — onSend has cyclomatic complexity 42 and cognitive complexity 57; 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 onFrame (cyclomatic 38, cognitive 57) · ×1
  • Complex function onFrame (cyclomatic 38, cognitive 57) web/src/lib/run/useRunDetailWs.ts:493 — onFrame has cyclomatic complexity 38 and cognitive complexity 57; 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 validateScenario (cyclomatic 38, cognitive 51) · ×1
  • Complex function validateScenario (cyclomatic 38, cognitive 51) sandbox-gateway/scripts/mock-agent-model.mjs:131 — validateScenario 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 collectGraphIssues (cyclomatic 37, cognitive 63) · ×1
  • Complex function collectGraphIssues (cyclomatic 37, cognitive 63) web/src/components/canvas/composables/useGraphIssues.ts:17 — collectGraphIssues has cyclomatic complexity 37 and cognitive complexity 63; 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 resolveAction (cyclomatic 37, cognitive 62) · ×1
  • Complex function resolveAction (cyclomatic 37, cognitive 62) sandbox-gateway/scripts/mock-agent-model.mjs:163 — resolveAction has cyclomatic complexity 37 and cognitive complexity 62; 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 req (cyclomatic 37, cognitive 58) · ×1
  • Complex function req (cyclomatic 37, cognitive 58) web/src/lib/api/httpCore.ts:81 — req has cyclomatic complexity 37 and cognitive complexity 58; 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 pruneObject (cyclomatic 37, cognitive 50) · ×1
  • Complex function pruneObject (cyclomatic 37, cognitive 50) web/src/lib/run/artifactForms.ts:405 — pruneObject has cyclomatic complexity 37 and cognitive complexity 50; 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 37, cognitive 48) · ×1
  • Complex function (anonymous) (cyclomatic 37, cognitive 48) web/e2e/inbox-confirm-leave.spec.ts:100 — (anonymous) has cyclomatic complexity 37 and cognitive complexity 48; 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 loadActiveRun (cyclomatic 36, cognitive 44) · ×1
  • Complex function loadActiveRun (cyclomatic 36, cognitive 44) web/src/lib/inbox/useGatesInbox.ts:2899 — loadActiveRun has cyclomatic complexity 36 and cognitive complexity 44; 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 create (cyclomatic 36, cognitive 34) · ×1
  • Complex function create (cyclomatic 36, cognitive 34) web/src/components/workspace/WorkspaceCredentialsPanel.vue:636 — create has cyclomatic complexity 36 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 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 onClarifySend (cyclomatic 35, cognitive 46) · ×1
  • Complex function onClarifySend (cyclomatic 35, cognitive 46) web/src/lib/run/useRunDetail.ts:737 — onClarifySend has cyclomatic complexity 35 and cognitive complexity 46; 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 configuredModelChoices (cyclomatic 35, cognitive 39) · ×1
  • Complex function configuredModelChoices (cyclomatic 35, cognitive 39) web/src/lib/solo/configuredModels.ts:62 — configuredModelChoices has cyclomatic complexity 35 and cognitive complexity 39; 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 35, cognitive 30) · ×1
  • Complex function (anonymous) (cyclomatic 35, cognitive 30) web/src/components/canvas/composables/useFlowElements.ts:134 — (anonymous) has cyclomatic complexity 35 and cognitive complexity 30; 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 seed (cyclomatic 35, cognitive 26) · ×1
  • Complex function seed (cyclomatic 35, cognitive 26) web/src/lib/run/useRunLive.ts:473 — seed has cyclomatic complexity 35 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 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 parseMarks (cyclomatic 34, cognitive 52) · ×1
  • Complex function parseMarks (cyclomatic 34, cognitive 52) web/src/lib/inbox/liveVariants.ts:135 — parseMarks has cyclomatic complexity 34 and cognitive complexity 52; 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 resolveShortcut (cyclomatic 34, cognitive 40) · ×1
  • Complex function resolveShortcut (cyclomatic 34, cognitive 40) web/src/components/canvas/composables/useCanvasShortcuts.ts:70 — resolveShortcut has cyclomatic complexity 34 and cognitive complexity 40; 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 mergeReconnectHistory (cyclomatic 34, cognitive 39) · ×1
  • Complex function mergeReconnectHistory (cyclomatic 34, cognitive 39) web/src/components/agent/AgentChatTester.vue:695 — mergeReconnectHistory has cyclomatic complexity 34 and cognitive complexity 39; 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 parseEmbedLiveMessage (cyclomatic 34, cognitive 39) · ×1
  • Complex function parseEmbedLiveMessage (cyclomatic 34, cognitive 39) web/src/lib/inbox/liveVariants.ts:201 — parseEmbedLiveMessage has cyclomatic complexity 34 and cognitive complexity 39; 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 fetch (cyclomatic 34, cognitive 38) · ×1
  • Complex function fetch (cyclomatic 34, cognitive 38) web/e2e/notifications-center-main.ts:341 — fetch has cyclomatic complexity 34 and cognitive complexity 38; 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 submitFinal (cyclomatic 33, cognitive 35) · ×1
  • Complex function submitFinal (cyclomatic 33, cognitive 35) web/src/views/PublicGateApprovalView.vue:1005 — submitFinal has cyclomatic complexity 33 and cognitive complexity 35; 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 selfIntersects (cyclomatic 32, cognitive 71) · ×1
  • Complex function selfIntersects (cyclomatic 32, cognitive 71) web/src/components/canvas/composables/canvasHelpers.test.ts:118 — selfIntersects has cyclomatic complexity 32 and cognitive complexity 71; 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 loadPreview (cyclomatic 32, cognitive 39) · ×1
  • Complex function loadPreview (cyclomatic 32, cognitive 39) web/src/views/PublicGateApprovalView.vue:572 — loadPreview has cyclomatic complexity 32 and cognitive complexity 39; 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 32, cognitive 36) · ×1
  • Complex function (anonymous) (cyclomatic 32, cognitive 36) web/e2e/preview-review-inbox.spec.ts:89 — (anonymous) has cyclomatic complexity 32 and cognitive complexity 36; 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 31, cognitive 67) · ×1
  • Complex function (anonymous) (cyclomatic 31, cognitive 67) web/src/lib/composables/useTestScreenshotLoad.ts:130 — (anonymous) has cyclomatic complexity 31 and cognitive complexity 67; 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 workflowGraphError (cyclomatic 31, cognitive 43) · ×1
  • Complex function workflowGraphError (cyclomatic 31, cognitive 43) web/src/lib/workflow/graphValidation.ts:27 — workflowGraphError has cyclomatic complexity 31 and cognitive complexity 43; 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 startRun (cyclomatic 31, cognitive 31) · ×1
  • Complex function startRun (cyclomatic 31, cognitive 31) web/src/components/workflow/RunLaunchModal.vue:341 — startRun has cyclomatic complexity 31 and cognitive complexity 31; 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 rebuildTurnsFromFrames (cyclomatic 30, cognitive 40) · ×1
  • Complex function rebuildTurnsFromFrames (cyclomatic 30, cognitive 40) web/src/components/agent/AgentChatTester.vue:636 — rebuildTurnsFromFrames has cyclomatic complexity 30 and cognitive complexity 40; 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 30, cognitive 32) · ×1
  • Complex function (anonymous) (cyclomatic 30, cognitive 32) web/e2e/clarify-empty-preview.spec.ts:68 — (anonymous) has cyclomatic complexity 30 and cognitive complexity 32; 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.
R3 · Large Files · web/src/lib/inbox/useGatesInbox.ts · ×1
  • web/src/lib/inbox/useGatesInbox.ts: 3675 lines of code web/src/lib/inbox/useGatesInbox.ts:1 — web/src/lib/inbox/useGatesInbox.ts has 3675 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/inbox/useGateApproval.ts · ×1
  • web/src/lib/inbox/useGateApproval.ts: 2064 lines of code web/src/lib/inbox/useGateApproval.ts:1 — web/src/lib/inbox/useGateApproval.ts has 2064 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/run/ClarifyChat.vue · ×1
  • web/src/components/run/ClarifyChat.vue: 2033 lines of code web/src/components/run/ClarifyChat.vue:1 — web/src/components/run/ClarifyChat.vue has 2033 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/shell/AppSidebarNav.vue · ×1
  • web/src/components/shell/AppSidebarNav.vue: 1905 lines of code web/src/components/shell/AppSidebarNav.vue:1 — web/src/components/shell/AppSidebarNav.vue has 1905 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/run/ReactArtifactStage.vue · ×1
  • web/src/components/run/ReactArtifactStage.vue: 1895 lines of code web/src/components/run/ReactArtifactStage.vue:1 — web/src/components/run/ReactArtifactStage.vue has 1895 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/DashboardView.vue · ×1
  • web/src/views/DashboardView.vue: 1835 lines of code web/src/views/DashboardView.vue:1 — web/src/views/DashboardView.vue has 1835 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/PublicGateApprovalView.vue · ×1
  • web/src/views/PublicGateApprovalView.vue: 1705 lines of code web/src/views/PublicGateApprovalView.vue:1 — web/src/views/PublicGateApprovalView.vue has 1705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/workspace/WorkspaceAuditPanel.vue · ×1
  • web/src/components/workspace/WorkspaceAuditPanel.vue: 1685 lines of code web/src/components/workspace/WorkspaceAuditPanel.vue:1 — web/src/components/workspace/WorkspaceAuditPanel.vue has 1685 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/run/useRunDetail.ts · ×1
  • web/src/lib/run/useRunDetail.ts: 1620 lines of code web/src/lib/run/useRunDetail.ts:1 — web/src/lib/run/useRunDetail.ts has 1620 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/inbox/useClarifyChat.ts · ×1
  • web/src/lib/inbox/useClarifyChat.ts: 1573 lines of code web/src/lib/inbox/useClarifyChat.ts:1 — web/src/lib/inbox/useClarifyChat.ts has 1573 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/workspace/WorkspaceCredentialsPanel.vue · ×1
  • web/src/components/workspace/WorkspaceCredentialsPanel.vue: 1568 lines of code web/src/components/workspace/WorkspaceCredentialsPanel.vue:1 — web/src/components/workspace/WorkspaceCredentialsPanel.vue has 1568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/TokenAnalyticsView.vue · ×1
  • web/src/views/TokenAnalyticsView.vue: 1552 lines of code web/src/views/TokenAnalyticsView.vue:1 — web/src/views/TokenAnalyticsView.vue has 1552 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/onboarding/OnboardingWizard.vue · ×1
  • web/src/components/onboarding/OnboardingWizard.vue: 1366 lines of code web/src/components/onboarding/OnboardingWizard.vue:1 — web/src/components/onboarding/OnboardingWizard.vue has 1366 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/agent/AgentChatTester.vue · ×1
  • web/src/components/agent/AgentChatTester.vue: 1360 lines of code web/src/components/agent/AgentChatTester.vue:1 — web/src/components/agent/AgentChatTester.vue has 1360 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/liveoverlay/overlay.ts · ×1
  • web/src/liveoverlay/overlay.ts: 1354 lines of code web/src/liveoverlay/overlay.ts:1 — web/src/liveoverlay/overlay.ts has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1278 lines of code REDACTED:1 — REDACTED has 1278 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/WorkflowEditorView.vue · ×1
  • web/src/views/WorkflowEditorView.vue: 1193 lines of code web/src/views/WorkflowEditorView.vue:1 — web/src/views/WorkflowEditorView.vue has 1193 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/solo/useSoloChat.ts · ×1
  • web/src/lib/solo/useSoloChat.ts: 1151 lines of code web/src/lib/solo/useSoloChat.ts:1 — web/src/lib/solo/useSoloChat.ts has 1151 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/RunDetailView.vue · ×1
  • web/src/views/RunDetailView.vue: 1029 lines of code web/src/views/RunDetailView.vue:1 — web/src/views/RunDetailView.vue has 1029 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/shared/types.ts · ×1
  • web/src/lib/shared/types.ts: 1016 lines of code web/src/lib/shared/types.ts:1 — web/src/lib/shared/types.ts has 1016 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/AgentStudioView.vue · ×1
  • web/src/views/AgentStudioView.vue: 1012 lines of code web/src/views/AgentStudioView.vue:1 — web/src/views/AgentStudioView.vue has 1012 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/canvas/WorkflowCanvas.vue · ×1
  • web/src/components/canvas/WorkflowCanvas.vue: 974 lines of code web/src/components/canvas/WorkflowCanvas.vue:1 — web/src/components/canvas/WorkflowCanvas.vue has 974 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/RunListView.vue · ×1
  • web/src/views/RunListView.vue: 957 lines of code web/src/views/RunListView.vue:1 — web/src/views/RunListView.vue has 957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/run/ExecutionStatsPanel.vue · ×1
  • web/src/components/run/ExecutionStatsPanel.vue: 941 lines of code web/src/components/run/ExecutionStatsPanel.vue:1 — web/src/components/run/ExecutionStatsPanel.vue has 941 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/ui/HtmlPreview.vue · ×1
  • web/src/components/ui/HtmlPreview.vue: 925 lines of code web/src/components/ui/HtmlPreview.vue:1 — web/src/components/ui/HtmlPreview.vue has 925 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/agent/useAgentStudio.ts · ×1
  • web/src/lib/agent/useAgentStudio.ts: 915 lines of code web/src/lib/agent/useAgentStudio.ts:1 — web/src/lib/agent/useAgentStudio.ts has 915 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/agent/CliModelSelect.vue · ×1
  • web/src/components/agent/CliModelSelect.vue: 885 lines of code web/src/components/agent/CliModelSelect.vue:1 — web/src/components/agent/CliModelSelect.vue has 885 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/solo/SoloSessionPane.vue · ×1
  • web/src/components/solo/SoloSessionPane.vue: 826 lines of code web/src/components/solo/SoloSessionPane.vue:1 — web/src/components/solo/SoloSessionPane.vue has 826 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/workspace/ModelConfigurationManager.vue · ×1
  • web/src/components/workspace/ModelConfigurationManager.vue: 821 lines of code web/src/components/workspace/ModelConfigurationManager.vue:1 — web/src/components/workspace/ModelConfigurationManager.vue has 821 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 816 lines of code REDACTED:1 — REDACTED has 816 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/run/useRunLive.ts · ×1
  • web/src/lib/run/useRunLive.ts: 804 lines of code web/src/lib/run/useRunLive.ts:1 — web/src/lib/run/useRunLive.ts has 804 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/run/ClarifyMessageThread.vue · ×1
  • web/src/components/run/ClarifyMessageThread.vue: 799 lines of code web/src/components/run/ClarifyMessageThread.vue:1 — web/src/components/run/ClarifyMessageThread.vue has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/run/ArtifactPreview.vue · ×1
  • web/src/components/run/ArtifactPreview.vue: 775 lines of code web/src/components/run/ArtifactPreview.vue:1 — web/src/components/run/ArtifactPreview.vue has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/run/reactArtifactPreview.ts · ×1
  • web/src/lib/run/reactArtifactPreview.ts: 762 lines of code web/src/lib/run/reactArtifactPreview.ts:1 — web/src/lib/run/reactArtifactPreview.ts has 762 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/run/GateProductEditor.vue · ×1
  • web/src/components/run/GateProductEditor.vue: 739 lines of code web/src/components/run/GateProductEditor.vue:1 — web/src/components/run/GateProductEditor.vue has 739 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/dashboard/HomeYumeCharacter.vue · ×1
  • web/src/components/dashboard/HomeYumeCharacter.vue: 726 lines of code web/src/components/dashboard/HomeYumeCharacter.vue:1 — web/src/components/dashboard/HomeYumeCharacter.vue has 726 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/views/SandboxListView.vue · ×1
  • web/src/views/SandboxListView.vue: 702 lines of code web/src/views/SandboxListView.vue:1 — web/src/views/SandboxListView.vue has 702 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/solo/ReferencePicker.vue · ×1
  • web/src/components/solo/ReferencePicker.vue: 692 lines of code web/src/components/solo/ReferencePicker.vue:1 — web/src/components/solo/ReferencePicker.vue has 692 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/workflow/RunLaunchModal.vue · ×1
  • web/src/components/workflow/RunLaunchModal.vue: 678 lines of code web/src/components/workflow/RunLaunchModal.vue:1 — web/src/components/workflow/RunLaunchModal.vue has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/agent/useAgentFilesPanel.ts · ×1
  • web/src/lib/agent/useAgentFilesPanel.ts: 669 lines of code web/src/lib/agent/useAgentFilesPanel.ts:1 — web/src/lib/agent/useAgentFilesPanel.ts has 669 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) web/src/views/PublicGateApprovalView.vue:743 — `catch` 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Minor — 198 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate server/internal/handlers/app_preview_cancel.go:43 — `!active || state.Iteration != link.Iteration` appears character-identically in 4 files — server/internal/handlers/app_preview_cancel.go, server/internal/handlers/app_preview_share.go, server/internal/handlers/app_preview_transcript.go, server/internal/handlers/preview_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 server/internal/services/codex_device_flow.go:174 — `!sess.busy && !now.Before(sess.expiresAt)` appears character-identically in 2 files — server/internal/services/codex_device_flow.go, server/internal/services/github_device_flow.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 server/internal/runtime/profile_path.go:43 — `absFull != absRoot && !strings.HasPrefix(absFull, absRoot+sep)` appears character-identically in 2 files — server/internal/runtime/profile_path.go, server/internal/services/agent.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 server/internal/services/sandbox_bindings.go:56 — `agent.ModelBinding == nil || agent.ModelBinding.Kind != "configuration" || strings.TrimSpace(agent.ModelBinding.ConfigurationID) == ""` appears character-identically in 2 files — server/internal/services/sandbox_bindings.go, server/internal/services/solo.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 server/internal/runtime/acp_review_git.go:112 — `ch == nil || ch.VCS == "" || ch.VCS == "none"` appears character-identically in 2 files — server/internal/runtime/acp_review_git.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 server/internal/services/model_configurations.go:119 — `configuration.Binding.Kind != "platform" && configuration.Binding.Kind != "connection"` appears character-identically in 2 files — server/internal/services/model_configurations.go, server/internal/services/model_connections.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 server/internal/engine/node_agent.go:154 — `e == nil || e.host == nil || c == nil || node == nil` appears character-identically in 2 files — server/internal/engine/node_agent.go, server/internal/engine/outcome.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 server/internal/services/credential_domain.go:32 — `envauth.IsSecretEnvKey(row.EnvKey) || runtime.IsGitAuthorizationEnvKey(row.EnvKey)` appears character-identically in 2 files — server/internal/services/credential_domain.go, server/internal/services/workspace_credentials.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 sandbox-gateway/gateway/internal/driver/e2b/driver.go:885 — `err != nil && !errors.Is(err, ErrNotFound)` appears character-identically in 2 files — sandbox-gateway/gateway/internal/driver/e2b/driver.go, sandbox-gateway/gateway/internal/driver/e2b/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 server/internal/services/artifact.go:385 — `err != nil && !errors.Is(err, gorm.ErrRecordNotFound)` appears character-identically in 3 files — server/internal/services/artifact.go, server/internal/services/sandbox_recovery_inputs.go, server/internal/services/solo_reference.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 server/internal/auth/middleware.go:126 — `err != nil || (u.Scheme != "http" && u.Scheme != "https")` appears character-identically in 2 files — server/internal/auth/middleware.go, server/internal/handlers/gate_share_public_preview.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 sandbox-gateway/gateway/internal/config/validation.go:99 — `err != nil || (u.Scheme != "http" && u.Scheme != "https") || u.Hostname() == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || …` appears character-identically in 2 files — sandbox-gateway/gateway/internal/config/validation.go, sandbox-gateway/gateway/internal/driver/e2b/client.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 server/internal/services/solo.go:281 — `err != nil || configuration.State != "active" || configuration.Backend != strings.TrimSpace(agent.AcpBackend)` appears character-identically in 2 files — server/internal/services/solo.go, server/internal/services/solo_model_settings.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 sandbox-gateway/gateway/internal/service/recovery.go:205 — `err != nil || current.Status != models.StatusCreating` appears character-identically in 2 files — sandbox-gateway/gateway/internal/service/recovery.go, sandbox-gateway/gateway/internal/service/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 server/internal/handlers/gate_share_public.go:207 — `err != nil || lookup == nil || st != models.ShareLinkStateActive` appears character-identically in 3 files — server/internal/handlers/gate_share_public.go, REDACTED, server/internal/handlers/live.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 server/internal/handlers/embed.go:154 — `err != nil || lookup == nil || st == models.ShareLinkStateNone` appears character-identically in 5 files — server/internal/handlers/embed.go, server/internal/handlers/gate_share_public.go, server/internal/handlers/gate_share_public_artifacts.go, server/internal/handlers/gate_share_public_images.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 sandbox-gateway/gateway/cmd/server/main.go:113 — `err != nil || number < 1 || number > 65535` appears character-identically in 2 files — sandbox-gateway/gateway/cmd/server/main.go, sandbox-gateway/gateway/internal/config/validation.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 server/internal/services/model_connections.go:242 — `err != nil || strings.TrimSpace(secret) == ""` appears character-identically in 3 files — server/internal/services/model_connections.go, server/internal/services/model_discovery.go, server/internal/services/workspace_credentials.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 server/internal/handlers/agent.go:75 — `errors.Is(err, services.ErrSecretEnvKey) || errors.Is(err, services.ErrInvalidAcpBackend) || errors.Is(err, services.ErrInvalidAgent)` appears character-identically in 2 files — server/internal/handlers/agent.go, server/internal/handlers/shared_agent.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 server/internal/services/artifact_delivery.go:159 — `findErr != nil && !errors.Is(findErr, gorm.ErrRecordNotFound)` appears character-identically in 2 files — server/internal/services/artifact_delivery.go, server/internal/services/artifact_file.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:155 — `h.Shutdown != nil && h.Shutdown.IsDraining()` appears character-identically in 3 files — REDACTED, server/internal/handlers/app_preview_share.go, server/internal/handlers/health.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 server/internal/engine/review_session.go:830 — `interrupted && strings.TrimSpace(agentMsg.Text) == ""` appears character-identically in 2 files — server/internal/engine/review_session.go, server/internal/engine/visitor_lane.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 server/internal/engine/review_session.go:1011 — `item.Source == "gate" && item.GateNodeID != ""` appears character-identically in 2 files — server/internal/engine/review_session.go, server/internal/engine/visitor_lane.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 server/internal/gateshare/review.go:185 — `latest == nil || linkState(latest, time.Now()) != models.ShareLinkStateActive` appears character-identically in 2 files — server/internal/gateshare/review.go, server/internal/gateshare/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 server/internal/services/sandbox_studio.go:515 — `ls != nil && ls.acp != nil && ls.acp.IsConnected()` appears character-identically in 2 files — server/internal/services/sandbox_studio.go, server/internal/services/sandbox_view.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.
DM4 · Rich vs anemic model · Anemic entity · ×35
  • Anemic entity: Connection server/internal/modelrouting/types.go:81 — `Connection` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ArtifactDelivery server/internal/models/artifact_delivery.go:21 — `ArtifactDelivery` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: AuditEvent server/internal/models/audit.go:7 — `AuditEvent` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ChatPendingTurn server/internal/models/chat_pending.go:9 — `ChatPendingTurn` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: EmbedTicket server/internal/models/embed.go:16 — `EmbedTicket` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: EmbedSession server/internal/models/embed.go:33 — `EmbedSession` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: GateShareLink server/internal/models/gate_share_link.go:15 — `GateShareLink` is an aggregate/entity with 19 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: GateShareVisitorConversation server/internal/models/gate_share_link.go:43 — `GateShareVisitorConversation` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: GateShareNonce server/internal/models/gate_share_nonce.go:8 — `GateShareNonce` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: GateSharePreviewTicket server/internal/models/gate_share_preview_ticket.go:8 — `GateSharePreviewTicket` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: LiveSession server/internal/models/live.go:112 — `LiveSession` is an aggregate/entity with 21 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Credential server/internal/models/models.go:41 — `Credential` is an aggregate/entity with 20 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Workspace server/internal/models/models.go:67 — `Workspace` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: WorkflowDef server/internal/models/models.go:88 — `WorkflowDef` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: WorkflowVersion server/internal/models/models.go:129 — `WorkflowVersion` is an aggregate/entity with 11 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RunVariable server/internal/models/models.go:385 — `RunVariable` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Artifact server/internal/models/models.go:398 — `Artifact` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ArtifactVersion server/internal/models/models.go:427 — `ArtifactVersion` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Gate server/internal/models/models.go:448 — `Gate` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ReactConversation server/internal/models/models.go:487 — `ReactConversation` is an aggregate/entity with 18 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Sandbox server/internal/models/models.go:875 — `Sandbox` is an aggregate/entity with 30 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Session server/internal/models/models.go:958 — `Session` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: WorkflowAPIKey server/internal/models/models.go:971 — `WorkflowAPIKey` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Setting server/internal/models/models.go:985 — `Setting` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RunPreviewPort server/internal/models/models.go:992 — `RunPreviewPort` is an aggregate/entity with 15 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • + 10 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on error · ×29
  • Silent fallback default on error REDACTED:109 — `listenPort` 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 REDACTED:122 — `upstreamPort` 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 sandbox-gateway/sandbox/internal/correl/correl.go:19 — `ID` turns a non-nil `err` into `return "00000000"` — 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 sandbox-gateway/sandbox/internal/desktop/control.go:54 — `load` turns a non-nil `err` into `return map[string]time.Time{}` — 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 sandbox-gateway/sandbox/internal/previewinject/csp.go:57 — `frameSource` 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 sandbox-gateway/sandbox/internal/previewinject/upstream.go:104 — `filePortLocked` 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 sandbox-gateway/sandbox/internal/provider/codex/codex.go:172 — `parseLegacyLine` turns a non-nil `err` into `return oneshot.ParseResult{}` — 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 sandbox-gateway/sandbox/internal/provider/codex/codex.go:362 — `parseThreadLine` turns a non-nil `err` into `return oneshot.ParseResult{}` — 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 sandbox-gateway/sandbox/internal/service/liveness.go:183 — `io` 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 server/cmd/gen-nodereg/main.go:17 — `workspaceRoot` 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 server/internal/handlers/gate_share_public.go:884 — `publicGateArtifacts` 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 server/internal/mcp/human_artifact.go:204 — `jsonToArgs` turns a non-nil `err` into `return map[string]any{}` — 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 server/internal/mcp/outcome.go:523 — `OutcomeJSON` 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 server/internal/mcp/host.go:621 — `artifactWriterNode` 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 server/internal/mcp/tools_plan.go:42 — `toolGetPlan` turns a non-nil `err` into `return "get_plan failed: 尚无计划(plan.json)", 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 server/internal/mcp/tools_plan.go:66 — `toolUpdatePlanStatus` turns a non-nil `err` into `return "update_plan_status failed: 尚无计划(plan.json)", 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 server/internal/modelrouting/provider_efforts.go:48 — `connectionHostname` 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 server/internal/runtime/codex_auth.go:227 — `CodexLoginCredentialForBinding` 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 server/internal/runtime/codex_login_hub.go:92 — `codexCopyAccess` 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 server/internal/runtime/repo_git.go:158 — `parseGitScope` turns a non-nil `err` into `return gitScope{}` — 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 server/internal/runtime/acp_config.go:78 — `workDir` 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 server/internal/runtime/registry.go:206 — `CheckGit` turns a non-nil `err` into `return ReactTurn{}` — 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 server/internal/runtime/registry.go:220 — `EnsureHandoff` turns a non-nil `err` into `return ReactTurn{}` — 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 server/internal/sandbox/events.go:185 — `normalizeSessionUpdate` turns a non-nil `err` into `return "", nil` — 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 server/internal/sandbox/timeline.go:194 — `toolDetail` 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.
  • + 4 more in this group — see findings.md.
DM5 · Encapsulated state · Mutable entity · ×22
  • Mutable entity: Sandbox sandbox-gateway/gateway/internal/models/sandbox.go:32 — `Sandbox` exposes publicly writable state (ID, Name, Status, Image, Namespace, Error, and 10 more).
  • Mutable entity: GateShareVisitorConversation server/internal/models/gate_share_link.go:43 — `GateShareVisitorConversation` exposes publicly writable state (ID, LinkID, Lane, RunID, NodeID, ChatID, and 4 more).
  • Mutable entity: LiveSession server/internal/models/live.go:112 — `LiveSession` exposes publicly writable state (ID, RunID, NodeID, Owner, Mode, Action, and 15 more).
  • Mutable entity: LiveEvent server/internal/models/live.go:200 — `LiveEvent` exposes publicly writable state (Op, SID, Scope, Action, Prompt, Count, and 11 more).
  • Mutable entity: Credential server/internal/models/models.go:41 — `Credential` exposes publicly writable state (ID, Purpose, Issuer, ToolID, SecretKind, Host, and 14 more).
  • Mutable entity: Workspace server/internal/models/models.go:67 — `Workspace` exposes publicly writable state (ID, Name, Description, UnknownModelDisplayName, CreatedAt, UpdatedAt).
  • Mutable entity: WorkflowDef server/internal/models/models.go:88 — `WorkflowDef` exposes publicly writable state (Defaults, ID, Name, Description, Version, PublishedVersion, and 6 more).
  • Mutable entity: Run server/internal/models/models.go:145 — `Run` exposes publicly writable state (ID, WorkflowID, WorkflowName, WorkflowVersion, Status, Trigger, and 23 more).
  • Mutable entity: StateRun server/internal/models/models.go:313 — `StateRun` exposes publicly writable state (Files, HasFileDeliveries, ID, RunID, NodeID, NodeType, and 21 more).
  • Mutable entity: RunVariable server/internal/models/models.go:385 — `RunVariable` exposes publicly writable state (ID, RunID, Name, Type, Value, REDACTED).
  • Mutable entity: Artifact server/internal/models/models.go:398 — `Artifact` exposes publicly writable state (ID, RunID, NodeID, WorkflowID, WorkflowName, Name, and 12 more).
  • Mutable entity: ArtifactVersion server/internal/models/models.go:427 — `ArtifactVersion` exposes publicly writable state (ID, ArtifactID, RunID, NodeID, Revision, Kind, and 6 more).
  • Mutable entity: Gate server/internal/models/models.go:448 — `Gate` exposes publicly writable state (ID, RunID, NodeID, Iteration, WorkflowID, WorkflowName, and 8 more).
  • Mutable entity: ReactConversation server/internal/models/models.go:487 — `ReactConversation` exposes publicly writable state (HasFileDeliveries, ID, RunID, NodeID, Iteration, Done, and 12 more).
  • Mutable entity: Sandbox server/internal/models/models.go:875 — `Sandbox` exposes publicly writable state (ModelBindingFingerprint, GitBindingsFingerprint, ID, Name, Profile, Purpose, and 24 more).
  • Mutable entity: RunPreviewPort server/internal/models/models.go:992 — `RunPreviewPort` exposes publicly writable state (ID, RunID, NodeID, ItemKey, Kind, Port, and 9 more).
  • Mutable entity: Project server/internal/models/solo.go:11 — `Project` exposes publicly writable state (ID, Name, Description, RepoURL, DefaultBranch, RepoDirName, and 7 more).
  • Mutable entity: SoloSession server/internal/models/solo.go:70 — `SoloSession` exposes publicly writable state (ID, UserID, Title, AgentName, ProjectID, ProjectSnapshot, and 31 more).
  • Mutable entity: SoloMessage server/internal/models/solo.go:212 — `SoloMessage` exposes publicly writable state (TurnID, Files, ID, SessionID, Role, Content, and 14 more).
  • Mutable entity: TokenUsageEvent server/internal/models/token_usage_event.go:31 — `TokenUsageEvent` exposes publicly writable state (ID, ReportID, CreatedAt, Source, Phase, Status, and 15 more).
  • Mutable entity: TokenUsageReport server/internal/models/token_usage_event.go:59 — `TokenUsageReport` exposes publicly writable state (Committed, ID, CreatedAt, Source, Phase, Status, and 8 more).
  • Mutable entity: TeamService server/internal/services/team.go:62 — `TeamService` exposes publicly writable state (Workspace, Skills).
X7 · Silent fallback defaults · Silent fallback default in catch · ×10
  • Silent fallback default in catch sandbox-gateway/sandbox/web/static/js/ui/safe_image_url.js:94 — `sanitizeImageURL` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/inbox/clarifyDraftStash.ts:56 — `userKey` swallows every exception into `return 'anon'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/inbox/clarifyDraftStash.ts:469 — `readOutbox` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:90 — `recallShareUrl` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/run/useWorkflowFavorites.ts:57 — `loadFavoriteEntries` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/agent/fixedEffort.ts:52 — `connectionHost` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/composables/useStatusFilter.ts:66 — `readStatusFilterFromStorage` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/inbox/sidebarPins.ts:33 — `loadSidebarPins` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/inbox/usePendingGates.ts:162 — `readPeekFiltersFromLocation` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/lib/run/useHomeApproveChat.ts:52 — `readLastWorkflowId` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 handler or in the docstring, and the row stops firing.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · Mock-dominated test · ×6
  • Mock-dominated test: reports read errors, aborts and synchronous failures without accepting them as finished files web/src/lib/shared/attachments.test.ts:68 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: forwards close/error to both app and RFB handlers web/src/lib/shared/previewVncChannel.test.ts:79 — This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: downloads live and historical artifacts through their distinct paths web/src/lib/run/useArtifactPreview.coverage.test.ts:275 — This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: exports logs through an anchor click web/src/lib/run/useRunDetail.actions.test.ts:647 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: polls sandbox log silently on sandbox tab interval web/src/lib/run/useRunDetailWs.test.ts:103 — This test sets up 6 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: uses a custom delay schedule when provided web/src/lib/run/wsReconnect.test.ts:70 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
D31 · IaC & Container Security · Low IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×3
  • Projects may be oversized for their cohesion REDACTED:1 — `server` (100291 LoC, 561 module-visible types across 44 directories) overshoots its size bounds. 3 of 5 build unit(s) (Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion web/package.json:1 — `web` (54946 LoC, 601 module-visible types across 30 directories) overshoots its size bounds. 3 of 5 build unit(s) (Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `sandbox-gateway/gateway` (8771 LoC, 67 module-visible types across 13 directories) overshoots its size bounds. 3 of 5 build unit(s) (Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
X9 · Subsumed condition operand · Subsumed condition operand · ×3
  • Subsumed condition operand server/internal/services/agent.go:322 — `strings.HasPrefix(p, "../")` can never decide this `||` — every value satisfying `strings.HasPrefix(p, "../")` also satisfies `strings.Contains(p, "..")`, 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 server/internal/sandbox/timeline_test.go:189 — `strings.Contains(last.Text, "…(truncated)")` can never decide this `||` — every value satisfying `strings.Contains(last.Text, "…(truncated)")` also satisfies `strings.Contains(last.Text, "…")`, 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 server/internal/handlers/gate_share_public.go:519 — `strings.Contains(msg, "react already done")` can never decide this `||` — every value satisfying `strings.Contains(msg, "react already done")` also satisfies `strings.Contains(msg, "already done")`, 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.
D21 · Naming Consistency · `callID` spells `ID` where 23 names in the project spell it `Id` · ×2
  • `callID` spells `ID` where 23 names in the project spell it `Id` sandbox-gateway/scripts/mock-agent-model.mjs:163 — 23 of 25 names in project grasp spell the token `Id` (23 of 25; unit: names in project grasp containing `Id`). Peers: ChatTab.wireChatId (sandbox-gateway/sandbox/web/static/js/app/chat_tab.js:97); main.selectModel(modelId) (sandbox-gateway/sandbox/web/static/js/app/main.js:303); tab_state.pickActiveId (sandbox-gateway/sandbox/web/static/js/app/tab_state.js:40); tab_state.pickActiveId(savedId) (sandbox-gateway/sandbox/web/static/js/app/tab_state.js:40); tab_state.neighborAfterClose(closingId) (sandbox-gateway/sandbox/web/static/js/app/tab_state.js:51). Rename to `callId`. [rule N6]
  • `callID` spells `ID` where 23 names in the project spell it `Id` sandbox-gateway/scripts/mock-agent-model.mjs:245 — 23 of 25 names in project grasp spell the token `Id` (23 of 25; unit: names in project grasp containing `Id`). Peers: ChatTab.wireChatId (sandbox-gateway/sandbox/web/static/js/app/chat_tab.js:97); main.selectModel(modelId) (sandbox-gateway/sandbox/web/static/js/app/main.js:303); tab_state.pickActiveId (sandbox-gateway/sandbox/web/static/js/app/tab_state.js:40); tab_state.pickActiveId(savedId) (sandbox-gateway/sandbox/web/static/js/app/tab_state.js:40); tab_state.neighborAfterClose(closingId) (sandbox-gateway/sandbox/web/static/js/app/tab_state.js:51). Rename to `callId`. [rule N6]
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D41 · Kernel & Syscall Confinement · No seccomp profile · ×2
  • No seccomp profile REDACTED:49 — The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
  • No seccomp profile REDACTED:152 — The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 118 significant file(s) lose their only recent owner: web/src/lib/inbox/useClarifyChat.ts, web/src/liveoverlay/overlay.ts, server/internal/clicatalog/catalog.go, server/internal/config/config.go, web/src/lib/run/reactArtifactPreview.ts, server/internal/mcp/host.go, server/internal/models/live.go, server/internal/mcp/preview.go (+110 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 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 (121 single-owned of 512 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; 512 of the 760 production source files in this repository met that bar). They are anonymized user #2 (3 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: web/src/lib/run/runDraft.ts, web/src/lib/shared/homeParticleMesh.ts, web/src/lib/run/busySeedRetry.ts.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found server/cmd/server/file_migration.go:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `server/cmd/server/file_migration.go` makes this repository a deployable product (line 1).
D21 · Naming Consistency · `ImageDataUrl` spells `Url` where 80 names in the project spell it `URL` · ×1
  • `ImageDataUrl` spells `Url` where 80 names in the project spell it `URL` server/internal/engine/annotation_artifact.go:54 — 80 of 81 names in project github.com/cocofhu/grasp spell the token `URL` (80 of 81; unit: names in project github.com/cocofhu/grasp containing `URL`). Peers: options.apiURL (server/cmd/doctor/main.go:22); options.gatewayURL (server/cmd/doctor/main.go:23); main.verifyArtifactIsolation(apiURL) (server/cmd/doctor/main.go:185); main.startArtifactSession(apiURL) (server/cmd/doctor/main.go:226); main.cleanupArtifactSession(apiURL) (server/cmd/doctor/main.go:251). Rename to `ImageDataURL`. [rule N6]
D21 · Naming Consistency · `skipVCS` spells `VCS` where 13 names in the project spell it `Vcs` · ×1
  • `skipVCS` spells `VCS` where 13 names in the project spell it `Vcs` server/internal/version/version.go:17 — 13 of 14 names in project github.com/cocofhu/grasp spell the token `Vcs` (13 of 14; unit: names in project github.com/cocofhu/grasp containing `Vcs`). Peers: services.workspaceVcsDirName (REDACTED:24); services.ErrVcsReasonRequired (REDACTED:33); services.ErrVcsRevisionMiss (REDACTED:34); services.ErrVcsGitFailed (REDACTED:35); services.ErrVcsNoChanges (REDACTED:36). Rename to `skipVcs`. [rule N6]
D21 · Naming Consistency · `openCodeModelID` spells `ID` where 421 names in the project spell it `Id` · ×1
  • `openCodeModelID` spells `ID` where 421 names in the project spell it `Id` web/src/lib/agent/fixedEffort.ts:25 — 421 of 422 names in project grasp spell the token `Id` (421 of 422; unit: names in project grasp containing `Id`). Peers: artifact-edit-main.put(nodeId) (web/e2e/artifact-edit-main.ts:31); artifact-edit-main.byId (web/e2e/artifact-edit-main.ts:59); clarify-inbox-product-main.exec(nodeId) (web/e2e/clarify-inbox-product-main.ts:64); clarify-inbox-product-main.inboxNodeId (web/e2e/clarify-inbox-product-main.ts:237); dialogueServer.createDialogueServer(runId) (web/e2e/helpers/dialogueServer.ts:33). Rename to `openCodeModelId`. [rule N6]
D21 · Naming Consistency · `previewShareURL` spells `URL` where 41 names in the project spell it `Url` · ×1
  • `previewShareURL` spells `URL` where 41 names in the project spell it `Url` web/src/lib/inbox/appPreviewShare.ts:35 — 41 of 42 names in project grasp spell the token `Url` (41 of 42; unit: names in project grasp containing `Url`). Peers: gate-share-link-main.fixtureShareUrl (web/e2e/gate-share-link-main.ts:60); fixedEffort.connectionHost(baseUrl) (web/src/lib/agent/fixedEffort.ts:47); fixedEffort.providerEntry(baseUrl) (web/src/lib/agent/fixedEffort.ts:57); fixedEffort.effortChoices(baseUrl) (web/src/lib/agent/fixedEffort.ts:85); PreviewPort.proxyUrl (web/src/lib/api/apiTypes.ts:38). Rename to `previewShareUrl`. [rule N6]
D21 · Naming Consistency · `outerHTML` spells `HTML` where 13 names in the project spell it `Html` · ×1
  • `outerHTML` spells `HTML` where 13 names in the project spell it `Html` web/src/lib/shared/types.ts:775 — 13 of 14 names in project grasp spell the token `Html` (13 of 14; unit: names in project grasp containing `Html`). Peers: nodeRegistry.isPageHtmlGateBody (web/src/data/nodeRegistry.ts:122); isVisualHtmlCard.isHtmlArtifactName (web/src/lib/run/isVisualHtmlCard.ts:10); isVisualHtmlCard.looksLikeFullHtmlDocument (web/src/lib/run/isVisualHtmlCard.ts:21); isVisualHtmlCard.isVisualHtmlCard (web/src/lib/run/isVisualHtmlCard.ts:56); reactArtifactPreview.isHtmlStageArtifact (web/src/lib/run/reactArtifactPreview.ts:273). Rename to `outerHtml`. [rule N6]
D24 · Comment Value · redundant comment · ×1
  • redundant comment web/src/components/run/ReactConnectingState.test.ts:174 — "g2.2 — pulling only swaps title" repeats the code it sits on: 4 of its 4 words (pulling, only, swaps, title) are already in `it('stage pulling swaps title only and keeps shared hint (g2.2)', () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D40 · Network Egress Confinement · No network policy · ×1
  • No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
DM2 · Strongly-typed ids · Primitive id on a domain type · ×1
  • Primitive id on a domain type: LiveEvent.SID server/internal/models/live.go:202 — `LiveEvent.SID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation · Architecture diagram out of date · ×1
  • Architecture diagram out of date README.md:121 — `README.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `gateway`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 3/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation docs/package.json:12 — `docs/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code · Unused module-local declaration 'mountPanel' · ×1
  • Unused module-local declaration 'mountPanel' web/src/components/agent/AgentEnvPanel.secretHint.test.ts: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 'SCROLL_EXIT' · ×1
  • Unused module-local declaration 'SCROLL_EXIT' web/src/views/mobileScrollContract.test.ts:18 — 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 or an AbortSignal · ×1
  • Not all functions that make a request accept a context.Context or an AbortSignal — Only 34/44 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~2.6 `!` null assertions per 1k TypeScript source lines — 149 assertion(s) across the 56888 source line(s) of the 311 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web/src/lib/inbox/useGatesInbox.ts (13), web/src/lib/inbox/useClarifyChat.ts (11), web/src/components/canvas/composables/edgePath.ts (10). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure sandbox-gateway/sandbox/scripts/git-credentials.py:33 — `valid_host` returns `False` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 handler or in the docstring, and the row stops firing.
Minor — 28 finding(s)
D12 · Dependency Hygiene · Outdated · ×22
  • Outdated: github.com/aws/aws-sdk-go-v2 — `github.com/aws/aws-sdk-go-v2` is required at v1.47.8 in REDACTED, but v1.48.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/aws/aws-sdk-go-v2@v1.48.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/credentials — `github.com/aws/aws-sdk-go-v2/credentials` is required at v1.20.16 in REDACTED, but v1.21.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/credentials@v1.21.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager — `github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager` is required at v0.5.5 in REDACTED, but v0.5.8 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager@v0.5.8 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/s3 — `github.com/aws/aws-sdk-go-v2/service/s3` is required at v1.114.9 in REDACTED, but v1.114.10 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/service/s3@v1.114.10 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/smithy-go — `github.com/aws/smithy-go` is required at v1.28.8 in REDACTED, but v1.28.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/aws/smithy-go@v1.28.9 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/gin-gonic/gin — `github.com/gin-gonic/gin` is required at v1.10.0 in REDACTED, but v1.12.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/gin-gonic/gin@v1.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/gin-gonic/gin — `github.com/gin-gonic/gin` is required at v1.10.0 in sandbox-gateway/sandbox/go.mod, but v1.12.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/gin-gonic/gin@v1.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/go-git/go-billy/v5 — `github.com/go-git/go-billy/v5` is required at v5.9.0 in REDACTED, but v5.9.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/go-git/go-billy/v5@v5.9.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/go-git/go-git/v5 — `github.com/go-git/go-git/v5` is required at v5.19.2 in REDACTED, but v5.19.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/go-git/go-git/v5@v5.19.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/pelletier/go-toml/v2 — `github.com/pelletier/go-toml/v2` is required at v2.2.4 in REDACTED, but v2.4.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/pelletier/go-toml/v2@v2.4.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/rs/zerolog — `github.com/rs/zerolog` is required at v1.33.0 in REDACTED, but v1.35.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/rs/zerolog@v1.35.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/rs/zerolog — `github.com/rs/zerolog` is required at v1.33.0 in sandbox-gateway/sandbox/go.mod, but v1.35.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/rs/zerolog@v1.35.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.57.0 in sandbox-gateway/sandbox/go.mod, but v0.59.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/crypto@v0.59.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.57.0 in REDACTED, but v0.59.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/crypto@v0.59.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/net — `golang.org/x/net` is required at v0.60.0 in sandbox-gateway/sandbox/go.mod, but v0.62.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/net@v0.62.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.48.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: golang.org/x/text — `golang.org/x/text` is required at v0.42.0 in REDACTED, but v0.44.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/text@v0.44.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: gorm.io/driver/mysql — `gorm.io/driver/mysql` is required at v1.5.7 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 gorm.io/driver/mysql@v1.6.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: gorm.io/gorm — `gorm.io/gorm` is required at v1.25.12 in REDACTED, but v1.31.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get gorm.io/gorm@v1.31.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: k8s.io/api — `k8s.io/api` is required at v0.31.1 in REDACTED, but v0.37.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get k8s.io/api@v0.37.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: k8s.io/apimachinery — `k8s.io/apimachinery` is required at v0.31.1 in REDACTED, but v0.37.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get k8s.io/apimachinery@v0.37.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: k8s.io/client-go — `k8s.io/client-go` is required at v0.31.1 in REDACTED, but v0.37.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get k8s.io/client-go@v0.37.2 && go mod tidy` and commit the updated REDACTED and go.sum.
D10 · Test Quality · Skipped (documented) · ×6
  • Skipped (documented): (unnamed test) web/src/views/SandboxConsoleView.lazyMount.test.ts:71 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) web/src/components/run/ReactArtifactStage.sandbox.test.ts:45 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) web/src/components/run/ReactArtifactStage.test.ts:86 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) web/src/components/run/SandboxStageSurface.test.ts:36 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) web/src/components/run/collapsedReplySpacing.test.ts:163 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) web/src/components/run/collapsedReplySpacing.test.ts:246 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf

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-324febd63dab4c959a5e00b62de15a76/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-324febd63dab4c959a5e00b62de15a76/history-1.json --exit-code 0 --source .1artifacts/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=1107" --report-format json --report-path /tmp/watchdog-gitleaks-324febd63dab4c959a5e00b62de15a76/history-2.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-2.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-324febd63dab4c959a5e00b62de15a76/tree.json --exit-code 0 --source .2artifacts/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 .140artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .5artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .75artifacts/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 12 file(s) — `sandbox-gateway/sandbox/web/static/js/third_party/marked-15.0.6.esm.js`, `server/internal/engine/review_session.go`, `web/e2e/clarify-image-preview-main.ts`, `web/e2e/message-reliability-main.ts`, `web/src/components/canvas/composables/outlets.ts`, … (+7 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 01a1e6f3-6738-7194-ac56-3014ca12f768 · 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