Public report of yyjeqhc/webcodex, 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, 21:29 UTC · Survey ID cd_1c67963f25854860ac4ac8d66bb73da8

yyjeqhc/webcodex

Measured 17 November 2026, 21:22 UTC, at code version ea81bd8

First survey, so nothing to compare with yet Test reliability: not measured

Test reliability is not measured: The rust executor ran against the .rs half and never executed.

CAI score 58.8out of 100 At risk

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 very large codebase: 668,807 lines of product code in 33 projects, tests not counted · Estimated rebuild effort: about 10.0 person-years · Weakest lens: Event Sourcing, 55.7

Findings by how serious they are

88 critical 4181 serious 119 minor

11 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, 21:22 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.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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 ▸

66of 66 dimensions measured by tools.
4349of 4388 findings point to an exact file and line, so you can open each one in the code. The other 39 concern the repository as a whole, such as missing documentation.
66dimensions across 9 lenses, read from 668,807 lines of product code in 33 projects.
Chapters

Executive summary

yyjeqhc/webcodex is rated At risk because critical security findings are open. Its score is held back because it has history replays that read the clock or random values. It scores 58.8 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Event Sourcing, at 55.7, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step for the work it takes is fixing the password or key in the code, worth about 1.6 points. Making event replay repeatable would lift Event Sourcing itself, worth about 2.7 points.

Thirteen known security holes in the packages the code depends on can be used by attackers. Nine weaknesses in the code could be used by an attacker, and eleven sets of files in separate parts keep changing together, which points to hidden dependencies. Updating the vulnerable packages, fixing the weaknesses the scanner points to and making the hidden dependencies explicit would close these risks. Passing outside input through environment variables would fix the three pipeline steps that put outside input straight into a shell command, and the place where the code runs text as code or as a command needs a direct call instead. Rebuilding state only from the recorded events would take care of the three history replays that read the clock or random values.

The product code is 668,807 lines, about €1,500,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.
Event Sourcing 55.7 · counts for 45%Production Readiness 58.1 · counts for 25%Performance 60.0 · counts for 14%Accessibility 61.6 · counts for 8%Code Health 70.4 · counts for 4%Event-Driven 71.2 · counts for 2%Security and Compliance 73.6 · counts for 1%Maturity 83.6 · counts for 1%Architecture 86.4 · counts for 0%

The weakest lenses score close to each other, so improving any of them moves the score.

Code composition: what the lines of code are
Business logic 0%Supporting code 0%Tests 100%
Rebuild cost: about €1,500,000 · Estimate
Cost to rebuild€480,000 to €2,400,000, for 8,043 to 25,516 hours of work, about 10.0 person-years for 5 to 19 engineers
Difficulty of the problemHigh, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 59. 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.
SizeVery large: 668,807 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.

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 1.6 points · Low effort · REDACTED Scanning
2
Stamp clock/random values into the event in the command; the recovery fold must be a pure function of the event.
Raises the score by about 2.7 points · Medium effort · Fold determinism
3
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
Raises the score by about 1.2 points · Medium effort · Async & latency hygiene

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 €1,500,000 to build again, about 10.0 person-years of work. Its weakest lens is Event Sourcing, at 55.7 (Adequate). Event Sourcing is about whether the stored history the system is built on can be trusted. Because the weakest lens counts most in the score, work on Event Sourcing also moves the score most.
Based on: the rebuild estimate · the Event Sourcing grade · how much each lens counts
What to do: Start with the Event Sourcing actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 1.6 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 1,614,017 lines over the last 90 days, which is about 6,545,736 lines a year. At that pace, the extra work comes to an estimated 912.2 to 5472.9 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 — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch @yyjeqhc/webcodex-plugin-sdk webcodex-plugin-sdk webcodex webcodex webcodex-admin webcodex-admin webcodex->webcodex-admin webcodex-build-info webcodex-build-info webcodex->webcodex-build-info webcodex-core webcodex-core webcodex->webcodex-core webcodex-environment webcodex-environment webcodex->webcodex-environment webcodex-process webcodex-process webcodex->webcodex-process webcodex-runner-config webcodex-runner-config webcodex->webcodex-runner-config webcodex-tool-contracts webcodex-tool-contracts webcodex->webcodex-tool-contracts webcodex-tool-runtime-contracts webcodex-tool-runtime-contracts webcodex->webcodex-tool-runtime-contracts webcodex-validation webcodex-validation webcodex->webcodex-validation webcodex-workflow-session webcodex-workflow-session webcodex->webcodex-workflow-session webcodex-workspace webcodex-workspace webcodex->webcodex-workspace webcodex-browser webcodex-browser webcodex-browser->webcodex-core webcodex-browser->webcodex-process webcodex-browser->webcodex-runner-config webcodex-build-info->webcodex-core webcodex-cli webcodex-cli webcodex-cli->webcodex webcodex-cli->webcodex-admin webcodex-cli->webcodex-build-info webcodex-cli->webcodex-core webcodex-cli->webcodex-environment webcodex-cli->webcodex-process webcodex-cli->webcodex-runner-config webcodex-computer webcodex-computer webcodex-computer-control webcodex-computer-control webcodex-computer->webcodex-computer-control webcodex-computer->webcodex-core webcodex-desktop webcodex-desktop webcodex-desktop->webcodex-build-info webcodex-desktop->webcodex-computer-control webcodex-desktop->webcodex-core webcodex-desktop->webcodex-environment webcodex-desktop->webcodex-process webcodex-desktop->webcodex-runner-config webcodex-environment->webcodex-core webcodex-environment->webcodex-process webcodex-environment->webcodex-runner-config webcodex-lsp webcodex-lsp webcodex-lsp->webcodex-core webcodex-lsp->webcodex-process webcodex-lsp->webcodex-runner-config webcodex-runner webcodex-runner webcodex-runner->webcodex-browser webcodex-runner->webcodex-build-info webcodex-runner->webcodex-computer webcodex-runner->webcodex-core webcodex-runner->webcodex-environment webcodex-runner->webcodex-lsp webcodex-runner->webcodex-process webcodex-runner->webcodex-runner-config webcodex-runner->webcodex-validation webcodex-runner->webcodex-workspace webcodex-runner-config->webcodex-core webcodex-tool-contracts->webcodex-core webcodex-tool-runtime-contracts->webcodex-core webcodex-tool-runtime-contracts->webcodex-tool-contracts webcodex-tool-runtime-contracts->webcodex-workflow-session webcodex-validation->webcodex-core webcodex-validation->webcodex-tool-contracts webcodex-validation->webcodex-workflow-session webcodex-validation->webcodex-workspace webcodex-workflow-session->webcodex-core webcodex-workflow-session->webcodex-tool-contracts webcodex-workspace->webcodex-core __more__ +13 more projects

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.

1040 modules, with 2136 dependencies between them. 21 loops run through 105 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1000 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 webcodex_computer_control2 webcodex_core.desktop_runtime_contract3 webcodex_core.workflow_session_contract4 webcodex_environment.unified_update5 webcodex_openai_tunnel.error6 webcodex_openai_tunnel.wire7 webcodex_process.unix8 webcodex_store.models9 webcodex_store.store_primitives10 webcodex_tool_runtime_contracts.tool_result11 webcodex.auth.context12 webcodex_computer13 webcodex_core.runner_protocol.job14 webcodex_desktop.error15 webcodex_environment.service16 webcodex_environment.types17 webcodex_store18 webcodex_tool_contracts.tool_call.canonical_enum19 webcodex_workflow_session.model20 webcodex.tool_runtime.model_ergonomics_telemetry21 webcodex_core.runner_operation22 webcodex_desktop.models23 webcodex_environment.installer_unix24 webcodex_environment.storage25 webcodex_core.runner_protocol26 webcodex_desktop.state.desktop_core27 webcodex_environment.unified_update.download28 webcodex.tool_runtime.project_resolution29 webcodex_desktop.state30 webcodex_runner.webcodex_runner.job_manager31 webcodex_runner.webcodex_runner.output32 webcodex_runner_registry.state33 webcodex_desktop.commands34 webcodex_runner.webcodex_runner.config35 webcodex_runner_registry.registry36 webcodex.tool_runtime.runtime37 webcodex_runner.webcodex_runner.transport38 webcodex.tool_runtime.window_activity39 webcodex.tool_runtime.kernel40 webcodex.mcp.tools.call
1 webcodex_computer_control
2 webcodex_core.desktop_runtime_contract
3 webcodex_core.workflow_session_contract
4 webcodex_environment.unified_update
5 webcodex_openai_tunnel.error
6 webcodex_openai_tunnel.wire
7 webcodex_process.unix
8 webcodex_store.models
9 webcodex_store.store_primitives
10 webcodex_tool_runtime_contracts.tool_result
11 webcodex.auth.context1
12 webcodex_computer2
13 webcodex_core.runner_protocol.job4
14 webcodex_desktop.error1
15 webcodex_environment.service1
16 webcodex_environment.types1
17 webcodex_store101
18 webcodex_tool_contracts.tool_call.canonical_enum1
19 webcodex_workflow_session.model27
20 webcodex.tool_runtime.model_ergonomics_telemetry21
21 webcodex_core.runner_operation21410
22 webcodex_desktop.models11
23 webcodex_environment.installer_unix12
24 webcodex_environment.storage2
25 webcodex_core.runner_protocol122
26 webcodex_desktop.state.desktop_core15611
27 webcodex_environment.unified_update.download811
28 webcodex.tool_runtime.project_resolution112
29 webcodex_desktop.state6111
30 webcodex_runner.webcodex_runner.job_manager17318
31 webcodex_runner.webcodex_runner.output1
32 webcodex_runner_registry.state61102
33 webcodex_desktop.commands11411
34 webcodex_runner.webcodex_runner.config61
35 webcodex_runner_registry.registry131154
36 webcodex.tool_runtime.runtime71113116163125
37 webcodex_runner.webcodex_runner.transport112
38 webcodex.tool_runtime.window_activity1221
39 webcodex.tool_runtime.kernel111111
40 webcodex.mcp.tools.call22221
Uses a module listed above itPart of a loopThe module itself
1 webcodex_computer_control2 webcodex_core.desktop_runtime_contract3 webcodex_core.workflow_session_contract4 webcodex_environment.unified_update5 webcodex_openai_tunnel.error6 webcodex_openai_tunnel.wire7 webcodex_process.unix8 webcodex_store.models9 webcodex_store.store_primitives10 webcodex_tool_runtime_contracts.tool_result11 webcodex.auth.context12 webcodex_computer13 webcodex_core.runner_protocol.job14 webcodex_desktop.error15 webcodex_environment.service16 webcodex_environment.types17 webcodex_store18 webcodex_tool_contracts.tool_call.canonical_enum19 webcodex_workflow_session.model20 webcodex.tool_runtime.model_ergonomics_telemetry21 webcodex_core.runner_operation22 webcodex_desktop.models23 webcodex_environment.installer_unix24 webcodex_environment.storage25 webcodex_core.runner_protocol26 webcodex_desktop.state.desktop_core27 webcodex_environment.unified_update.download28 webcodex.tool_runtime.project_resolution29 webcodex_desktop.state30 webcodex_runner.webcodex_runner.job_manager31 webcodex_runner.webcodex_runner.output32 webcodex_runner_registry.state33 webcodex_desktop.commands34 webcodex_runner.webcodex_runner.config35 webcodex_runner_registry.registry36 webcodex.tool_runtime.runtime37 webcodex_runner.webcodex_runner.transport38 webcodex.tool_runtime.window_activity39 webcodex.tool_runtime.kernel40 webcodex.mcp.tools.callwebcodex_computer_control1webcodex_core.desktop_runtime_contract2webcodex_core.workflow_session_contract3webcodex_environment.unified_update4webcodex_openai_tunnel.error5webcodex_openai_tunnel.wire6webcodex_process.unix7webcodex_store.models8webcodex_store.store_primitives9webcodex_tool_runtime_contracts.tool_result10webcodex.auth.context11webcodex_computer12webcodex_core.runner_protocol.job13webcodex_desktop.error14webcodex_environment.service15webcodex_environment.types16webcodex_store17webcodex_tool_contracts.tool_call.canonical_enum18webcodex_workflow_session.model19webcodex.tool_runtime.model_ergonomics_telemetry20webcodex_core.runner_operation21webcodex_desktop.models22webcodex_environment.installer_unix23webcodex_environment.storage24webcodex_core.runner_protocol25webcodex_desktop.state.desktop_core26webcodex_environment.unified_update.download27webcodex.tool_runtime.project_resolution28webcodex_desktop.state29webcodex_runner.webcodex_runner.job_manager30webcodex_runner.webcodex_runner.output31webcodex_runner_registry.state32webcodex_desktop.commands33webcodex_runner.webcodex_runner.config34webcodex_runner_registry.registry35webcodex.tool_runtime.runtime36webcodex_runner.webcodex_runner.transport37webcodex.tool_runtime.window_activity38webcodex.tool_runtime.kernel39webcodex.mcp.tools.call4012411110112721214101112212215611811112611117318161102114116113115471113116163125112122111111122221+1000 more modules (most-connected shown)

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

At a glance — Architecture · 86.4 · Strong ·

At a glance — Maturity · 83.6 · Exemplary ·

At a glance — Readiness · 58.1 · Adequate ·

At a glance — Security · 73.6 · Adequate · gated by D29 ·

At a glance — Event-Driven · 71.2 · Strong ·

At a glance — Event Sourcing · 55.7 · Adequate · gated by ES1 ·

At a glance — Accessibility · 61.6 · Adequate · gated by AC4 ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures62High / Critical
A05:2025 — Injection30High / Critical
A07:2025 — Authentication Failures3High / Critical
A02:2025 — Security Misconfiguration2Medium

Roadmap

Top priorities: Stamp clock/random values into the event in the command; the recovery fold must be a pure function of the event; Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+1.6 ptsLowREDACTED Scanning
Stamp clock/random values into the event in the command; the recovery fold must be a pure function of the event.+2.7 ptsMediumFold determinism
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.+1.2 ptsMediumAsync & latency hygiene
Enable Dependabot/Renovate or a dependency-review gate.+0.9 ptsMediumSecurity & performance tooling
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+0.9 ptsMediumDR & Backup
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+0.8 ptsMediumKeyboard semantics
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+0.8 ptsMediumRelease Hygiene
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.+0.7 ptsMediumVisual & motion safety

File quality

Per-file score 0–10 — a quality signature. Of 728 files carrying findings, judged against the Preview bar: 0% slop · 5% mixed · 95% near-clean.

FileScoreBandWorst signal
REDACTED2.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.2MixedStatic Analysis (SAST): High: REDACTED
src/mcp/tools.rs3.5MixedChange Coupling: Boundary-crossing change coupling: tools.rs ↔ plugin_tools.rs
REDACTED3.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
crates/webcodex-workflow-session/src/persistence.rs4.1MixedChange Coupling: Boundary-crossing change coupling: persistence.rs ↔ tests.rs
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
src/mcp_tests/http_transport.rs5.0MixedChange Coupling: Boundary-crossing change coupling: http_transport.rs ↔ model_ergonomics_telemetry.rs
crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs5.1MixedChange Coupling: Boundary-crossing change coupling: jobs.rs ↔ observe_jobs.rs

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

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

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

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

Could not be resolved — 11

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 66 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 — 66 dimensions across the health lenses
D1D2D3D4D5D6D7D10D12D13D14D15D16D17D19D20D24D28D29D30D31D34D35D36D37D43AC1AC2AC3AC4AC5AC6AX10AX3AX4AX5AX9ED1ES1ES2GD1M1M2M3M4P1P10P2P3P4P5P6PF3R1R10R11R2R3R4R5R6R7R8R9X20X5

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, 4349 of 4388 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 01a1eb63-67bb-7d82-a46a-86654e93a0c8.

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: this repository's production source spans .cs, .ts, .tsx, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 89.6% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • 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 1,560 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 567 test source file(s) (.rs, .py) 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 SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in apps/desktop/ (758 tests); vitest via `npm ci --ignore-scripts` in frontend/ (403 tests); node:test via `npm ci --ignore-scripts` in npm/plugin-sdk/ (17 tests); node:test via `npm install --ignore-scripts` (no lockfile) in npm/webcodex/ (6 tests); node:test via `npm ci --ignore-scripts` in plugins/agent-browser/ (70 tests); node:test via `npm ci --ignore-scripts` in plugins/agent-environment/ (19 tests); node:test via `npm ci --ignore-scripts` in plugins/campus-application/ (79 tests); node:test via `npm ci --ignore-scripts` in plugins/repo-context/ (12 tests); node:test via `npm ci --ignore-scripts` in plugins/repo-info/ (5 tests); node:test via `npm ci --ignore-scripts` in plugins/safe-delete/ (15 tests)): measured (3 flaky) suite(s) did re-run, and came back with 3 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • 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 REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D15 Churn × Complexity Hotspots — 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. A hotspot's complexity is meant to be the worst body its churn actually touched. For src/job_observation.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
  • 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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming 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. 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 — 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. 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.
  • D21 Naming 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. 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's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • 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 — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • 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. `apps/desktop/src/components/NavigationIcon.tsx`, `apps/desktop/src/features/extensions/extension-panel-registry.ts`, `apps/desktop/src/i18n/device-invitation.ts`, `apps/desktop/src/lib/desktop-api.ts`, `apps/desktop/src/lib/desktop-observation.ts`, … (+4 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.
  • D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a REDACTED) is simply not read here yet.
  • AX6 Interface segregation — 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.
  • 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 (compose.build.yaml). compose up failed (exit -1 — compose exited without a cause this engine recognises) — Tool stalled (no output) after 00:06:00.0525033.; runtime evidence skipped.
  • ED1 Handler temporal coupling — 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. 321 further occurrence(s) are not listed individually; the score already reflects all 361.
  • 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'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.
  • 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. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
  • 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. 70 further occurrence(s) are not listed individually; the score already reflects all 110.
  • 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. 123 further occurrence(s) are not listed individually; the score already reflects all 163.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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 repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — 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.
  • X30 Support guard that admits what it rejects — 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.
  • X5 Nullable reference types — 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. 662 further occurrence(s) are not listed individually; the score already reflects all 702.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • 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.
  • 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.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • 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.4 / 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.4 / 10 · rule-coverage 100% · ceiling Prevented

686 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was FirstRun.FirstRun at 165. A further 56 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 ToolCall::tool_name at 194 — they are counted neither in the figure above nor in this dimension's score. 16 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: crates/webcodex-computer/src/platform/windows/input.rs (webcodex_computer::platform::windows::input::windows_key_mapping at 40), crates/webcodex-tool-contracts/src/tool_definition.rs (RunnerCapabilityRequirement::label at 34), src/tool_runtime/dispatch/routing.rs (AuthorizedDispatch::execute at 29), crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs (webcodex_tool_contracts::registry::output_schemas::computer::raw_output_schema_for_tool at 24), apps/desktop/src-tauri/src/models.rs (DesktopOperationKind::as_str at 23), and 11 more not listed here. 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.

webcodex::tool_runtime::git::show_changes::parse_show_changes_output_with_observation (cyclomatic 64) · ×87src/tool_runtime/git/show_changes.rs:1318
ToolRuntime::dispatch_computer_request_for_instance (cyclomatic 92) · ×78src/tool_runtime/computer_tools/request.rs:61
webcodex_runner::webcodex_runner::fake_mcp_gateway::main (cyclomatic 85) · ×66crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:11
webcodex_cli::environment::run_inner (cyclomatic 120) · ×30crates/webcodex-cli/src/environment.rs:314
webcodex_core::runner_operation::decode_operation (cyclomatic 61) · ×29crates/webcodex-core/src/runner_operation.rs:1351

+ 254 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 Cyclomatic Complexity — start with FirstRun.FirstRun (cyclomatic 165), UpdateWorkflow.UpdateWorkflow (cyclomatic 124). — 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 Cyclomatic Complexity from 3.4 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 120; 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

922 method(s) exceeded the cognitive complexity threshold of 15; the worst was webcodex_cli::environment::run_inner at 189.

webcodex::mcp::mcp_post (cognitive 87) · ×149src/mcp.rs:585
webcodex_runner::webcodex_runner::fake_plugin::main (cognitive 146) · ×93crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:13
ToolRuntime::enrich_workbench_execution (cognitive 100) · ×88src/tool_runtime/workbench_execution.rs:73
webcodex_cli::environment::run_inner (cognitive 189) · ×42crates/webcodex-cli/src/environment.rs:314
webcodex_environment::migration::migrate_legacy_environment (cognitive 62) · ×38crates/webcodex-environment/src/migration.rs:171

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

What to do

  1. Bring the 8 bodies over 120 down to 120 or less in Cognitive Complexity — start with webcodex_cli::environment::run_inner (cognitive 189), UpdateWorkflow.UpdateWorkflow (cognitive 183), webcodex_runner::webcodex_runner::fake_plugin::main (cognitive 146). — 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 8 together lifts Cognitive Complexity from 2.0 to about 2.6/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 Classes7.3 / 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 7.3 / 10 · rule-coverage 100% · ceiling Prevented

671 god class(es) detected.

FunctionTooLong: webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool · ×212crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:951
MethodTooLong: ToolCall.session_log_arguments · ×210crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:151
FileTooLong: src/cdp.rs · ×202crates/webcodex-browser/src/cdp.rs
TooManyMethods: ToolRuntime · ×20src/tool_runtime/runtime.rs:106
ClassTooLong: ToolCall · ×15crates/webcodex-tool-contracts/src/tool_call/canonical_enum.rs:8

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

What to do

  1. Resolve the 212 FunctionTooLong finding(s) in God Classes — start with lib.rs (6), jobs.rs (5), patches.rs (5). — One of this dimension's main actionable groups (212 warning-level).
  2. Resolve the 210 MethodTooLong finding(s) in God Classes — start with agent_wake.rs (8), operations.rs (7), communication.rs (6). — One of this dimension's main actionable groups (210 warning-level).
  3. Resolve the 202 FileTooLong finding(s) in God Classes — start with lib.rs (3), coding_agent.rs (3), plugin.rs (3). — One of this dimension's main actionable groups (202 warning-level).

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

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

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

Duplicated block (9 lines × 2) · ×73apps/desktop/src-tauri/src/diagnostics.rs:568
Duplicated block (8 lines × 2) · ×64apps/desktop/src-tauri/src/state/updates.rs:226
Duplicated block (7 lines × 2) · ×63apps/desktop/src-tauri/src/diagnostics.rs:368
Duplicated block (11 lines × 2) · ×60apps/desktop/src-tauri/src/runtime_selection.rs:281
Duplicated block (6 lines × 2) · ×49apps/desktop/src-tauri/src/runner_capability_grant.rs:134

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

What to do

  1. Resolve the 73 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with release_publication.py (4), lib.rs (3), mcp_gateway.rs (3). — One of this dimension's main actionable groups (73 warning-level).
  2. Resolve the 64 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with lib.rs (3), mcp_gateway.rs (3), project_build.rs (3). — One of this dimension's main actionable groups (64 warning-level).
  3. Resolve the 63 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with lib.rs (5), mcp.rs (3), privilege.rs (3). — One of this dimension's main actionable groups (63 warning-level).

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

D5 · Coupling7.5 / 10Strong✓ 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 7.5 / 10 · rule-coverage 100% · ceiling Prevented

33 production modules (Cargo+npm), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 10 module(s) off the main sequence, with abstractness counted on 30 of the 33 (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).

Off the main sequence: webcodex-admin · ×9
Unstable project webcodex
Off the main sequence: webcodex-tool-contracts

What to do

  1. Resolve the 9 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 1 Unstable project webcodex finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 2 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.9 / 10 · rule-coverage 100% · ceiling Verified

2 of 367 classes have LCOM4 above 3.

Low cohesion: NativeEnvironment (LCOM4 10) · ×2crates/webcodex-environment/src/native.rs:22

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with native.rs, tool_definition.rs. — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

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

Detailed fixes: d7_recommendation.md.

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

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

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

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

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

Mock-dominated test: keeps Add Project a single non-replayed write after an uncertain result · ×11frontend/test-v2/relations.test.tsx:106

✓ On the Gold path — maintain.

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

D12 · Dependency Hygiene9.3 8.4 / 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.4 / 10 · rule-coverage 91% · ceiling Verified

15 outdated, 0 yanked direct Cargo dependencies. 62 of 68 direct crates were graded against crates.io (0 not published there, 6 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: agent-client-protocol-schema · ×15

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

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

1 secret(s) detected. 2 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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 597 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, 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.8 / 10Stronggated by 251 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.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/mcp.rs (80×63=5040); crates/webcodex-runner-registry/src/job_updates.rs (74×63=4662); src/tool_runtime/startup_brief.rs (89×40=3560) Repeated repair below the complexity floor: scripts/ui-smoke/work-result-card.mjs (4 of 7 changes were fixes); crates/webcodex-cli/src/webcodex_cli/connect/probe.rs (3 of 5 changes were fixes); crates/webcodex-store/src/window_collaboration.rs (3 of 5 changes were fixes)

Hotspot: src/mcp.rs · ×246src/mcp.rs:585
Repeated repair: scripts/ui-smoke/work-result-card.mjs · ×5scripts/ui-smoke/work-result-card.mjs:12

What to do

  1. Resolve the 246 Hotspot finding(s) in Churn × Complexity Hotspots — start with project_build.rs (3), lib.rs (2), main.rs (2). — One of this dimension's main actionable groups (246 warning-level).
  2. Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with work-result-card.mjs, probe.rs, window_collaboration.rs. — One of this dimension's main actionable groups (5 warning-level).

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

D16 · Bus Factor8.0 / 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 8.0 / 10 · rule-coverage 100% · ceiling Documented

243 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/webcodex-cli/src/webcodex_cli/login.rs. Counted over 1237 of the 1376 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

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

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

D17 · Explicit Debt10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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

1 deducted task-comment markers across 657700 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.

TodoCommentcrates/webcodex-workflow-session/src/model.rs:932

What to do

  1. Resolve the 1 TodoComment finding(s) in Explicit Debt — start with model.rs. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.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

2 of 2 documentation facets pass in full. 269 document(s) read across 34 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D24 · Comment Value10.0 9.9 / 10Exemplary○ Nothing flagged

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.9 / 10 · rule-coverage 99% · ceiling Documented

0 of 335 judged comments only repeat the code they sit on (0.0 %). 3 comment(s) in another language or script were not judged.

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md.

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

31 finding(s): 0 critical, 13 high, 12 medium, 6 low. semgrep hit a parse error in 26 file(s) — `apps/desktop/src-tauri/src/updates/install/native.rs` (line 208, line 365), `apps/desktop/src/components/NavigationIcon.tsx` (line 12), `apps/desktop/src/features/extensions/extension-panel-registry.ts` (line 18), `apps/desktop/src/i18n/device-invitation.ts` (line 33), `apps/desktop/src/lib/desktop-api.ts` (lines 20–155), … (+21 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 8 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

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

What to do

  1. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

59 finding(s): 3 critical, 10 high, 45 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D31 · IaC & Container Security9.8 / 10Stronggated by 2 serious findings✓ 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 9.8 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

  1. Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-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 1237 of the 1376 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 Coupling9.6 / 10Adequategated by 11 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 9.6 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: fake_server.rs↔supervisor.rs 100%; protocol.rs↔tools.rs 83%; edits.rs↔mutations.rs 83%

Boundary-crossing change coupling: git.rs ↔ git.rs · ×11crates/webcodex-tool-contracts/src/registry/output_schemas/git.rs:1
Change coupling: protocol.rs ↔ tools.rs · ×6src/mcp_tests/protocol.rs:1
Change-coupling hub: fake_server.rs → navigation.rs, supervisor.rs, tests.rs · ×4crates/webcodex-lsp/src/fake_server.rs
Change coupling clique: patches.rs, edits.rs, mutations.rscrates/webcodex-runner/src/webcodex_runner/patches.rs

What to do

  1. Resolve the 11 Boundary-crossing change coupling finding(s) in Change Coupling — start with tools.rs (3), persistence.rs (2), git.rs. — One of this dimension's main actionable groups (11 issue-level).
  2. Resolve the 6 Change coupling finding(s) in Change Coupling — start with protocol.rs, recorder_metadata.rs, runner_quic.rs. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 4 Change-coupling hub finding(s) in Change Coupling — start with fake_server.rs, lib.rs, main.rs. — One of this dimension's main actionable groups (4 warning-level).

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

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ 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 7.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

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

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.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

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.

AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged

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.

AC3 · Page structure7.3 / 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>. (×4) — apps/desktop/public/computer-activity.html:2, extensions/browser-bridge/popup.html:2, REDACTED:2, …

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 / 10Weak✓ 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".

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — download/index.html:29
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — frontend/src/runtime-v2/components/WindowActivityFeed.tsx:198
  • This <strong> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — frontend/src/runtime-v2/components/WindowBoardRow.tsx:15
  • 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. (×2) — frontend/src/ui/AccentPalette.tsx:44, frontend/src/ui/ProjectPicker.tsx:97

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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.

AC6 · Visual & motion safety5.3 / 10Adequate✓ 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.

  • `.work-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. — frontend/src/runtime-v2/styles-production.css:9
  • `.goal-list-filters 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. — frontend/src/runtime-v2/styles-production.css:62
  • `.window-collaboration textarea` 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. — frontend/src/runtime-v2/styles-production.css:71
  • `.auth-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. — frontend/src/runtime-v2/styles-responsive.css:1
  • `.composer textarea: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. — frontend/src/runtime-v2/styles-workbench.css:377
  • `.composer textarea` 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. — frontend/src/runtime-v2/styles.css:156
  • `.filter-bar 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. — frontend/src/runtime-v2/styles.css:205
  • `.main-content:focus` 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. — apps/desktop/src/styles/app.css:34

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 composition9.8 / 10Exemplary✓ Tool-verified

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

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

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

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.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

ED1 · Handler temporal coupling7.1 / 10Strong✓ Tool-verified

Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

  • `diagnostics.read_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/diagnostics.rs:106
  • `diagnostics.read_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/diagnostics.rs:112
  • `mcp_providers.executable_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/mcp_providers.rs:474
  • `runtime_selection.probe_binary` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/runtime_selection.rs:252
  • `AppState.copy_console_credential` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/diagnostics.rs:363
  • `environment.validate_legacy_runner_layout` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/environment.rs:57
  • `environment.validate_legacy_runner_layout` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/environment.rs:71
  • `environment.validate_legacy_runner_layout` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/environment.rs:76
  • `environment.config_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/environment.rs:272
  • `environment.config_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — apps/desktop/src-tauri/src/state/environment.rs:286, apps/desktop/src-tauri/src/state/environment.rs:307
  • `DesktopCore.configure_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — apps/desktop/src-tauri/src/state/environment.rs:467, apps/desktop/src-tauri/src/state/environment.rs:549
  • `DesktopCore.migrate_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/environment.rs:823
  • `DesktopCore.migrate_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/environment.rs:877
  • `persistence.read_stored_config` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:62
  • `persistence.read_stored_config` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:77
  • `persistence.write_atomic_file_with_hook` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:143
  • `persistence.write_atomic_file_with_hook` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:164
  • `persistence.atomic_replace` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:171
  • `persistence.read_desktop_server_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:275
  • `persistence.read_desktop_server_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/persistence.rs:290
  • `readiness.ensure_desktop_server_defaults` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/readiness.rs:32
  • `readiness.ensure_desktop_server_defaults` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/readiness.rs:41
  • `runtime_shell.configuration_file_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — apps/desktop/src-tauri/src/state/runtime_shell.rs:211
  • `commands.resolve_token` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-admin/src/commands.rs:811
  • `commands.read_local_secret` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-admin/src/commands.rs:879
  • `BridgeServer.start_at` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `TcpListener::bind`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-browser/src/bridge.rs:324
  • `native.run_inner` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `TcpStream::connect_timeout`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-browser/src/bridge/native.rs:90
  • `profiles.private_dir` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/webcodex-browser/src/profiles.rs:45, crates/webcodex-browser/src/profiles.rs:63
  • `profiles.private_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-browser/src/profiles.rs:81
  • `launcher.trusted_system_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. (×2) — crates/webcodex-cli/src/environment/update/launcher.rs:50, crates/webcodex-cli/src/environment/update/launcher.rs:61
  • `disconnect.resolve_registration` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_dir`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:240
  • `disconnect.observe_exact_registration` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:491
  • `disconnect.observe_exact_registration` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:501
  • `disconnect.remove_exact_registration` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:544
  • `oauth.read_managed_identity` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:141
  • `oauth.read_oauth_profile` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:225

What to do

  • Use the awaited twin of each blocking call, or move the work off the loop with `tokio::task::spawn_blocking` — a synchronous handler cannot simply `.await` in place.
ES1 · Fold determinism2.3 / 10Weak✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

  • `NativeEnvironment.apply` folds a domain event but reads a clock/random source (`Instant::now`/`Utc::now`/`rand`/`Uuid::new_v4`) on the replay path — a replay must derive state PURELY from the event's own fields, or two replays of the same log diverge. Stamp the timestamp/id into the event in the COMMAND, then read it from the event in the fold. (×3) — crates/webcodex-environment/src/native.rs:1616, crates/webcodex-environment/src/native.rs:1637, crates/webcodex-environment/src/native.rs:1641

What to do

  • Stamp clock/random values into the event in the command; the recovery fold must be a pure function of the event.
ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

M1 · Documentation (README)7.9 / 10Strong✓ 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.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation7.0 / 10Strong✓ 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.

  • 1 ADR-shaped document(s) detected by content — `docs/agent/architecture-decisions.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
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.

P10 · Library API & versioning10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 1 public type in `webcodex_environment.service.runtime.implementation` is marked as implementation by its own namespace, folder or name: `ServiceStop` (crates/webcodex-environment/src/service/runtime.rs:29, `implementation`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — crates/webcodex-environment/src/service/runtime.rs:29

What to do

  • Hide `webcodex_environment.service.runtime.implementation` (`ServiceStop`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability6.6 / 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 8/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/webcodex-admin`, `crates/webcodex-browser`, `crates/webcodex-cli`, `crates/webcodex-openai-tunnel` and 2 more.

What to do

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

  • `apps/desktop/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`. — apps/desktop/package.json:14

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ 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.

P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

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

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

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
  • Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
P6 · Release Hygiene5.0 / 10Adequate✓ 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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.

  • `run` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — crates/webcodex-cli/src/webcodex_cli/controller_tui.rs:744
  • `fs.readFileSync` 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. (×2) — scripts/ui-smoke/server.mjs:33, scripts/ui-smoke/server.mjs:44
  • `fs.existsSync` 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. — scripts/ui-smoke/server.mjs:43
  • `fs.writeFileSync` in `scenario` 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. — scripts/ui-smoke/web-page-consistency.mjs:28

What to do

  • Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
  • 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 Safety6.0 / 10Adequate✓ 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.

  • 129 typed · 86 plain JS — the untyped files are apps/desktop/scripts/check-form-control-css.mjs, apps/desktop/scripts/generate-icons.mjs, crates/webcodex-browser/src/cdp/set_value.js, crates/webcodex-browser/src/cdp/widgets/choice.js, crates/webcodex-browser/src/cdp/widgets/common.js, crates/webcodex-browser/src/cdp/widgets/date.js (+80 more).
R10 · Code Duplication7.4 / 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.

  • 8 duplicated blocks under apps/desktop/src/features/ have copies in at least two of the sibling directories activity, extensions, onboarding, projects, settings — 2 of them are reported below, and 6 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 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 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 8 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. — apps/desktop/src/features/onboarding/QuickShareSetup.tsx:19
  • scripts/ui-smoke/desktop-runtime-probe.mjs:19 · scripts/ui-smoke/desktop-runtime-simple.mjs:14 — the two spans are one implementation copied and then locally edited — 532 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/desktop-runtime-probe.mjs:19
  • scripts/ui-smoke/mcp-workspaces.mjs:13 · scripts/ui-smoke/work-result-controls.mjs:10 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/mcp-workspaces.mjs:13
  • apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:22 · apps/desktop/src/features/extensions/SshResourcesPanel.tsx:25 — the two spans are one implementation copied and then locally edited — 200 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. — apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:22
  • apps/desktop/src/features/projects/ProjectsPanel.tsx:111 · apps/desktop/src/features/projects/ProjectsPanel.tsx:145 — the two spans are one implementation copied and then locally edited — 123 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. — apps/desktop/src/features/projects/ProjectsPanel.tsx:111
  • scripts/ui-smoke/smoke.mjs:122 · scripts/ui-smoke/smoke.mjs:139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/ui-smoke/smoke.mjs:122
  • apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:27 · apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:42 — the two spans are one implementation copied and then locally edited — 81 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. — apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:27
  • scripts/ui-smoke/projects-runtime.mjs:7 · scripts/ui-smoke/runtime-overview.mjs:7 — 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. — scripts/ui-smoke/projects-runtime.mjs:7
  • apps/desktop/src/features/onboarding/FirstRun.tsx:114 · apps/desktop/src/features/onboarding/QuickShareSetup.tsx:18 — the two spans are one implementation copied and then locally edited — 95 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. — apps/desktop/src/features/onboarding/FirstRun.tsx:114
  • scripts/ui-smoke/admin-preferences.mjs:123 · scripts/ui-smoke/window-session-record.mjs:231 — the two spans are one implementation copied and then locally edited — 83 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/admin-preferences.mjs:123
  • scripts/ui-smoke/projects-runtime.mjs:77 · scripts/ui-smoke/runtime-workflow.mjs:51 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/projects-runtime.mjs:77
  • scripts/ui-smoke/desktop-page-fixtures.mjs:15 · scripts/ui-smoke/desktop-soft-surfaces.mjs:171 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/desktop-page-fixtures.mjs:15
  • scripts/ui-smoke/runtime-overview.mjs:7 · scripts/ui-smoke/work-header.mjs:7 — 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. — scripts/ui-smoke/runtime-overview.mjs:7
  • apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:38 · apps/desktop/src/features/extensions/McpProvidersPanel.tsx:22 — 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. — apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:38
  • apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:22 · apps/desktop/src/features/extensions/useExtensionsState.ts:41 — the two spans are one implementation copied and then locally edited — 91 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. — apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:22
  • scripts/ui-smoke/collaboration-history.mjs:30 · scripts/ui-smoke/work-result-card.mjs:40 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/collaboration-history.mjs:30
  • scripts/ui-smoke/desktop-long-activity.mjs:9 · scripts/ui-smoke/localized-layout.mjs:4 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/desktop-long-activity.mjs:9
  • scripts/ui-smoke/projects-runtime.mjs:26 · scripts/ui-smoke/runtime-overview.mjs:19 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/projects-runtime.mjs:26
  • apps/desktop/src/features/connection/ConnectionEditor.tsx:12 · apps/desktop/src/features/connection/TunnelConfigDiagnostics.tsx:9 — the two spans are one implementation copied and then locally edited — 56 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. — apps/desktop/src/features/connection/ConnectionEditor.tsx:12
  • apps/desktop/src/features/projects/AddDevice.tsx:108 · apps/desktop/src/features/settings/ConfigurationDataPanel.tsx:120 — the two spans are one implementation copied and then locally edited — 68 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. — apps/desktop/src/features/projects/AddDevice.tsx:108
  • apps/desktop/src/hooks/useAppearance.ts:44 · apps/desktop/src/hooks/useAppearance.ts:55 — 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. — apps/desktop/src/hooks/useAppearance.ts:44
  • apps/desktop/src/i18n/configuration-data.ts:83 · apps/desktop/src/i18n/connections-tools.ts:141 · apps/desktop/src/i18n/device-invitation.ts:35 · apps/desktop/src/i18n/product.ts:349 · +1 more site(s) not listed — the 5 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. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — apps/desktop/src/i18n/configuration-data.ts:83
  • apps/desktop/src/i18n/presentation.ts:226 · apps/desktop/src/i18n/presentation.ts:234 · apps/desktop/src/i18n/presentation.ts:242 — all 3 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. — apps/desktop/src/i18n/presentation.ts:226
  • scripts/ui-smoke/admin-preferences.mjs:2 · scripts/ui-smoke/desktop-resize-theme.mjs:3 · scripts/ui-smoke/session-navigation.mjs:3 · scripts/ui-smoke/sidebar-geometry.mjs:2 · +2 more site(s) not listed — the 6 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. There is one copy in each of 6 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — scripts/ui-smoke/admin-preferences.mjs:2
  • scripts/ui-smoke/agents-workbench.mjs:6 · scripts/ui-smoke/runtime-overview.mjs:7 · scripts/ui-smoke/work-header.mjs:7 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — scripts/ui-smoke/agents-workbench.mjs:6
  • scripts/ui-smoke/desktop-clarity-layout.mjs:54 · scripts/ui-smoke/desktop-page-fixtures.mjs:16 · scripts/ui-smoke/desktop-soft-surfaces.mjs:172 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/desktop-clarity-layout.mjs:54
  • scripts/ui-smoke/desktop-soft-surfaces.mjs:93 · scripts/ui-smoke/web-soft-surfaces.mjs:75 — the two spans are one implementation copied and then locally edited — 52 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/desktop-soft-surfaces.mjs:93
  • scripts/ui-smoke/mcp-workspaces.mjs:450 · scripts/ui-smoke/mcp-workspaces.mjs:489 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/mcp-workspaces.mjs:450
  • scripts/ui-smoke/pdf-document-reader.mjs:192 · scripts/ui-smoke/pdf-document-reader.mjs:229 · scripts/ui-smoke/pdf-document-reader.mjs:251 · scripts/ui-smoke/pdf-document-reader.mjs:308 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/pdf-document-reader.mjs:192
  • scripts/ui-smoke/smoke.mjs:360 · scripts/ui-smoke/smoke.mjs:649 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/smoke.mjs:360
  • apps/desktop/src/features/extensions/CodingAgentEditor.tsx:44 · apps/desktop/src/features/extensions/McpProviderEditor.tsx:20 — 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. — apps/desktop/src/features/extensions/CodingAgentEditor.tsx:44
  • scripts/ui-smoke/admin-preferences.mjs:105 · scripts/ui-smoke/web-soft-surfaces.mjs:44 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/admin-preferences.mjs:105
  • scripts/ui-smoke/sidebar-geometry.mjs:7 · scripts/ui-smoke/web-soft-surfaces.mjs:7 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — scripts/ui-smoke/sidebar-geometry.mjs:7
  • scripts/ui-smoke/sidebar-geometry.mjs:122 · scripts/ui-smoke/web-detail-consistency.mjs:101 — the two spans are one implementation copied and then locally edited — 97 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/sidebar-geometry.mjs:122
  • scripts/ui-smoke/smoke.mjs:520 · scripts/ui-smoke/smoke.mjs:578 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/ui-smoke/smoke.mjs:520
  • scripts/ui-smoke/tab-alignment.mjs:110 · scripts/ui-smoke/window-workspace.mjs:20 — the two spans are one implementation copied and then locally edited — 61 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/tab-alignment.mjs:110
  • scripts/ui-smoke/window-collaboration.mjs:38 · scripts/ui-smoke/work-result-card.mjs:194 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/ui-smoke/window-collaboration.mjs:38
  • apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:15 · apps/desktop/src/features/settings/DiagnosticsPanel.tsx:27 — 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. — apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:15
  • apps/desktop/src/features/settings/LocalServicesPanel.tsx:11 · apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — apps/desktop/src/features/settings/LocalServicesPanel.tsx:11
  • apps/desktop/src/i18n/instructions.ts:24 · apps/desktop/src/i18n/service-scope.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. — apps/desktop/src/i18n/instructions.ts:24

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 Boundaries7.6 / 10Strong✓ 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.

  • apps/desktop/src/main.tsx:7 reaches into another package with a relative path (../../../frontend/src/ui/foundation.css) — import the package by name instead. — apps/desktop/src/main.tsx:7
  • scripts/ui-smoke/collaboration-history.mjs:5 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/ui-smoke/collaboration-history.mjs:5
  • scripts/ui-smoke/mcp-workspaces.mjs:6 imports src/mcp_tests/workbench_upgrade_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/ui-smoke/mcp-workspaces.mjs:6
  • scripts/ui-smoke/mcp-workspaces.mjs:7 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/ui-smoke/mcp-workspaces.mjs:7
  • scripts/ui-smoke/work-result-card.mjs:5 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/ui-smoke/work-result-card.mjs:5
  • scripts/ui-smoke/work-result-controls.mjs:6 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/ui-smoke/work-result-controls.mjs:6

What to do

  • Fix the listed violations: move the shared test helper into a source directory production code may depend on (5 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (1 row).
R2 · Cyclomatic Complexity8.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.

  • FirstRun has cyclomatic complexity 125 and cognitive complexity 100; 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. — apps/desktop/src/features/onboarding/FirstRun.tsx:47
  • UpdateWorkflow has cyclomatic complexity 119 and cognitive complexity 79; 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. — apps/desktop/src/features/settings/UpdateWorkflow.tsx:34
  • DiagnosticsContents has cyclomatic complexity 54 and cognitive complexity 49; 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. — apps/desktop/src/features/settings/DiagnosticsPanel.tsx:23
  • invoke has cyclomatic complexity 52 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/ui-smoke/desktop-shim.js:18
  • ReadinessBanner has cyclomatic complexity 50 and cognitive complexity 42; 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. — apps/desktop/src/features/dashboard/ReadinessBanner.tsx:8
  • ConnectionCard has cyclomatic complexity 49 and cognitive complexity 47; 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. — apps/desktop/src/features/connection/ConnectionCard.tsx:34
  • ConnectionEditor has cyclomatic complexity 47 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 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. — apps/desktop/src/features/connection/ConnectionEditor.tsx:10
  • (anonymous) has cyclomatic complexity 46 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/ui-smoke/mcp-workspaces.mjs:65
  • SettingsView has cyclomatic complexity 45 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 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. — apps/desktop/src/features/settings/SettingsPanel.tsx:57
  • AboutPanelContent has cyclomatic complexity 42 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 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. — apps/desktop/src/features/settings/AboutPanel.tsx:18
  • RunnerCapacitySettings has cyclomatic complexity 42 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 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. — apps/desktop/src/features/settings/RunnerCapacityPanel.tsx:21
  • CloudflareConnectionCard has cyclomatic complexity 42 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 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. — apps/desktop/src/features/connection/CloudflareConnectionCard.tsx:61
  • ProjectsPanel has cyclomatic complexity 41 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 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. — apps/desktop/src/features/projects/ProjectsPanel.tsx:16
  • ConnectionPanel has cyclomatic complexity 41 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. — apps/desktop/src/features/connection/ConnectionPanel.tsx:18
  • control has cyclomatic complexity 40 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. — extensions/browser-bridge/worker.js:153
  • RuntimePanelContent has cyclomatic complexity 39 and cognitive complexity 33; 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. — apps/desktop/src/features/settings/RuntimePanel.tsx:18
  • DesktopApp has cyclomatic complexity 37 and cognitive complexity 29; 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. — apps/desktop/src/App.tsx:34
  • ActivityPanel has cyclomatic complexity 36 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 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. — apps/desktop/src/features/activity/ActivityPanel.tsx:56
  • execute has cyclomatic complexity 33 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. — plugins/agent-environment/src/bridge.mjs:39
  • (anonymous) has cyclomatic complexity 32 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. — scripts/ui-smoke/server.mjs:12
  • (anonymous) has cyclomatic complexity 29 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. — apps/desktop/src/hooks/useDesktopWorkspace.ts:109
  • inspect has cyclomatic complexity 28 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/ui-smoke/admin-preferences.mjs:22
  • (anonymous) has cyclomatic complexity 27 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/desktop/src/features/projects/RunnerDevices.tsx:23
  • RunnerFileAccess has cyclomatic complexity 27 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/features/settings/RunnerFileAccess.tsx:35
  • inspect has cyclomatic complexity 26 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. — scripts/ui-smoke/sidebar-geometry.mjs:12
  • noProxyMatches has cyclomatic complexity 25 and cognitive complexity 41; 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. — REDACTED:178
  • renderEntry has cyclomatic complexity 25 and cognitive complexity 21; 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. — apps/desktop/src/features/settings/ConfigurationDataPanel.tsx:86
  • capture has cyclomatic complexity 24 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. — scripts/ui-smoke/web-page-consistency.mjs:51
  • extractTarGz has cyclomatic complexity 24 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. — REDACTED:646
  • ProjectRow has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/desktop/src/features/projects/ProjectRows.tsx:24
  • ComputerPermissions has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/desktop/src/features/settings/ComputerPermissions.tsx:14
  • ExtensionsPanel has cyclomatic complexity 24 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/desktop/src/features/extensions/ExtensionsPanel.tsx:20
  • (anonymous) has cyclomatic complexity 23 and cognitive complexity 28; 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. — extensions/browser-bridge/worker.js:83
  • desktopErrorPresentation has cyclomatic complexity 23 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/i18n/presentation.ts:164
  • RuntimeConsolePanel has cyclomatic complexity 23 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/features/console/RuntimeConsolePanel.tsx:13
  • (anonymous) has cyclomatic complexity 22 and cognitive complexity 21; 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. — frontend/test-v2/navigation.test.tsx:21
  • poll has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/desktop/src/features/workspace/WorkspaceContext.tsx:136
  • unregisterSelected has cyclomatic complexity 21 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. — apps/desktop/src/features/projects/ProjectsPanel.tsx:152
  • captureProtectedNpmEnvironment has cyclomatic complexity 21 and cognitive complexity 23; 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. — npm/webcodex/bin/wrapper.js:76
  • ManagedInstructionsPanel has cyclomatic complexity 21 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:11
R3 · Large Files9.5 / 10Exemplary✓ Tool-verified

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

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

  • REDACTED has 897 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
  • apps/desktop/src/i18n/update-text.ts has 563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/desktop/src/i18n/update-text.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.3 / 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) — crates/webcodex-browser/src/cdp/widgets/common.js:1, crates/webcodex-browser/src/cdp/widgets/date.js:1, crates/webcodex-browser/src/cdp/widgets/choice.js:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness8.2 / 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 REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.2 / 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.

  • 4 file(s) (~565 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — npm/plugin-sdk
  • Unreachable from the 94 application, 4 tooling and 153 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×12) — scripts/ui-smoke/work-result-card.mjs, scripts/ui-smoke/window-workspace.mjs, scripts/ui-smoke/desktop-clarity-layout.mjs, …
  • Nothing imports this binding — it is safe to review for removal. (×5) — apps/desktop/src/i18n/presentation.ts:48, apps/desktop/src/i18n/presentation.ts:229, apps/desktop/src/i18n/presentation.ts:237, …
  • 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. — frontend/test-v2/admin_controller.test.ts:77

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 Hygiene9.0 / 10Exemplary✓ 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.

  • Only test files import it (first: frontend/test-v2/navigation.test.tsx:2) — move it to devDependencies. — REDACTED:43

What to do

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

  • apps/desktop/src/i18n/locale.tsx → apps/desktop/src/lib/desktop-api.ts → apps/desktop/src/i18n/locale.tsx — apps/desktop/src/i18n/locale.tsx:9

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types9.5 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.

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

  • `std::thread::Builder::new().name("webcodex-agent-continuations".to_string()).spawn(move||{while let Ok(agent_id)=dispatch_rx.recv(){loop{worker_state.dispatch_one(&agent_id);let mut scheduled=worker_state.scheduled_agents.lock().expect("Agent continuation schedule mutex poisoned");let run_again=scheduled.get_mut(&agent_id).is_some_and(|dirty|{let run_again=*dirty;*dirty=false;run_again});if!run_again{scheduled.remove(&agent_id);break;}}}})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/agent_wake.rs:304
  • `peer_id_from_window_key(&self.key)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `peer_id` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/client_window.rs:66
  • `ClientWindow::from_opaque("http-cookie",&raw)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `api_window` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/client_window.rs:257
  • `canonical.get_mut("properties").and_then(Value::as_object_mut)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/model_surface.rs:178
  • `properties.remove("follow_up_kind")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/model_surface.rs:181
  • `properties.remove("tool")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/model_surface.rs:184
  • `properties.remove("arguments")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/model_surface.rs:187
  • `schema.pointer("/properties/follow_up_kind/const").and_then(Value::as_str)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_calls_in_value_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/model_surface.rs:316
  • `lists.remove(&project.id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `scan_runtime_home` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/runtime_console_http.rs:1331
  • `outcome.result` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `tools_call` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/runtime_http.rs:411
  • `auth` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `list` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/ssh_resource_gateway.rs:467
  • `auth` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve_binding` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/ssh_resource_gateway.rs:618
  • `crate::runner_http::runner_access_from_auth(Some(&auth))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `maintenance` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/upgrade_http.rs:95
  • `serde_json::to_value(&operation)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_browser_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/browser_tools.rs:389
  • `payload.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_browser_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/browser_tools.rs:406
  • `validation_adapter_for_tool("cargo_fmt")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cargo_fmt_with_context_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/cargo.rs:121
  • `adapter.build_command(ValidationCommandOptions{check:true,..ValidationCommandOptions::default()})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cargo_fmt_with_context_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/cargo.rs:127
  • `adapter.build_command(ValidationCommandOptions{check:false,..ValidationCommandOptions::default()})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cargo_fmt_with_context_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/cargo.rs:230
  • `result.output.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_cargo_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/cargo_tools.rs:198
  • `std::str::from_utf8(&raw[..error.valid_up_to()])` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `frozen_changes_file_content` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/changes.rs:1015
  • `serde_json::to_value(self)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `to_value` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/closeout_evidence.rs:193
  • `projected.as_object()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `install_closeout_decision` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/closeout_projection.rs:101
  • `schema["properties"].as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `phase_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:301
  • `schema["required"].as_array_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `phase_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — src/tool_runtime/control_sidecar.rs:305, src/tool_runtime/control_sidecar.rs:309
  • `field.as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `phase_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:306
  • `serde_json::to_value(value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:397
  • `value.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:398
  • `value.as_object_mut().unwrap().remove(kind)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:398
  • `communication_request(&value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `execute_communication_before` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:604
  • `request(kind,value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `after` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:640
  • `communication_request(&value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `after` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:660
  • `outcome.result.as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `decorate` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/control_sidecar.rs:683
  • `serde_json::to_value(value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_observation` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/external_observations.rs:23
  • `query` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_file_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/file_tools.rs:89
  • `serde_json::to_vec(&source.presentation_value())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `review_snapshot_id` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/git_review_snapshot.rs:222
  • `serde_json::to_vec(projection_identity)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `review_snapshot_id` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/git_review_snapshot.rs:225
  • `self.sessions.session_project(&session_id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `session_handoff_observation` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/handoff.rs:198
  • `output.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `session_handoff_observation` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/handoff.rs:564
  • `compact.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `session_handoff_observation` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — src/tool_runtime/handoff.rs:603

What to do

  • Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
  • Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.

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 Health70.4Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture86.4StrongStrongest area.
Maturity83.6ExemplarySolid.
Readiness58.1AdequateAcceptable, with room to improve.
Security73.6Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven71.2StrongSolid.
Event Sourcing55.7Adequate — gated by ES1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility61.6Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 4 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.

  • D11 Test Reliability — 1 observation(s) recorded · Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 22 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 61 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 — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX6 Interface segregation — AX6 reached only 9% of this repository's production lines — rust (615,191 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • 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 -1 — compose exited without a cause this engine recognises) — Tool stalled (no output) after 00:06:00.0525033.; 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 — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • 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.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (webcodex-environment), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 9 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — applicable but not scored (4 signals for this style, 3 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 267 value object(s); 4 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
  • IC1 Incompleteness & stubs — IC1 reached only 0% of this repository's production lines — rust (615,191 lines), python (28,050 lines), javascript (16,423 lines), typescript (14,166 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 50 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • 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 — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (615,191 lines), python (28,050 lines), javascript (16,423 lines), typescript (14,166 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — 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
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — rust (615,191 lines), python (28,050 lines), javascript (16,423 lines), typescript (14,166 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X2 Cancellation propagation — no async method does work a token could cancel
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 0% of this repository's production lines — rust (615,191 lines), python (28,050 lines), javascript (16,423 lines), typescript (14,166 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — X30 reached only 0% of this repository's production lines — rust (615,191 lines), python (28,050 lines), javascript (16,423 lines), typescript (14,166 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — 88 finding(s)
ED1 · Handler temporal coupling · Blocking call on the event loop · ×40
  • Blocking call on the event loop: diagnostics.read_env calls `std::fs::symlink_metadata` apps/desktop/src-tauri/src/diagnostics.rs:106 — `diagnostics.read_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: diagnostics.read_env calls `File::open` apps/desktop/src-tauri/src/diagnostics.rs:112 — `diagnostics.read_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: mcp_providers.executable_file calls `std::fs::metadata` apps/desktop/src-tauri/src/mcp_providers.rs:474 — `mcp_providers.executable_file` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_selection.probe_binary calls `std::fs::metadata` apps/desktop/src-tauri/src/runtime_selection.rs:252 — `runtime_selection.probe_binary` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: AppState.copy_console_credential calls `File::open` apps/desktop/src-tauri/src/state/diagnostics.rs:363 — `AppState.copy_console_credential` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: environment.validate_legacy_runner_layout calls `std::fs::symlink_metadata` apps/desktop/src-tauri/src/state/environment.rs:57 — `environment.validate_legacy_runner_layout` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: environment.validate_legacy_runner_layout calls `std::fs::metadata` apps/desktop/src-tauri/src/state/environment.rs:71 — `environment.validate_legacy_runner_layout` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: environment.validate_legacy_runner_layout calls `File::open` apps/desktop/src-tauri/src/state/environment.rs:76 — `environment.validate_legacy_runner_layout` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: environment.config_fingerprint calls `std::fs::metadata` apps/desktop/src-tauri/src/state/environment.rs:272 — `environment.config_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: environment.config_fingerprint calls `std::fs::read_to_string` apps/desktop/src-tauri/src/state/environment.rs:286 — `environment.config_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: environment.config_fingerprint calls `std::fs::read_to_string` apps/desktop/src-tauri/src/state/environment.rs:307 — `environment.config_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: DesktopCore.configure_environment calls `std::fs::canonicalize` apps/desktop/src-tauri/src/state/environment.rs:467 — `DesktopCore.configure_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: DesktopCore.configure_environment calls `std::fs::canonicalize` apps/desktop/src-tauri/src/state/environment.rs:549 — `DesktopCore.configure_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: DesktopCore.migrate_environment calls `std::fs::read_to_string` apps/desktop/src-tauri/src/state/environment.rs:823 — `DesktopCore.migrate_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: DesktopCore.migrate_environment calls `std::fs::canonicalize` apps/desktop/src-tauri/src/state/environment.rs:877 — `DesktopCore.migrate_environment` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::canonicalize`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.read_stored_config calls `std::fs::metadata` apps/desktop/src-tauri/src/state/persistence.rs:62 — `persistence.read_stored_config` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.read_stored_config calls `std::fs::read` apps/desktop/src-tauri/src/state/persistence.rs:77 — `persistence.read_stored_config` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.write_atomic_file_with_hook calls `std::fs::create_dir_all` apps/desktop/src-tauri/src/state/persistence.rs:143 — `persistence.write_atomic_file_with_hook` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.write_atomic_file_with_hook calls `std::fs::remove_file` apps/desktop/src-tauri/src/state/persistence.rs:164 — `persistence.write_atomic_file_with_hook` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::remove_file`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.atomic_replace calls `std::fs::rename` apps/desktop/src-tauri/src/state/persistence.rs:171 — `persistence.atomic_replace` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::rename`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.read_desktop_server_env calls `std::fs::symlink_metadata` apps/desktop/src-tauri/src/state/persistence.rs:275 — `persistence.read_desktop_server_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::symlink_metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: persistence.read_desktop_server_env calls `std::fs::read` apps/desktop/src-tauri/src/state/persistence.rs:290 — `persistence.read_desktop_server_env` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: readiness.ensure_desktop_server_defaults calls `std::fs::metadata` apps/desktop/src-tauri/src/state/readiness.rs:32 — `readiness.ensure_desktop_server_defaults` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::metadata`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: readiness.ensure_desktop_server_defaults calls `std::fs::read_to_string` apps/desktop/src-tauri/src/state/readiness.rs:41 — `readiness.ensure_desktop_server_defaults` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • Blocking call on the event loop: runtime_shell.configuration_file_fingerprint calls `File::open` apps/desktop/src-tauri/src/state/runtime_shell.rs:211 — `runtime_shell.configuration_file_fingerprint` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `File::open`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
  • + 15 more in this group — see findings.md.
D35 · Change Coupling · Boundary-crossing change coupling · ×11
  • Boundary-crossing change coupling: git.rs ↔ git.rs crates/webcodex-tool-contracts/src/registry/output_schemas/git.rs:1 — `crates/webcodex-tool-contracts/src/registry/output_schemas/git.rs` (context crates) and `src/tool_runtime/git.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 8 shared commits counted here, the most recent 3 are `3ab51de4` Fence paged reads to exact snapshots (#474); `f1361496` Add safe Git hunk fragment continuation (#455); `ea9b1626` Improve diff review recovery (#324) — run `git show` on any of them.
  • Boundary-crossing change coupling: jobs.rs ↔ observe_jobs.rs crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:1 — `crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs` (context crates) and `src/tool_runtime/observe_jobs.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 60% of the time (12 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 12 shared commits counted here, the most recent 3 are `b6f8a00f` fix(jobs): compact successful observations within mixed batches (#1308); `dff90878` fix(runtime): make run_job budgets and execution evidence explicit (#…; `75d36d62` feat(jobs): classify meaningful vs heartbeat wake after batch truncat… — run `git show` on any of them.
  • Boundary-crossing change coupling: coding_tasks.rs ↔ coding_task.rs crates/webcodex-tool-contracts/src/registry/output_schemas/coding_tasks.rs:1 — `crates/webcodex-tool-contracts/src/registry/output_schemas/coding_tasks.rs` (context crates) and `src/tool_runtime/coding_task.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 57% of the time (27 of the 47 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 27 shared commits counted here, the most recent 3 are `f0def36c` refactor(startup): retire unused full diagnostics and projection help…; `399fa744` perf(runtime): streamline bootstrap, validation truth, and Job UX (#768); `7a4981ad` feat(session): add durable model-facing session refs (#666) — run `git show` on any of them.
  • Boundary-crossing change coupling: recorder_metadata.rs ↔ dispatch.rs crates/webcodex-tool-runtime-contracts/src/recorder_metadata.rs:1 — `crates/webcodex-tool-runtime-contracts/src/recorder_metadata.rs` (context crates) and `src/tool_runtime/dispatch.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 8 shared commits counted here, the most recent 3 are `105c64cd` feat(skills): add trusted skill resource execution (#491) (at that commit the file was still `crates/webcodex-tool-runtime-contracts/src/tool_call.rs`); `dbebb2fe` feat(skills): add exact-name skill loading (#490) (at that commit the file was still `crates/webcodex-tool-runtime-contracts/src/tool_call.rs`); `01333b96` Close remaining runtime turn-economy friction (#487) (at that commit the file was still `crates/webcodex-tool-runtime-contracts/src/tool_call.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: persistence.rs ↔ tests.rs crates/webcodex-workflow-session/src/persistence.rs:1 — `crates/webcodex-workflow-session/src/persistence.rs` (context crates) and `src/tool_runtime/sessions/tests.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 8 shared commits counted here, the most recent 3 are `39c096af` Drop pre-0.4 persisted-state compatibility (#238) (at that commit the file was still `src/tool_runtime/sessions/persistence.rs`); `d0c82e1e` Canonicalize session ledger persistence compatibility (#232) (at that commit the file was still `src/tool_runtime/sessions/persistence.rs`); `f122e336` Fix logical invocation accounting (#206) (at that commit the file was still `src/tool_runtime/sessions/persistence.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: agent_task.rs ↔ dispatch.rs crates/webcodex-store/src/agent_task.rs:1 — `crates/webcodex-store/src/agent_task.rs` (context crates) and `src/tool_runtime/dispatch.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 7 shared commits counted here, the most recent 3 are `be952daf` feat(runtime): recover agent tasks from attempt_ref (#727); `4557e66d` feat(runtime): add agent_task_attempt_ref for fenced continuation (#688); `3ec0c709` feat(goal): add explicit controller agent routing (#541) — run `git show` on any of them.
  • Boundary-crossing change coupling: http_transport.rs ↔ model_ergonomics_telemetry.rs src/mcp_tests/http_transport.rs:1 — `src/mcp_tests/http_transport.rs` (context mcp_tests) and `src/tool_runtime/model_ergonomics_telemetry.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 7 shared commits counted here, the most recent 3 are `b967a155` feat: measure input normalization and repair ergonomics (#774); `d80d4af8` Simplify Context result projections (#446); `f75395a1` Canonicalize Session and Job recovery actions (#442) — run `git show` on any of them.
  • Boundary-crossing change coupling: tools.rs ↔ plugin_tools.rs src/mcp/tools.rs:1 — `src/mcp/tools.rs` (context mcp) and `src/mcp_tests/plugin_tools.rs` (context mcp_tests) sit in DIFFERENT parts of the tree yet change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 7 shared commits counted here, the most recent 3 are `7ae5d2b4` fix(mcp): preserve CLI collaboration and explicit acknowledgements (#…; `4b0fc069` refactor(mcp): add common invocation envelope (#717); `5bc4a83f` feat(session): accept session refs for recorder provenance (#670) — run `git show` on any of them.
  • Boundary-crossing change coupling: persistence.rs ↔ mod.rs crates/webcodex-workflow-session/src/persistence.rs:1 — `crates/webcodex-workflow-session/src/persistence.rs` (context crates) and `src/tool_runtime/sessions/mod.rs` (context tool_runtime) sit in DIFFERENT parts of the tree yet change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 7 shared commits counted here, the most recent 3 are `d7c6470e` fix(session): preserve durable active identity across capacity churn …; `f122e336` Fix logical invocation accounting (#206) (at that commit the file was still `src/tool_runtime/sessions/persistence.rs`); `2f5048d0` Add durable Session message edit and withdrawal (#160) (at that commit the file was still `src/tool_runtime/sessions/persistence.rs`) — run `git show` on any of them.
  • Boundary-crossing change coupling: tools.rs ↔ protocol.rs src/mcp/tools.rs:1 — `src/mcp/tools.rs` (context mcp) and `src/mcp_tests/protocol.rs` (context mcp_tests) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `7ae5d2b4` fix(mcp): preserve CLI collaboration and explicit acknowledgements (#…; `4b0fc069` refactor(mcp): add common invocation envelope (#717); `28ba6258` perf(runtime): reduce model-facing status and discovery cost (#695) — run `git show` on any of them.
  • Boundary-crossing change coupling: tools.rs ↔ goal_plan_app.rs src/mcp/tools.rs:1 — `src/mcp/tools.rs` (context mcp) and `src/mcp_tests/goal_plan_app.rs` (context mcp_tests) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 5 shared commits counted here, the most recent 3 are `372bdb08` Diagnose continuation polling, eligibility and Wake timing (#1144); `5001d4ff` refactor(mcp): compose bundled App resources and descriptor bindings …; `4b0fc069` refactor(mcp): add common invocation envelope (#717) — run `git show` on any of them.
D30 · Dependency Vulnerabilities · High CVE · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Flaky test · ×3
  • Flaky test: apps/desktop/src/features/settings/SettingsPanel.races.test.tsx::Settings observation and action ownership does not restore an old Desktop state from PowerShell guidance after unmount — Passed 2×, failed 1× across repeated runs.
  • Flaky test: frontend/test-v2/window-first-work.test.tsx::shows active Window work without any Workflow Session and keeps observe calls visible frontend/test-v2/window-first-work.test.tsx:48 — Passed 2×, failed 1× across repeated runs.
  • Flaky test: frontend/test-v2/window-session-record.test.tsx::Window-owned Session record navigation keeps the exact Window, activity filters, DOM and scroll when opening and returning from a Session record — Passed 2×, failed 1× across repeated runs.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
ES1 · Fold determinism · Non-deterministic recovery fold · ×3
  • Non-deterministic recovery fold: NativeEnvironment.apply crates/webcodex-environment/src/native.rs:1616 — `NativeEnvironment.apply` folds a domain event but reads a clock/random source (`Instant::now`/`Utc::now`/`rand`/`Uuid::new_v4`) on the replay path — a replay must derive state PURELY from the event's own fields, or two replays of the same log diverge. Stamp the timestamp/id into the event in the COMMAND, then read it from the event in the fold.
  • Non-deterministic recovery fold: NativeEnvironment.apply crates/webcodex-environment/src/native.rs:1637 — `NativeEnvironment.apply` folds a domain event but reads a clock/random source (`Instant::now`/`Utc::now`/`rand`/`Uuid::new_v4`) on the replay path — a replay must derive state PURELY from the event's own fields, or two replays of the same log diverge. Stamp the timestamp/id into the event in the COMMAND, then read it from the event in the fold.
  • Non-deterministic recovery fold: NativeEnvironment.apply crates/webcodex-environment/src/native.rs:1641 — `NativeEnvironment.apply` folds a domain event but reads a clock/random source (`Instant::now`/`Utc::now`/`rand`/`Uuid::new_v4`) on the replay path — a replay must derive state PURELY from the event's own fields, or two replays of the same log diverge. Stamp the timestamp/id into the event in the COMMAND, then read it from the event in the fold.
AC4 · Keyboard semantics · Click handler on a non-interactive <article> · ×1
  • Click handler on a non-interactive <article> frontend/src/runtime-v2/components/WindowActivityFeed.tsx:198 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Double-click handler on a non-interactive <strong> · ×1
  • Double-click handler on a non-interactive <strong> frontend/src/runtime-v2/components/WindowBoardRow.tsx:15 — This <strong> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) apps/desktop/src/i18n/locale.tsx:9 — apps/desktop/src/i18n/locale.tsx → apps/desktop/src/lib/desktop-api.ts → apps/desktop/src/i18n/locale.tsx
Serious — 4181 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×246
  • Hotspot: src/mcp.rs src/mcp.rs:585 — src/mcp.rs changed 80 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in webcodex::mcp::mcp_post at line 585. 13 of those changes were fix/bug commits, and the other 67 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/mcp.rs`: 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: crates/webcodex-runner-registry/src/job_updates.rs crates/webcodex-runner-registry/src/job_updates.rs:2183 — crates/webcodex-runner-registry/src/job_updates.rs changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in RunnerRegistry::update_job_checked at line 2183. 6 of those changes were fix/bug commits, and the other 68 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner-registry/src/job_updates.rs`: 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: src/tool_runtime/startup_brief.rs src/tool_runtime/startup_brief.rs:1084 — src/tool_runtime/startup_brief.rs changed 89 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in webcodex::tool_runtime::startup_brief::enforce_hard_size_limit at line 1084. 10 of those changes were fix/bug commits, and the other 79 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/tool_runtime/startup_brief.rs`: 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: crates/webcodex-cli/src/lib.rs crates/webcodex-cli/src/lib.rs:2749 — crates/webcodex-cli/src/lib.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in webcodex_cli::run at line 2749. 2 of those changes were fix/bug commits, and the other 40 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-cli/src/lib.rs`: 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: apps/desktop/src/features/onboarding/FirstRun.tsx apps/desktop/src/features/onboarding/FirstRun.tsx:47 — apps/desktop/src/features/onboarding/FirstRun.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 165 in FirstRun.FirstRun at line 47. 3 of those changes were fix/bug commits, and the other 16 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- apps/desktop/src/features/onboarding/FirstRun.tsx`: 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: src/mcp/tools.rs src/mcp/tools.rs:332 — src/mcp/tools.rs changed 115 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in webcodex::mcp::tools::mcp_tools_list_payload_with_exposure at line 332. 17 of those changes were fix/bug commits, and the other 98 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/mcp/tools.rs`: 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: crates/webcodex-runner-registry/src/requests.rs crates/webcodex-runner-registry/src/requests.rs:2557 — crates/webcodex-runner-registry/src/requests.rs changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in RunnerRegistry::enqueue_computer_checked at line 2557. 3 of those changes were fix/bug commits, and the other 80 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner-registry/src/requests.rs`: 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: src/tool_runtime/kernel.rs src/tool_runtime/kernel.rs:351 — src/tool_runtime/kernel.rs changed 109 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in ToolRuntime::call_tool_with_context_inner at line 351. 7 of those changes were fix/bug commits, and the other 102 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/tool_runtime/kernel.rs`: 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: crates/webcodex-runner/src/main.rs crates/webcodex-runner/src/main.rs:86 — crates/webcodex-runner/src/main.rs changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in webcodex_runner::parse_runner_args at line 86. 5 of those changes were fix/bug commits, and the other 78 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner/src/main.rs`: 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: crates/webcodex-core/src/runner_protocol.rs crates/webcodex-core/src/runner_protocol.rs:1370 — crates/webcodex-core/src/runner_protocol.rs changed 112 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in RunnerConfigOperationResponse::validate at line 1370. 7 of those changes were fix/bug commits, and the other 105 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-core/src/runner_protocol.rs`: 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: crates/webcodex-cli/src/environment.rs crates/webcodex-cli/src/environment.rs:314 — crates/webcodex-cli/src/environment.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 120 in webcodex_cli::environment::run_inner at line 314. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-cli/src/environment.rs`: 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: src/mcp/discovery.rs src/mcp/discovery.rs:29 — src/mcp/discovery.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in webcodex::mcp::discovery::compact_tool at line 29. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/mcp/discovery.rs`: 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: crates/webcodex-core/src/runner_operation.rs crates/webcodex-core/src/runner_operation.rs:1351 — crates/webcodex-core/src/runner_operation.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in webcodex_core::runner_operation::decode_operation at line 1351. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-core/src/runner_operation.rs`: 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: apps/desktop/src/features/projects/ProjectsPanel.tsx apps/desktop/src/features/projects/ProjectsPanel.tsx:16 — apps/desktop/src/features/projects/ProjectsPanel.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in ProjectsPanel.ProjectsPanel at line 16. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- apps/desktop/src/features/projects/ProjectsPanel.tsx`: 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: crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:951 — crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool at line 951. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs`: 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: crates/webcodex-runner/src/webcodex_runner/dispatch.rs crates/webcodex-runner/src/webcodex_runner/dispatch.rs:332 — crates/webcodex-runner/src/webcodex_runner/dispatch.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome at line 332. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner/src/webcodex_runner/dispatch.rs`: 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: src/tool_runtime/jobs.rs src/tool_runtime/jobs.rs:620 — src/tool_runtime/jobs.rs changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in webcodex::tool_runtime::jobs::validation_job_result_with_policy at line 620. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/tool_runtime/jobs.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/collect_release_bundle.py scripts/collect_release_bundle.py:587 — scripts/collect_release_bundle.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 145 in collect_release_bundle.verify_bundle_directory at line 587. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- scripts/collect_release_bundle.py`: 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: crates/webcodex-runner-registry/src/polling.rs crates/webcodex-runner-registry/src/polling.rs:63 — crates/webcodex-runner-registry/src/polling.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in RunnerRegistry::poll_checked at line 63. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner-registry/src/polling.rs`: 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: apps/desktop/src/features/settings/SettingsPanel.tsx apps/desktop/src/features/settings/SettingsPanel.tsx:57 — apps/desktop/src/features/settings/SettingsPanel.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in SettingsPanel.SettingsView at line 57. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- apps/desktop/src/features/settings/SettingsPanel.tsx`: 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: crates/webcodex-core/src/runner_protocol/job.rs crates/webcodex-core/src/runner_protocol/job.rs:941 — crates/webcodex-core/src/runner_protocol/job.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ShellJobValidationMetadata::is_valid at line 941. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-core/src/runner_protocol/job.rs`: 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: crates/webcodex-runner-registry/src/reconciliation.rs crates/webcodex-runner-registry/src/reconciliation.rs:141 — crates/webcodex-runner-registry/src/reconciliation.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in webcodex_runner_registry::reconciliation::validate_snapshot at line 141. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner-registry/src/reconciliation.rs`: 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: src/model_surface.rs src/model_surface.rs:299 — src/model_surface.rs changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in webcodex::model_surface::project_suggested_tool_calls_in_value_node at line 299. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- src/model_surface.rs`: 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: crates/webcodex-runner-registry/src/runners.rs crates/webcodex-runner-registry/src/runners.rs:232 — crates/webcodex-runner-registry/src/runners.rs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in RunnerRegistry::register_session at line 232. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner-registry/src/runners.rs`: 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: crates/webcodex-workflow-session/src/store.rs crates/webcodex-workflow-session/src/store.rs:561 — crates/webcodex-workflow-session/src/store.rs changed 57 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in SessionStore::ensure_coding_session_with_git_baseline at line 561. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-workflow-session/src/store.rs`: 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.
  • + 221 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×212
  • FunctionTooLong: webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:951 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool runs 658 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 558 over it, 6.58× 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: webcodex_cli::environment::run_inner crates/webcodex-cli/src/environment.rs:314 — FunctionTooLong — webcodex_cli::environment::run_inner runs 576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 476 over it, 5.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: webcodex::mcp::mcp_post src/mcp.rs:585 — FunctionTooLong — webcodex::mcp::mcp_post runs 558 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 458 over it, 5.58× 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: webcodex_runner::webcodex_runner::projects::managed_worktree::handle_prepare_managed_worktree_operation crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:575 — FunctionTooLong — webcodex_runner::webcodex_runner::projects::managed_worktree::handle_prepare_managed_worktree_operation runs 516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 416 over it, 5.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: webcodex_tool_contracts::registry::output_schemas::sessions::output_schema_for_tool crates/webcodex-tool-contracts/src/registry/output_schemas/sessions.rs:188 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::sessions::output_schema_for_tool runs 442 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 342 over it, 4.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: webcodex::run_server_with_shutdown src/lib.rs:259 — FunctionTooLong — webcodex::run_server_with_shutdown runs 431 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 331 over it, 4.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: webcodex_runner::webcodex_runner::patches::handle_apply_text_edits_file_request crates/webcodex-runner/src/webcodex_runner/patches.rs:1887 — FunctionTooLong — webcodex_runner::webcodex_runner::patches::handle_apply_text_edits_file_request runs 385 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 285 over it, 3.85× 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: webcodex_runner::webcodex_runner::fake_mcp_gateway::main crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:11 — FunctionTooLong — webcodex_runner::webcodex_runner::fake_mcp_gateway::main runs 378 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 278 over it, 3.78× 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: webcodex_core::runner_operation::decode_operation crates/webcodex-core/src/runner_operation.rs:1351 — FunctionTooLong — webcodex_core::runner_operation::decode_operation runs 370 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 270 over it, 3.70× 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: webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome crates/webcodex-runner/src/webcodex_runner/dispatch.rs:332 — FunctionTooLong — webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome runs 369 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× 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: webcodex_tool_contracts::registry::output_schemas::discovery::output_schema_for_tool crates/webcodex-tool-contracts/src/registry/output_schemas/discovery.rs:20 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::discovery::output_schema_for_tool runs 369 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× 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: webcodex_tool_contracts::registry::output_schemas::testing::cargo_output_schema crates/webcodex-tool-contracts/src/registry/output_schemas/testing.rs:15 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::testing::cargo_output_schema runs 353 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 253 over it, 3.53× 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: webcodex_tool_contracts::registry::output_schemas::git::output_schema_for_tool crates/webcodex-tool-contracts/src/registry/output_schemas/git.rs:182 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::git::output_schema_for_tool runs 335 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 235 over it, 3.35× 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: webcodex_tool_contracts::registry::output_schemas::jobs::observe_jobs_output_schema crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:542 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::jobs::observe_jobs_output_schema runs 328 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 228 over it, 3.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: webcodex_cli::webcodex_cli::connect::oauth::run_oauth_connect crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:521 — FunctionTooLong — webcodex_cli::webcodex_cli::connect::oauth::run_oauth_connect runs 301 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 201 over it, 3.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: webcodex_tool_contracts::registry::output_schemas::computer::raw_output_schema_for_tool crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:183 — FunctionTooLong — webcodex_tool_contracts::registry::output_schemas::computer::raw_output_schema_for_tool runs 301 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 201 over it, 3.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: webcodex_workspace::project_overview::validate_project_overview crates/webcodex-workspace/src/project_overview.rs:832 — FunctionTooLong — webcodex_workspace::project_overview::validate_project_overview runs 300 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× 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: webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_operation crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:718 — FunctionTooLong — webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_operation runs 298 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 198 over it, 2.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: webcodex_runner::webcodex_runner::transport::polling::run_polling_session crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:183 — FunctionTooLong — webcodex_runner::webcodex_runner::transport::polling::run_polling_session runs 296 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× 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: webcodex::tool_runtime::git::diff_hunks::git_diff_hunks_page_command_for_source src/tool_runtime/git/diff_hunks.rs:1026 — FunctionTooLong — webcodex::tool_runtime::git::diff_hunks::git_diff_hunks_page_command_for_source runs 285 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× 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: webcodex_runner::webcodex_runner::fake_plugin::main crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:13 — FunctionTooLong — webcodex_runner::webcodex_runner::fake_plugin::main runs 284 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× 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: webcodex_runner::webcodex_runner::patches::edit_plan crates/webcodex-runner/src/webcodex_runner/patches.rs:498 — FunctionTooLong — webcodex_runner::webcodex_runner::patches::edit_plan runs 278 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× 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: webcodex_cli::run crates/webcodex-cli/src/lib.rs:2749 — FunctionTooLong — webcodex_cli::run runs 271 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 171 over it, 2.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: webcodex_runner::webcodex_runner::plugin::prepare_provider crates/webcodex-runner/src/webcodex_runner/plugin.rs:1232 — FunctionTooLong — webcodex_runner::webcodex_runner::plugin::prepare_provider runs 268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× 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: webcodex_lsp::fake_server::run crates/webcodex-lsp/src/fake_server.rs:21 — FunctionTooLong — webcodex_lsp::fake_server::run runs 254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× 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.
  • + 187 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×210
  • MethodTooLong: ToolCall.session_log_arguments crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:151 — MethodTooLong — session_log_arguments runs 1679 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1579 over it, 16.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.
  • MethodTooLong: ToolRuntime.dispatch_browser_tool src/tool_runtime/browser_tools.rs:211 — MethodTooLong — dispatch_browser_tool runs 511 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 411 over it, 5.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: ToolRuntime.git_diff_page_for_source src/tool_runtime/git/diff_hunks.rs:1870 — MethodTooLong — git_diff_page_for_source runs 475 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 375 over it, 4.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ToolRuntime.dispatch_computer_request_for_instance src/tool_runtime/computer_tools/request.rs:61 — MethodTooLong — dispatch_computer_request_for_instance runs 458 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 358 over it, 4.58× 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: CodingAgentManager.run_turn crates/webcodex-runner/src/webcodex_runner/coding_agent/run.rs:98 — MethodTooLong — run_turn runs 442 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 342 over it, 4.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ToolRuntime.transfer_resolved_project_artifact src/tool_runtime/artifact_transfer.rs:489 — MethodTooLong — transfer_resolved_project_artifact runs 426 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 326 over it, 4.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: ToolRuntime.govern_dispatch src/tool_runtime/dispatch/governance.rs:20 — MethodTooLong — govern_dispatch runs 414 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 314 over it, 4.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DesktopCore.configure_local_setup apps/desktop/src-tauri/src/state/desktop_core.rs:534 — MethodTooLong — configure_local_setup runs 381 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 281 over it, 3.81× 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: ToolRuntime.finish_coding_task src/tool_runtime/coding_task/closeout.rs:16 — MethodTooLong — finish_coding_task runs 365 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× 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: ToolRuntime.start_coding_workflow src/tool_runtime/coding_task/startup.rs:53 — MethodTooLong — start_coding_workflow runs 350 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: JobManager.start_prepared_shell_job crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:69 — MethodTooLong — start_prepared_shell_job runs 342 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 242 over it, 3.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AuthorizedDispatch.execute src/tool_runtime/dispatch/routing.rs:6 — MethodTooLong — execute runs 341 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 241 over it, 3.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Database.post_conversation_message crates/webcodex-store/src/communication.rs:2024 — MethodTooLong — post_conversation_message runs 337 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 237 over it, 3.37× 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: Database.init_tables REDACTED:140 — MethodTooLong — init_tables runs 337 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 237 over it, 3.37× 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: ToolRuntime.session_handoff_observation src/tool_runtime/handoff.rs:167 — MethodTooLong — session_handoff_observation runs 337 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 237 over it, 3.37× 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: ToolRuntime.dispatch_browser_request src/tool_runtime/browser_tools.rs:880 — MethodTooLong — dispatch_browser_request runs 329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× 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: ToolRuntime.dispatch_file_tool src/tool_runtime/file_tools.rs:8 — MethodTooLong — dispatch_file_tool runs 317 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 217 over it, 3.17× 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: RunnerRegistry.poll_checked crates/webcodex-runner-registry/src/polling.rs:63 — MethodTooLong — poll_checked runs 314 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 214 over it, 3.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RunnerRegistry.register_session crates/webcodex-runner-registry/src/runners.rs:232 — MethodTooLong — register_session runs 306 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 206 over it, 3.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Database.read_goal_stall_continuity crates/webcodex-store/src/goal_stall.rs:160 — MethodTooLong — read_goal_stall_continuity runs 299 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 199 over it, 2.99× 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: ToolRuntime.apply_text_edits src/tool_runtime/files/mutations/text_edits.rs:426 — MethodTooLong — apply_text_edits runs 297 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 197 over it, 2.97× 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: ToolRuntime.run_shell_with_contract_for_resource src/tool_runtime/shell.rs:357 — MethodTooLong — run_shell_with_contract_for_resource runs 285 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× 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: ToolRuntime.review_changes src/tool_runtime/review_changes.rs:161 — MethodTooLong — review_changes runs 271 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 171 over it, 2.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.
  • MethodTooLong: ToolRuntime.run_process_with_contract_mode src/tool_runtime/process.rs:798 — MethodTooLong — run_process_with_contract_mode runs 270 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 170 over it, 2.70× 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: ToolRuntime.git_review_summary_for_scope src/tool_runtime/git_review.rs:908 — MethodTooLong — git_review_summary_for_scope runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× 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.
  • + 185 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×202
  • FileTooLong: src/cdp.rs crates/webcodex-browser/src/cdp.rs — FileTooLong — 2961 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 2461 over it, 5.92× 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: src/store.rs crates/webcodex-workflow-session/src/store.rs — FileTooLong — 2767 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2267 over it, 5.53× 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: src/communication.rs crates/webcodex-store/src/communication.rs — FileTooLong — 2680 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: Database (397-2623). The bar is 500 significant lines; this is 2180 over it, 5.36× 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: src/requests.rs crates/webcodex-runner-registry/src/requests.rs — FileTooLong — 2458 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: RunnerRegistry (568-3182). The bar is 500 significant lines; this is 1958 over it, 4.92× 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: src/agent_wake.rs crates/webcodex-store/src/agent_wake.rs — FileTooLong — 2404 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1904 over it, 4.81× 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: src/upgrade.rs crates/webcodex-environment/src/upgrade.rs — FileTooLong — 2403 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1903 over it, 4.81× 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: src/lib.rs crates/webcodex-cli/src/lib.rs — FileTooLong — 2314 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 1814 over it, 4.63× 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: tool_runtime/skills.rs src/tool_runtime/skills.rs — FileTooLong — 2200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: ToolRuntime (284-2248). The bar is 500 significant lines; this is 1700 over it, 4.40× 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: tool_call/canonical_enum.rs crates/webcodex-tool-contracts/src/tool_call/canonical_enum.rs — FileTooLong — 2174 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 100% of them inside a single declaration: ToolCall (8-4108). The bar is 500 significant lines; this is 1674 over it, 4.35× 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: src/runtime_console_http.rs src/runtime_console_http.rs — FileTooLong — 1987 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 1487 over it, 3.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: git/show_changes.rs src/tool_runtime/git/show_changes.rs — FileTooLong — 1987 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 1487 over it, 3.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/runner_operation.rs crates/webcodex-core/src/runner_operation.rs — FileTooLong — 1960 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 1460 over it, 3.92× 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: git/diff_hunks.rs src/tool_runtime/git/diff_hunks.rs — FileTooLong — 1922 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 46 free functions. The bar is 500 significant lines; this is 1422 over it, 3.84× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/job_updates.rs crates/webcodex-runner-registry/src/job_updates.rs — FileTooLong — 1858 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 72% of them inside a single declaration: RunnerRegistry (712-2491). The bar is 500 significant lines; this is 1358 over it, 3.72× 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: src/native.rs crates/webcodex-environment/src/native.rs — FileTooLong — 1840 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 68% of them inside a single declaration: NativeEnvironment (3 blocks, 22-1712). The bar is 500 significant lines; this is 1340 over it, 3.68× 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: src/lib.rs crates/webcodex-computer/src/lib.rs — FileTooLong — 1822 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1322 over it, 3.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tool_runtime/coding_agent.rs src/tool_runtime/coding_agent.rs — FileTooLong — 1816 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 1316 over it, 3.63× 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: src/supervisor.rs crates/webcodex-lsp/src/supervisor.rs — FileTooLong — 1815 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1315 over it, 3.63× 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: webcodex_runner/patches.rs crates/webcodex-runner/src/webcodex_runner/patches.rs — FileTooLong — 1811 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 1311 over it, 3.62× 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: src/tool_audit.rs crates/webcodex-tool-runtime-contracts/src/tool_audit.rs — FileTooLong — 1757 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: ToolCall (150-2024). The bar is 500 significant lines; this is 1257 over it, 3.51× 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: webcodex_cli/controller.rs crates/webcodex-cli/src/webcodex_cli/controller.rs — FileTooLong — 1754 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 47 free functions. The bar is 500 significant lines; this is 1254 over it, 3.51× 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: src/navigation.rs crates/webcodex-lsp/src/navigation.rs — FileTooLong — 1681 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 53 free functions. The bar is 500 significant lines; this is 1181 over it, 3.36× 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: webcodex_runner/skill_store.rs crates/webcodex-runner/src/webcodex_runner/skill_store.rs — FileTooLong — 1651 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: SkillStore (152-1587). The bar is 500 significant lines; this is 1151 over it, 3.30× 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: tool_runtime/jobs.rs src/tool_runtime/jobs.rs — FileTooLong — 1623 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 35 free functions. The bar is 500 significant lines; this is 1123 over it, 3.25× 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_task/operations.rs crates/webcodex-store/src/agent_task/operations.rs — FileTooLong — 1604 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 100% of them inside a single declaration: Database (1-2089). The bar is 500 significant lines; this is 1104 over it, 3.21× 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.
  • + 177 more in this group — see findings.md.
D2 · Cognitive Complexity · webcodex · ×149
  • webcodex::mcp::mcp_post (cognitive 87) src/mcp.rs:585 — webcodex::mcp::mcp_post has cognitive complexity 87 (threshold 15). Drivers by points: if/else 45 (64 pts), match/switch 10 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::startup_brief::enforce_hard_size_limit (cognitive 87) src/tool_runtime/startup_brief.rs:1084 — webcodex::tool_runtime::startup_brief::enforce_hard_size_limit has cognitive complexity 87 (threshold 15). Drivers by points: if/else 29 (72 pts), loops 10 (15 pts) (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.
  • webcodex::tool_runtime::files::mutations::text_edits_result::validate_apply_text_edits_success_metadata (cognitive 86) src/tool_runtime/files/mutations/text_edits_result.rs:49 — webcodex::tool_runtime::files::mutations::text_edits_result::validate_apply_text_edits_success_metadata has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (62 pts), boolean chains 17, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::git::show_changes::parse_show_changes_output_with_observation (cognitive 78) src/tool_runtime/git/show_changes.rs:1318 — webcodex::tool_runtime::git::show_changes::parse_show_changes_output_with_observation has cognitive complexity 78 (threshold 15). Drivers by points: if/else 41 (59 pts), boolean chains 9, match/switch 4 (7 pts), loops 2 (3 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.
  • webcodex::tool_runtime::validation_success_projection::sparsify_structured_validation_success_evidence (cognitive 72) src/tool_runtime/validation_success_projection.rs:12 — webcodex::tool_runtime::validation_success_projection::sparsify_structured_validation_success_evidence has cognitive complexity 72 (threshold 15). Drivers by points: if/else 31 (46 pts), boolean chains 23, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::project_entry_share::share (cognitive 63) src/project_entry_share.rs:753 — webcodex::project_entry_share::share has cognitive complexity 63 (threshold 15). Drivers by points: if/else 28 (37 pts), match/switch 14 (23 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webcodex::mcp::cli::text::compact::jobs (cognitive 56) src/mcp/cli/text/compact.rs:383 — webcodex::mcp::cli::text::compact::jobs has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (47 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 30). 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.
  • webcodex::oauth_http::shared_key_bridge::oauth_shared_key_client_provision (cognitive 56) src/oauth_http/shared_key_bridge.rs:707 — webcodex::oauth_http::shared_key_bridge::oauth_shared_key_client_provision has cognitive complexity 56 (threshold 15). Drivers by points: if/else 30 (36 pts), boolean chains 14, match/switch 3 (6 pts) (nesting depth added 9). 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.
  • webcodex::mcp::tools::mcp_tools_list_payload_with_exposure (cognitive 55) src/mcp/tools.rs:332 — webcodex::mcp::tools::mcp_tools_list_payload_with_exposure has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 4 (9 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 29). 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.
  • webcodex::model_surface::project_suggested_tool_calls_in_value_node (cognitive 53) src/model_surface.rs:299 — webcodex::model_surface::project_suggested_tool_calls_in_value_node has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 7 (13 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::surface::sparsify_tool_manifest_model_result (cognitive 52) src/tool_runtime/surface.rs:1153 — webcodex::tool_runtime::surface::sparsify_tool_manifest_model_result has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 5 (10 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::git::diff_hunks::parse_git_diff_hunks (cognitive 50) src/tool_runtime/git/diff_hunks.rs:1626 — webcodex::tool_runtime::git::diff_hunks::parse_git_diff_hunks has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (48 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • webcodex::mcp::tools::call::specialized::ssh_resource (cognitive 49) src/mcp/tools/call/specialized.rs:203 — webcodex::mcp::tools::call::specialized::ssh_resource has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (45 pts), match/switch 4 (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.
  • webcodex::runtime_console_http::goals::goal_detail_for_auth (cognitive 46) src/runtime_console_http/goals.rs:235 — webcodex::runtime_console_http::goals::goal_detail_for_auth has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 5 (8 pts), match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::closeout_facts::evaluate_closeout (cognitive 46) src/tool_runtime/closeout_facts.rs:155 — webcodex::tool_runtime::closeout_facts::evaluate_closeout has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31 (35 pts), boolean chains 5, match/switch 4 (5 pts), loops 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, 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.
  • webcodex::tool_runtime::files::mutations::text_edits_result::sanitize_apply_text_edits_model_recovery (cognitive 46) src/tool_runtime/files/mutations/text_edits_result.rs:259 — webcodex::tool_runtime::files::mutations::text_edits_result::sanitize_apply_text_edits_model_recovery has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 4, loops 1 (2 pts), match/switch 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::window_activity_projection::project_window_loop_timings (cognitive 45) src/tool_runtime/window_activity_projection.rs:138 — webcodex::tool_runtime::window_activity_projection::project_window_loop_timings has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (43 pts), boolean chains 1, loops 1 (nesting depth added 30). 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.
  • webcodex::mcp::cli::text::native::workspace (cognitive 44) src/mcp/cli/text/native.rs:331 — webcodex::mcp::cli::text::native::workspace has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 5, loops 4 (5 pts), match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::model_surface::project_suggested_tool_call_schema_node (cognitive 43) src/model_surface.rs:163 — webcodex::model_surface::project_suggested_tool_call_schema_node has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 6 (10 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::observe_jobs::sparse_success_item (cognitive 43) src/tool_runtime/observe_jobs.rs:735 — webcodex::tool_runtime::observe_jobs::sparse_success_item has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (23 pts), loops 6 (10 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::mcp::presentation::git::show_changes_presentation (cognitive 42) src/mcp/presentation/git.rs:208 — webcodex::mcp::presentation::git::show_changes_presentation has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 6 (11 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::tool_runtime::files::mutations::patch_result::validate_apply_patch_success_metadata (cognitive 42) src/tool_runtime/files/mutations/patch_result.rs:824 — webcodex::tool_runtime::files::mutations::patch_result::validate_apply_patch_success_metadata has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 6, match/switch 3 (6 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex::mcp::cli::text::project_response (cognitive 40) src/mcp/cli/text.rs:11 — webcodex::mcp::cli::text::project_response has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 20). 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.
  • webcodex::mcp::cli::text::native::execution (cognitive 39) src/mcp/cli/text/native.rs:129 — webcodex::mcp::cli::text::native::execution has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 7, 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.
  • webcodex::mcp::tools::add_stateless_workflow_recorder_metadata (cognitive 39) src/mcp/tools.rs:876 — webcodex::mcp::tools::add_stateless_workflow_recorder_metadata has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (10 pts), boolean chains 4 (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.
  • + 124 more in this group — see findings.md.
D2 · Cognitive Complexity · webcodex_runner · ×93
  • webcodex_runner::webcodex_runner::fake_plugin::main (cognitive 146) crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:13 — webcodex_runner::webcodex_runner::fake_plugin::main has cognitive complexity 146 (threshold 15). Drivers by points: if/else 49 (112 pts), loops 6 (17 pts), match/switch 4 (11 pts), boolean chains 6 (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::fake_mcp_gateway::main (cognitive 143) crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:11 — webcodex_runner::webcodex_runner::fake_mcp_gateway::main has cognitive complexity 143 (threshold 15). Drivers by points: if/else 47 (103 pts), loops 5 (17 pts), boolean chains 12, match/switch 4 (11 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.
  • webcodex_runner::webcodex_runner::transport::polling::run_polling_session (cognitive 115) crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:183 — webcodex_runner::webcodex_runner::transport::polling::run_polling_session has cognitive complexity 115 (threshold 15). Drivers by points: if/else 26 (82 pts), match/switch 9 (27 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::patches::handle_apply_text_edits_file_request (cognitive 112) crates/webcodex-runner/src/webcodex_runner/patches.rs:1887 — webcodex_runner::webcodex_runner::patches::handle_apply_text_edits_file_request has cognitive complexity 112 (threshold 15). Drivers by points: if/else 21 (65 pts), match/switch 12 (35 pts), boolean chains 11, loops 1 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_operation (cognitive 86) crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:718 — webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_operation has cognitive complexity 86 (threshold 15). Drivers by points: if/else 39 (56 pts), match/switch 16 (25 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::projects::managed_worktree::handle_prepare_managed_worktree_operation (cognitive 86) crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:575 — webcodex_runner::webcodex_runner::projects::managed_worktree::handle_prepare_managed_worktree_operation has cognitive complexity 86 (threshold 15). Drivers by points: match/switch 26 (37 pts), if/else 27 (35 pts), boolean chains 12, loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::patches::edit_plan (cognitive 79) crates/webcodex-runner/src/webcodex_runner/patches.rs:498 — webcodex_runner::webcodex_runner::patches::edit_plan has cognitive complexity 79 (threshold 15). Drivers by points: if/else 24 (54 pts), loops 6 (11 pts), boolean chains 7, match/switch 4 (7 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::shell::execution::execute_configured_command_impl (cognitive 67) crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:103 — webcodex_runner::webcodex_runner::shell::execution::execute_configured_command_impl has cognitive complexity 67 (threshold 15). Drivers by points: if/else 23 (44 pts), match/switch 10 (15 pts), boolean chains 7, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::transport::stream::serve_registered_stream (cognitive 60) crates/webcodex-runner/src/webcodex_runner/transport/stream.rs:229 — webcodex_runner::webcodex_runner::transport::stream::serve_registered_stream has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (39 pts), match/switch 9 (18 pts), boolean chains 2, loops 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.
  • webcodex_runner::webcodex_runner::validation::execute::run_bounded (cognitive 60) crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:33 — webcodex_runner::webcodex_runner::validation::execute::run_bounded has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 4 (10 pts), match/switch 5 (10 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::patches::execute_planned_file_changes (cognitive 57) crates/webcodex-runner/src/webcodex_runner/patches.rs:1321 — webcodex_runner::webcodex_runner::patches::execute_planned_file_changes has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (41 pts), loops 5 (13 pts), match/switch 1 (3 pts) (nesting depth added 38). 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.
  • webcodex_runner::webcodex_runner::detached_job::platform::unix::run_accepted_payload (cognitive 54) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:265 — webcodex_runner::webcodex_runner::detached_job::platform::unix::run_accepted_payload has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (38 pts), match/switch 3 (7 pts), boolean chains 6, loops 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::project_format::format_candidates_with_deadline (cognitive 52) crates/webcodex-runner/src/webcodex_runner/project_format.rs:415 — webcodex_runner::webcodex_runner::project_format::format_candidates_with_deadline has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (38 pts), match/switch 4 (7 pts), boolean chains 6, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::job_manager::admission::validate_runner_job_context_operation (cognitive 51) crates/webcodex-runner/src/webcodex_runner/job_manager/admission.rs:6 — webcodex_runner::webcodex_runner::job_manager::admission::validate_runner_job_context_operation has cognitive complexity 51 (threshold 15). Drivers by points: if/else 26 (38 pts), boolean chains 10, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::detached_job::platform::windows::run_accepted_payload (cognitive 50) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:288 — webcodex_runner::webcodex_runner::detached_job::platform::windows::run_accepted_payload has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (33 pts), match/switch 4 (9 pts), boolean chains 5, loops 3 (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.
  • webcodex_runner::webcodex_runner::config::validate_acp_config (cognitive 47) crates/webcodex-runner/src/webcodex_runner/config.rs:1880 — webcodex_runner::webcodex_runner::config::validate_acp_config has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 5 (8 pts), boolean chains 7 (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.
  • webcodex_runner::webcodex_runner::patches::handle_apply_patch_file_request (cognitive 47) crates/webcodex-runner/src/webcodex_runner/patches.rs:1621 — webcodex_runner::webcodex_runner::patches::handle_apply_patch_file_request has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 8 (18 pts), boolean chains 2, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime_from_file (cognitive 46) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:416 — webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime_from_file has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 8, match/switch 3 (4 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::artifacts::upload::handle_artifact_upload_begin (cognitive 46) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:669 — webcodex_runner::webcodex_runner::artifacts::upload::handle_artifact_upload_begin has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (32 pts), match/switch 9 (10 pts), boolean chains 3, 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.
  • webcodex_runner::webcodex_runner::job_manager::delivery::spawn_job_update_delivery_worker (cognitive 45) crates/webcodex-runner/src/webcodex_runner/job_manager/delivery.rs:270 — webcodex_runner::webcodex_runner::job_manager::delivery::spawn_job_update_delivery_worker has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (41 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome (cognitive 41) crates/webcodex-runner/src/webcodex_runner/dispatch.rs:332 — webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 8 (16 pts), boolean chains 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.
  • webcodex_runner::webcodex_runner::fake_claude_mcp::main (cognitive 40) crates/webcodex-runner/src/webcodex_runner/fake_claude_mcp.rs:12 — webcodex_runner::webcodex_runner::fake_claude_mcp::main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 3 (9 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::project_build::rust::artifact_paths (cognitive 39) crates/webcodex-runner/src/webcodex_runner/project_build/rust.rs:145 — webcodex_runner::webcodex_runner::project_build::rust::artifact_paths has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime (cognitive 37) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:232 — webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 6, match/switch 2 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner::webcodex_runner::mcp_gateway::provider_stdout_reader (cognitive 37) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1148 — webcodex_runner::webcodex_runner::mcp_gateway::provider_stdout_reader has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 3 (10 pts), boolean chains 1, 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.
  • + 68 more in this group — see findings.md.
D2 · Cognitive Complexity · ToolRuntime · ×88
  • ToolRuntime::enrich_workbench_execution (cognitive 100) src/tool_runtime/workbench_execution.rs:73 — ToolRuntime::enrich_workbench_execution has cognitive complexity 100 (threshold 15). Drivers by points: if/else 25 (80 pts), loops 3 (11 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 66). 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.
  • ToolRuntime::git_diff_page_for_source (cognitive 95) src/tool_runtime/git/diff_hunks.rs:1870 — ToolRuntime::git_diff_page_for_source has cognitive complexity 95 (threshold 15). Drivers by points: if/else 45 (52 pts), boolean chains 23, match/switch 14 (20 pts) (nesting depth added 13). 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.
  • ToolRuntime::read_workbench_state (cognitive 88) src/tool_runtime/workbench_state.rs:108 — ToolRuntime::read_workbench_state has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (66 pts), loops 2 (10 pts), match/switch 4 (10 pts), boolean chains 2 (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.
  • ToolRuntime::job_convergence_record (cognitive 86) src/tool_runtime/model_ergonomics_telemetry/job_convergence.rs:61 — ToolRuntime::job_convergence_record has cognitive complexity 86 (threshold 15). Drivers by points: if/else 25 (63 pts), loops 4 (11 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 46). 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.
  • ToolRuntime::govern_dispatch (cognitive 84) src/tool_runtime/dispatch/governance.rs:20 — ToolRuntime::govern_dispatch has cognitive complexity 84 (threshold 15). Drivers by points: if/else 47 (73 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::resolve_coding_startup_project (cognitive 75) src/tool_runtime/coding_task/project.rs:404 — ToolRuntime::resolve_coding_startup_project has cognitive complexity 75 (threshold 15). Drivers by points: if/else 26 (66 pts), match/switch 4 (9 pts) (nesting depth added 45). 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.
  • ToolRuntime::dispatch_computer_request_for_instance (cognitive 72) src/tool_runtime/computer_tools/request.rs:61 — ToolRuntime::dispatch_computer_request_for_instance has cognitive complexity 72 (threshold 15). Drivers by points: if/else 42 (54 pts), boolean chains 11, match/switch 6, loops 1 (nesting depth added 12). 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.
  • ToolRuntime::dispatch_browser_request (cognitive 69) src/tool_runtime/browser_tools.rs:880 — ToolRuntime::dispatch_browser_request has cognitive complexity 69 (threshold 15). Drivers by points: if/else 36 (52 pts), boolean chains 8, match/switch 6, loops 1 (3 pts) (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.
  • ToolRuntime::apply_text_edits (cognitive 68) src/tool_runtime/files/mutations/text_edits.rs:426 — ToolRuntime::apply_text_edits has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (37 pts), match/switch 8 (15 pts), loops 7 (9 pts), boolean chains 7 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::search_webcodex_resources (cognitive 64) src/tool_runtime/resource_references.rs:289 — ToolRuntime::search_webcodex_resources has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (50 pts), match/switch 4 (9 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::materialize_validation_job_candidates (cognitive 64) src/tool_runtime/validation_events.rs:359 — ToolRuntime::materialize_validation_job_candidates has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (53 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::transfer_resolved_project_artifact (cognitive 62) src/tool_runtime/artifact_transfer.rs:489 — ToolRuntime::transfer_resolved_project_artifact has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (43 pts), match/switch 7 (14 pts), boolean chains 4, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::current_window_activity (cognitive 58) src/tool_runtime/current_window_activity.rs:46 — ToolRuntime::current_window_activity has cognitive complexity 58 (threshold 15). Drivers by points: if/else 31 (48 pts), loops 4, boolean chains 3, match/switch 1 (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.
  • ToolRuntime::goal_activity_observation_at (cognitive 57) src/tool_runtime/goal.rs:780 — ToolRuntime::goal_activity_observation_at has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (40 pts), loops 5 (8 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::authorize_runner_tool (cognitive 57) src/tool_runtime/runner_authorization.rs:33 — ToolRuntime::authorize_runner_tool has cognitive complexity 57 (threshold 15). Drivers by points: if/else 26 (51 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::observe_jobs_for_auth (cognitive 55) src/tool_runtime/observe_jobs.rs:1400 — ToolRuntime::observe_jobs_for_auth has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (36 pts), match/switch 5 (8 pts), boolean chains 6, loops 3 (5 pts) (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.
  • ToolRuntime::run_shell_with_contract_for_resource (cognitive 50) src/tool_runtime/shell.rs:357 — ToolRuntime::run_shell_with_contract_for_resource has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (25 pts), match/switch 10 (15 pts), boolean chains 10 (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.
  • ToolRuntime::git_review_summary_for_scope (cognitive 49) src/tool_runtime/git_review.rs:908 — ToolRuntime::git_review_summary_for_scope has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 10, loops 5 (8 pts), match/switch 2 (3 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.
  • ToolRuntime::finish_coding_task (cognitive 48) src/tool_runtime/coding_task/closeout.rs:16 — ToolRuntime::finish_coding_task has cognitive complexity 48 (threshold 15). Drivers by points: if/else 32 (35 pts), match/switch 5 (8 pts), boolean chains 4, loops 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.
  • ToolRuntime::start_coding_workflow (cognitive 47) src/tool_runtime/coding_task/startup.rs:53 — ToolRuntime::start_coding_workflow has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (30 pts), match/switch 12 (14 pts), boolean chains 3 (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, 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.
  • ToolRuntime::dispatch_computer_control_action (cognitive 44) src/tool_runtime/computer_tools/control.rs:13 — ToolRuntime::dispatch_computer_control_action has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 9, match/switch 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ToolRuntime::session_handoff_observation (cognitive 43) src/tool_runtime/handoff.rs:167 — ToolRuntime::session_handoff_observation has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 7, match/switch 5 (6 pts), loops 1 (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, 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.
  • ToolRuntime::work_result_files (cognitive 42) src/tool_runtime/changes.rs:565 — ToolRuntime::work_result_files has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 11 (22 pts), if/else 9 (12 pts), boolean chains 8 (nesting depth added 14). 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.
  • ToolRuntime::read_webcodex_resource (cognitive 42) src/tool_runtime/resource_references.rs:502 — ToolRuntime::read_webcodex_resource has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 4, match/switch 3 (4 pts) (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.
  • ToolRuntime::call_agent_lsp (cognitive 41) src/tool_runtime/lsp_tools.rs:201 — ToolRuntime::call_agent_lsp has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 9 (15 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 63 more in this group — see findings.md.
D1 · Cyclomatic Complexity · webcodex · ×87
  • webcodex::tool_runtime::git::show_changes::parse_show_changes_output_with_observation (cyclomatic 64) src/tool_runtime/git/show_changes.rs:1318 — webcodex::tool_runtime::git::show_changes::parse_show_changes_output_with_observation has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex::mcp::mcp_post (cyclomatic 63) src/mcp.rs:585 — webcodex::mcp::mcp_post 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.
  • webcodex::tool_runtime::validation_success_projection::sparsify_structured_validation_success_evidence (cyclomatic 60) src/tool_runtime/validation_success_projection.rs:12 — webcodex::tool_runtime::validation_success_projection::sparsify_structured_validation_success_evidence has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex::oauth_http::shared_key_bridge::oauth_shared_key_client_provision (cyclomatic 49) src/oauth_http/shared_key_bridge.rs:707 — webcodex::oauth_http::shared_key_bridge::oauth_shared_key_client_provision has cyclomatic complexity 49 (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.
  • webcodex::tool_runtime::files::mutations::text_edits_result::validate_apply_text_edits_success_metadata (cyclomatic 48) src/tool_runtime/files/mutations/text_edits_result.rs:49 — webcodex::tool_runtime::files::mutations::text_edits_result::validate_apply_text_edits_success_metadata 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.
  • webcodex::tool_runtime::closeout_facts::evaluate_closeout (cyclomatic 47) src/tool_runtime/closeout_facts.rs:155 — webcodex::tool_runtime::closeout_facts::evaluate_closeout has cyclomatic complexity 47 (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.
  • webcodex::mcp::discovery::compact_tool (cyclomatic 46) src/mcp/discovery.rs:29 — webcodex::mcp::discovery::compact_tool has cyclomatic complexity 46 (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.
  • webcodex::project_entry_share::share (cyclomatic 43) src/project_entry_share.rs:753 — webcodex::project_entry_share::share has cyclomatic complexity 43 (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.
  • webcodex::tool_runtime::startup_brief::enforce_hard_size_limit (cyclomatic 40) src/tool_runtime/startup_brief.rs:1084 — webcodex::tool_runtime::startup_brief::enforce_hard_size_limit 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.
  • webcodex::project_entry_share::parse_share_options (cyclomatic 38) src/project_entry_share.rs:67 — webcodex::project_entry_share::parse_share_options has cyclomatic complexity 38 (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.
  • webcodex::tool_runtime::files::mutations::text_edits_result::sanitize_apply_text_edits_model_recovery (cyclomatic 36) src/tool_runtime/files/mutations/text_edits_result.rs:259 — webcodex::tool_runtime::files::mutations::text_edits_result::sanitize_apply_text_edits_model_recovery 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.
  • webcodex::tool_runtime::files::mutations::patch_result::validated_apply_patch_match_rejection (cyclomatic 35) src/tool_runtime/files/mutations/patch_result.rs:139 — webcodex::tool_runtime::files::mutations::patch_result::validated_apply_patch_match_rejection 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.
  • webcodex::tool_runtime::observe_jobs::sparse_success_item (cyclomatic 35) src/tool_runtime/observe_jobs.rs:735 — webcodex::tool_runtime::observe_jobs::sparse_success_item 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.
  • webcodex::tool_runtime::coding_task::projection::project_work_on_project_output_inner (cyclomatic 34) src/tool_runtime/coding_task/projection.rs:318 — webcodex::tool_runtime::coding_task::projection::project_work_on_project_output_inner has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex::mcp::cli::text::native::workspace (cyclomatic 32) src/mcp/cli/text/native.rs:331 — webcodex::mcp::cli::text::native::workspace 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.
  • webcodex::mcp::handle_mcp_request_for_surface (cyclomatic 30) src/mcp.rs:1396 — webcodex::mcp::handle_mcp_request_for_surface 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.
  • webcodex::mcp::cli::text::project_response (cyclomatic 30) src/mcp/cli/text.rs:11 — webcodex::mcp::cli::text::project_response 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.
  • webcodex::tool_runtime::git::show_changes::set_show_changes_verdict (cyclomatic 30) src/tool_runtime/git/show_changes.rs:2127 — webcodex::tool_runtime::git::show_changes::set_show_changes_verdict 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.
  • webcodex::mcp::cli::text::native::execution (cyclomatic 29) src/mcp/cli/text/native.rs:129 — webcodex::mcp::cli::text::native::execution 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.
  • webcodex::tool_runtime::acceptance_evidence::acceptance_evidence (cyclomatic 29) src/tool_runtime/acceptance_evidence.rs:17 — webcodex::tool_runtime::acceptance_evidence::acceptance_evidence has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex::tool_runtime::jobs::validation_job_result_with_policy (cyclomatic 29) src/tool_runtime/jobs.rs:620 — webcodex::tool_runtime::jobs::validation_job_result_with_policy 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.
  • webcodex::model_surface::project_suggested_tool_calls_in_value_node (cyclomatic 28) src/model_surface.rs:299 — webcodex::model_surface::project_suggested_tool_calls_in_value_node 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.
  • webcodex::tool_runtime::computer_tools::snapshot_receipts::validate_snapshot (cyclomatic 28) src/tool_runtime/computer_tools/snapshot_receipts.rs:206 — webcodex::tool_runtime::computer_tools::snapshot_receipts::validate_snapshot has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex::tool_runtime::files::mutations::patch_result::validate_apply_patch_success_metadata (cyclomatic 28) src/tool_runtime/files/mutations/patch_result.rs:824 — webcodex::tool_runtime::files::mutations::patch_result::validate_apply_patch_success_metadata 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.
  • webcodex::tool_runtime::goal::goal_continuity_observation (cyclomatic 28) src/tool_runtime/goal.rs:255 — webcodex::tool_runtime::goal::goal_continuity_observation has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • + 62 more in this group — see findings.md.
D1 · Cyclomatic Complexity · ToolRuntime · ×78
  • ToolRuntime::dispatch_computer_request_for_instance (cyclomatic 92) src/tool_runtime/computer_tools/request.rs:61 — ToolRuntime::dispatch_computer_request_for_instance has cyclomatic complexity 92 (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.
  • ToolRuntime::git_diff_page_for_source (cyclomatic 75) src/tool_runtime/git/diff_hunks.rs:1870 — ToolRuntime::git_diff_page_for_source has cyclomatic complexity 75 (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.
  • ToolRuntime::dispatch_browser_request (cyclomatic 55) src/tool_runtime/browser_tools.rs:880 — ToolRuntime::dispatch_browser_request has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ToolRuntime::govern_dispatch (cyclomatic 49) src/tool_runtime/dispatch/governance.rs:20 — ToolRuntime::govern_dispatch 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.
  • ToolRuntime::apply_text_edits (cyclomatic 49) src/tool_runtime/files/mutations/text_edits.rs:426 — ToolRuntime::apply_text_edits 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.
  • ToolRuntime::dispatch_browser_tool (cyclomatic 46) src/tool_runtime/browser_tools.rs:211 — ToolRuntime::dispatch_browser_tool has cyclomatic complexity 46 (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.
  • ToolRuntime::dispatch_file_tool (cyclomatic 43) src/tool_runtime/file_tools.rs:8 — ToolRuntime::dispatch_file_tool has cyclomatic complexity 43 (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.
  • ToolRuntime::current_window_activity (cyclomatic 41) src/tool_runtime/current_window_activity.rs:46 — ToolRuntime::current_window_activity 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.
  • ToolRuntime::job_convergence_record (cyclomatic 40) src/tool_runtime/model_ergonomics_telemetry/job_convergence.rs:61 — ToolRuntime::job_convergence_record 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.
  • ToolRuntime::dispatch_computer_control_action (cyclomatic 39) src/tool_runtime/computer_tools/control.rs:13 — ToolRuntime::dispatch_computer_control_action has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ToolRuntime::observe_jobs_for_auth (cyclomatic 38) src/tool_runtime/observe_jobs.rs:1400 — ToolRuntime::observe_jobs_for_auth has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ToolRuntime::git_review_summary_for_scope (cyclomatic 37) src/tool_runtime/git_review.rs:908 — ToolRuntime::git_review_summary_for_scope 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.
  • ToolRuntime::run_shell_with_contract_for_resource (cyclomatic 37) src/tool_runtime/shell.rs:357 — ToolRuntime::run_shell_with_contract_for_resource has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ToolRuntime::transfer_resolved_project_artifact (cyclomatic 36) src/tool_runtime/artifact_transfer.rs:489 — ToolRuntime::transfer_resolved_project_artifact 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.
  • ToolRuntime::start_coding_workflow (cyclomatic 36) src/tool_runtime/coding_task/startup.rs:53 — ToolRuntime::start_coding_workflow has cyclomatic complexity 36 (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.
  • ToolRuntime::finish_coding_task (cyclomatic 35) src/tool_runtime/coding_task/closeout.rs:16 — ToolRuntime::finish_coding_task 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.
  • ToolRuntime::enrich_workbench_execution (cyclomatic 35) src/tool_runtime/workbench_execution.rs:73 — ToolRuntime::enrich_workbench_execution 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.
  • ToolRuntime::session_handoff_observation (cyclomatic 34) src/tool_runtime/handoff.rs:167 — ToolRuntime::session_handoff_observation has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ToolRuntime::submit_workbench_work (cyclomatic 34) src/tool_runtime/workbench_execution.rs:242 — ToolRuntime::submit_workbench_work has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ToolRuntime::goal_activity_observation_at (cyclomatic 33) src/tool_runtime/goal.rs:780 — ToolRuntime::goal_activity_observation_at 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.
  • ToolRuntime::search_webcodex_resources (cyclomatic 31) src/tool_runtime/resource_references.rs:289 — ToolRuntime::search_webcodex_resources 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.
  • ToolRuntime::dispatch_computer_observation (cyclomatic 30) src/tool_runtime/computer_tools/observe.rs:8 — ToolRuntime::dispatch_computer_observation 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.
  • ToolRuntime::goal_plan_recheck_attention_with_clock (cyclomatic 30) src/tool_runtime/goal.rs:1098 — ToolRuntime::goal_plan_recheck_attention_with_clock 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.
  • ToolRuntime::resolve_coding_startup_project (cyclomatic 29) src/tool_runtime/coding_task/project.rs:404 — ToolRuntime::resolve_coding_startup_project 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.
  • ToolRuntime::read_project_artifact (cyclomatic 29) src/tool_runtime/files/artifacts.rs:662 — ToolRuntime::read_project_artifact 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.
  • + 53 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×73
  • Duplicated block (9 lines × 2) apps/desktop/src-tauri/src/diagnostics.rs:568 — apps/desktop/src-tauri/src/diagnostics.rs:568-576 | apps/desktop/src-tauri/src/diagnostics.rs:582-590 — both copies are in the same file, so extract the 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) apps/desktop/src-tauri/src/updates/install/native.rs:121 — apps/desktop/src-tauri/src/updates/install/native.rs:121-129 | crates/webcodex-cli/src/environment/update/launcher.rs:137-145 — 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 `apps/desktop/src-tauri/src/updates/install/native.rs:121` 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) crates/webcodex-browser/src/cdp.rs:3677 — crates/webcodex-browser/src/cdp.rs:3677-3685 | crates/webcodex-browser/src/cdp.rs:3699-3707 — both copies are in the same file, so extract the 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 `crates/webcodex-browser/src/cdp.rs:3677` 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) crates/webcodex-browser/src/profiles.rs:52 — crates/webcodex-browser/src/profiles.rs:52-60 | crates/webcodex-environment/src/storage.rs:164-172 — 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 `crates/webcodex-browser/src/profiles.rs: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 before the matched lines, `crates/webcodex-environment/src/storage.rs:162` calls `pub`, `ensure_private_directory`, `validate_directory_ancestors` and `crates/webcodex-browser/src/profiles.rs:51` 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) crates/webcodex-cli/src/lib.rs:501 — crates/webcodex-cli/src/lib.rs:501-509 | crates/webcodex-cli/src/lib.rs:720-728 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/lib.rs:501` 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) crates/webcodex-cli/src/lib.rs:3139 — crates/webcodex-cli/src/lib.rs:3139-3147 | crates/webcodex-cli/src/lib.rs:3156-3164 — both copies are in the same file, so extract the 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 first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&[String]` in one and `Vec<String>` 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 (9 lines × 2) crates/webcodex-cli/src/webcodex_cli/runner_service.rs:43 — crates/webcodex-cli/src/webcodex_cli/runner_service.rs:43-51 | crates/webcodex-cli/src/webcodex_cli/server.rs:419-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.
  • Duplicated block (9 lines × 2) crates/webcodex-cli/src/webcodex_cli/system.rs:216 — crates/webcodex-cli/src/webcodex_cli/system.rs:216-226 | src/project_entry_windows.rs:161-169 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/system.rs` and `src/project_entry_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/system.rs:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/webcodex-computer/src/platform/macos/accessibility.rs:385 — crates/webcodex-computer/src/platform/macos/accessibility.rs:385-393 | crates/webcodex-computer/src/platform/macos/accessibility.rs:461-469 — both copies are in the same file, so extract the 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 `crates/webcodex-computer/src/platform/macos/accessibility.rs:385` 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) crates/webcodex-core/src/mcp_gateway.rs:449 — crates/webcodex-core/src/mcp_gateway.rs:449-457 | crates/webcodex-core/src/plugin.rs:1043-1051 — before extracting anything, compare `crates/webcodex-core/src/mcp_gateway.rs` and `crates/webcodex-core/src/plugin.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 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 `crates/webcodex-core/src/mcp_gateway.rs:449` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `tools` to `&[McpGatewayTool]` in one and `&[PluginTool]` 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 (9 lines × 2) crates/webcodex-core/src/project_instructions.rs:222 — crates/webcodex-core/src/project_instructions.rs:222-230 | crates/webcodex-core/src/project_instructions.rs:400-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-core/src/project_instructions.rs:222` 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) crates/webcodex-core/src/runner_protocol/job.rs:615 — crates/webcodex-core/src/runner_protocol/job.rs:615-623 | crates/webcodex-core/src/runner_protocol/job.rs:643-651 — both copies are in the same file, so extract the 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 `crates/webcodex-core/src/runner_protocol/job.rs:615` 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) crates/webcodex-core/src/validation_evidence.rs:737 — crates/webcodex-core/src/validation_evidence.rs:737-745 | crates/webcodex-workflow-session/src/continuation.rs:1984-1992 — 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 `crates/webcodex-core/src/validation_evidence.rs:737` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `left` to `&CargoDiagnostic` in one and `&FailureIdentity` 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 (9 lines × 2) crates/webcodex-environment/src/migration.rs:486 — crates/webcodex-environment/src/migration.rs:486-494 | crates/webcodex-environment/src/migration.rs:1012-1020 — both copies are in the same file, so extract the 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) crates/webcodex-environment/src/native.rs:954 — crates/webcodex-environment/src/native.rs:954-962 | crates/webcodex-environment/src/native.rs:998-1006 — both copies are in the same file, so extract the 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) crates/webcodex-environment/src/privilege.rs:61 — crates/webcodex-environment/src/privilege.rs:61-69 | crates/webcodex-environment/src/privilege.rs:146-154 — both copies are in the same file, so extract the 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 `crates/webcodex-environment/src/privilege.rs:61` 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) crates/webcodex-environment/src/session_service.rs:435 — crates/webcodex-environment/src/session_service.rs:435-443 | crates/webcodex-environment/src/session_service.rs:453-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/session_service.rs:435` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/webcodex-persistent-shell/src/framing.rs:151 — crates/webcodex-persistent-shell/src/framing.rs:151-159 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:675-683 — 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 `crates/webcodex-persistent-shell/src/framing.rs:151` 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) crates/webcodex-persistent-shell/src/unix.rs:99 — crates/webcodex-persistent-shell/src/unix.rs:99-107 | crates/webcodex-persistent-shell/src/windows.rs:174-182 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-persistent-shell/src/windows.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/webcodex-persistent-shell/src/unix/readers.rs:34 — crates/webcodex-persistent-shell/src/unix/readers.rs:34-42 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:534-542 — 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 `crates/webcodex-persistent-shell/src/unix/readers.rs:34` 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) crates/webcodex-persistent-shell/src/windows.rs:95 — crates/webcodex-persistent-shell/src/windows.rs:95-103 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:407-415 — before extracting anything, compare `crates/webcodex-persistent-shell/src/windows.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-persistent-shell/src/windows.rs:95` 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) crates/webcodex-process/src/unix.rs:389 — crates/webcodex-process/src/unix.rs:389-397 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/macos.rs:14-22 — 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 `crates/webcodex-process/src/unix.rs:389` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) crates/webcodex-runner-registry/src/jobs.rs:388 — crates/webcodex-runner-registry/src/jobs.rs:388-396 | crates/webcodex-runner/src/webcodex_runner/detached_job/model.rs:552-560 — 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) crates/webcodex-runner-registry/src/requests.rs:2006 — crates/webcodex-runner-registry/src/requests.rs:2006-2014 | crates/webcodex-runner-registry/src/requests.rs:2078-2086 — both copies are in the same file, so extract the 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) crates/webcodex-runner-registry/src/requests.rs:2937 — crates/webcodex-runner-registry/src/requests.rs:2937-2945 | crates/webcodex-runner-registry/src/requests.rs:3084-3092 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:2937` 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.
  • + 48 more in this group — see findings.md.
D1 · Cyclomatic Complexity · webcodex_runner · ×66
  • webcodex_runner::webcodex_runner::fake_mcp_gateway::main (cyclomatic 85) crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:11 — webcodex_runner::webcodex_runner::fake_mcp_gateway::main has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner::webcodex_runner::projects::managed_worktree::handle_prepare_managed_worktree_operation (cyclomatic 73) crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:575 — webcodex_runner::webcodex_runner::projects::managed_worktree::handle_prepare_managed_worktree_operation has cyclomatic complexity 73 (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.
  • webcodex_runner::webcodex_runner::fake_plugin::main (cyclomatic 69) crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:13 — webcodex_runner::webcodex_runner::fake_plugin::main has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_operation (cyclomatic 60) crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:718 — webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_operation has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner::webcodex_runner::patches::edit_plan (cyclomatic 49) crates/webcodex-runner/src/webcodex_runner/patches.rs:498 — webcodex_runner::webcodex_runner::patches::edit_plan 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.
  • webcodex_runner::webcodex_runner::patches::handle_apply_text_edits_file_request (cyclomatic 48) crates/webcodex-runner/src/webcodex_runner/patches.rs:1887 — webcodex_runner::webcodex_runner::patches::handle_apply_text_edits_file_request 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.
  • webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome (cyclomatic 46) crates/webcodex-runner/src/webcodex_runner/dispatch.rs:332 — webcodex_runner::webcodex_runner::dispatch::dispatch_request_with_outcome has cyclomatic complexity 46 (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.
  • webcodex_runner::webcodex_runner::job_manager::admission::validate_runner_job_context_operation (cyclomatic 45) crates/webcodex-runner/src/webcodex_runner/job_manager/admission.rs:6 — webcodex_runner::webcodex_runner::job_manager::admission::validate_runner_job_context_operation 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.
  • webcodex_runner::webcodex_runner::detached_job::platform::unix::run_accepted_payload (cyclomatic 42) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:265 — webcodex_runner::webcodex_runner::detached_job::platform::unix::run_accepted_payload 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.
  • webcodex_runner::webcodex_runner::detached_job::platform::windows::run_accepted_payload (cyclomatic 41) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:288 — webcodex_runner::webcodex_runner::detached_job::platform::windows::run_accepted_payload 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.
  • webcodex_runner::webcodex_runner::transport::stream::serve_registered_stream (cyclomatic 41) crates/webcodex-runner/src/webcodex_runner/transport/stream.rs:229 — webcodex_runner::webcodex_runner::transport::stream::serve_registered_stream 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.
  • webcodex_runner::webcodex_runner::shell::execution::execute_configured_command_impl (cyclomatic 40) crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:103 — webcodex_runner::webcodex_runner::shell::execution::execute_configured_command_impl 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.
  • webcodex_runner::webcodex_runner::transport::polling::run_polling_session (cyclomatic 39) crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:183 — webcodex_runner::webcodex_runner::transport::polling::run_polling_session has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime_from_file (cyclomatic 38) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:416 — webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime_from_file has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner::webcodex_runner::browser::handle_browser_operation (cyclomatic 37) crates/webcodex-runner/src/webcodex_runner/browser.rs:233 — webcodex_runner::webcodex_runner::browser::handle_browser_operation has cyclomatic complexity 37 (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.
  • webcodex_runner::webcodex_runner::project_format::format_candidates_with_deadline (cyclomatic 37) crates/webcodex-runner/src/webcodex_runner/project_format.rs:415 — webcodex_runner::webcodex_runner::project_format::format_candidates_with_deadline 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.
  • webcodex_runner::webcodex_runner::artifacts::upload::handle_artifact_upload_begin (cyclomatic 33) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:669 — webcodex_runner::webcodex_runner::artifacts::upload::handle_artifact_upload_begin 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.
  • webcodex_runner::webcodex_runner::config::validate_acp_config (cyclomatic 32) crates/webcodex-runner/src/webcodex_runner/config.rs:1880 — webcodex_runner::webcodex_runner::config::validate_acp_config 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.
  • webcodex_runner::webcodex_runner::files::handle_skill_read_file_request (cyclomatic 31) crates/webcodex-runner/src/webcodex_runner/files.rs:642 — webcodex_runner::webcodex_runner::files::handle_skill_read_file_request has cyclomatic complexity 31 (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.
  • webcodex_runner::webcodex_runner::projects::registration::handle_resolve_or_register_project_operation (cyclomatic 31) crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:578 — webcodex_runner::webcodex_runner::projects::registration::handle_resolve_or_register_project_operation 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.
  • webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime (cyclomatic 30) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:232 — webcodex_runner::webcodex_runner::artifacts::inspection::ooxml_mime 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.
  • webcodex_runner::webcodex_runner::computer::handle_computer_operation_with_runtime (cyclomatic 30) crates/webcodex-runner/src/webcodex_runner/computer.rs:133 — webcodex_runner::webcodex_runner::computer::handle_computer_operation_with_runtime has cyclomatic complexity 30 (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.
  • webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_lifecycle_operation (cyclomatic 30) crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:215 — webcodex_runner::webcodex_runner::projects::lifecycle::handle_project_lifecycle_operation has cyclomatic complexity 30 (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.
  • webcodex_runner::webcodex_runner::validation::execute::run_bounded (cyclomatic 30) crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:33 — webcodex_runner::webcodex_runner::validation::execute::run_bounded 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.
  • webcodex_runner::parse_runner_args (cyclomatic 27) crates/webcodex-runner/src/main.rs:86 — webcodex_runner::parse_runner_args 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.
  • + 41 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×64
  • Duplicated block (8 lines × 2) apps/desktop/src-tauri/src/state/updates.rs:226 — apps/desktop/src-tauri/src/state/updates.rs:226-233 | apps/desktop/src-tauri/src/state/updates.rs:310-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) apps/desktop/src-tauri/src/tray.rs:474 — apps/desktop/src-tauri/src/tray.rs:474-481 | apps/desktop/src-tauri/src/tray.rs:485-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/desktop/src-tauri/src/tray.rs:474` 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, `apps/desktop/src-tauri/src/tray.rs:472` calls `text` and `apps/desktop/src-tauri/src/tray.rs:483` 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) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:112 — apps/desktop/src-tauri/src/webcodex/settings/acp.rs:112-119 | apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:99-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/desktop/src-tauri/src/webcodex/settings/acp.rs:112` 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) crates/webcodex-admin/src/commands.rs:286 — crates/webcodex-admin/src/commands.rs:286-293 | crates/webcodex-admin/src/commands.rs:315-322 — both copies are in the same file, so extract the 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 `crates/webcodex-admin/src/commands.rs:286` 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) crates/webcodex-admin/src/commands.rs:835 — crates/webcodex-admin/src/commands.rs:835-842 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:128-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/webcodex-browser/src/cdp.rs:1883 — crates/webcodex-browser/src/cdp.rs:1883-1890 | crates/webcodex-browser/src/cdp.rs:2337-2344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `raw_nodes` to `&[Value]) -> (Vec<BackendNode>` in one and `&[Value]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) crates/webcodex-browser/src/cdp.rs:3025 — crates/webcodex-browser/src/cdp.rs:3025-3032 | crates/webcodex-browser/src/cdp.rs:3062-3069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/webcodex-cli/src/lib.rs:554 — crates/webcodex-cli/src/lib.rs:554-561 | crates/webcodex-cli/src/lib.rs:729-736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/webcodex-cli/src/lib.rs:2177 — crates/webcodex-cli/src/lib.rs:2177-2184 | crates/webcodex-cli/src/lib.rs:2426-2433 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/lib.rs:2177` 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) crates/webcodex-core/src/mcp_gateway.rs:650 — crates/webcodex-core/src/mcp_gateway.rs:650-657 | src/tool_runtime/computer_tools/snapshot_receipts.rs:176-183 — 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 `crates/webcodex-core/src/mcp_gateway.rs:650` 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) crates/webcodex-core/src/mcp_gateway.rs:660 — crates/webcodex-core/src/mcp_gateway.rs:660-667 | crates/webcodex-core/src/plugin.rs:1475-1482 — before extracting anything, compare `crates/webcodex-core/src/mcp_gateway.rs` and `crates/webcodex-core/src/plugin.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/webcodex-core/src/project_build.rs:172 — crates/webcodex-core/src/project_build.rs:172-179 | crates/webcodex-core/src/project_validation.rs:193-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-core/src/project_build.rs:172` 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) crates/webcodex-core/src/project_build.rs:212 — crates/webcodex-core/src/project_build.rs:212-219 | crates/webcodex-core/src/project_validation.rs:225-232 — 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 `crates/webcodex-core/src/project_build.rs:212` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/webcodex-environment/src/process/unix.rs:65 — crates/webcodex-environment/src/process/unix.rs:65-72 | crates/webcodex-environment/src/process/windows.rs:45-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/process/unix.rs:65` 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 first that the copies are not typed on the same thing: the declarations holding them bind `stream` to `&mut impl Read` in one and `&mut (impl Read + AsRawHandle)` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-environment/src/process/unix.rs:73` calls `Err`, `kind`, `Ok` and `crates/webcodex-environment/src/process/windows.rs:53` 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 (8 lines × 2) crates/webcodex-persistent-shell/src/unix.rs:159 — crates/webcodex-persistent-shell/src/unix.rs:159-166 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:343-350 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-persistent-shell/src/unix.rs:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/webcodex-runner-registry/src/job_updates.rs:1421 — crates/webcodex-runner-registry/src/job_updates.rs:1421-1428 | crates/webcodex-runner-registry/src/job_updates.rs:1648-1655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/webcodex-runner-registry/src/requests.rs:1671 — crates/webcodex-runner-registry/src/requests.rs:1671-1678 | crates/webcodex-runner-registry/src/requests.rs:2385-2392 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:1671` 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) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:226 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:226-233 | crates/webcodex-runner/src/webcodex_runner/patches.rs:88-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 `crates/webcodex-runner/src/webcodex_runner/artifacts.rs:226` 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) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:217 — crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:217-224 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:225-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/webcodex-runner/src/webcodex_runner/computer.rs:236 — crates/webcodex-runner/src/webcodex_runner/computer.rs:236-243 | crates/webcodex-runner/src/webcodex_runner/computer.rs:295-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/webcodex-runner/src/webcodex_runner/files.rs:445 — crates/webcodex-runner/src/webcodex_runner/files.rs:445-452 | crates/webcodex-runner/src/webcodex_runner/files.rs:769-776 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/files.rs:445` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:261 — crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:261-268 | crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs:226-233 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs` and `crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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 (8 lines × 2) crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:35 — crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:35-42 | crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:143-150 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:35` 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 after the matched lines, `crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:152` calls `with_capacity` and `crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:43` 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) crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:422 — crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:422-429 | crates/webcodex-store/src/server_instance.rs:23-30 — 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) crates/webcodex-runner/src/webcodex_runner/project_build.rs:237 — crates/webcodex-runner/src/webcodex_runner/project_build.rs:237-244 | crates/webcodex-runner/src/webcodex_runner/validation/project.rs:225-232 — 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 `crates/webcodex-runner/src/webcodex_runner/project_build.rs:237` 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.
  • + 39 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×63
  • Duplicated block (7 lines × 2) apps/desktop/src-tauri/src/diagnostics.rs:368 — apps/desktop/src-tauri/src/diagnostics.rs:368-374 | crates/webcodex-environment/src/inventory/model.rs:157-163 — 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 `apps/desktop/src-tauri/src/diagnostics.rs:368` 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 first that the copies are not typed on the same thing: the declarations holding them bind `info` to `&MachineBuildInfo` in one and `&webcodex_core::desktop_runtime_contract::MachineBuildInfo` 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 (7 lines × 2) apps/desktop/src-tauri/src/lifecycle_log.rs:274 — apps/desktop/src-tauri/src/lifecycle_log.rs:274-280 | crates/webcodex-runner/src/webcodex_runner/file_access.rs:39-45 — 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 `apps/desktop/src-tauri/src/lifecycle_log.rs:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:104 — apps/desktop/src-tauri/src/webcodex/settings/acp.rs:104-110 | apps/desktop/src-tauri/src/webcodex/settings/mcp.rs: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 `apps/desktop/src-tauri/src/webcodex/settings/acp.rs:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:51 — apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:51-57 | apps/desktop/src-tauri/src/webcodex/settings/mcp.rs: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 `apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:51` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:94` calls `and_then` and `apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:58` 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) crates/webcodex-browser/src/profiles.rs:110 — crates/webcodex-browser/src/profiles.rs:110-116 | crates/webcodex-environment/src/storage.rs:265-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-browser/src/profiles.rs:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/webcodex-cli/src/lib.rs:1321 — crates/webcodex-cli/src/lib.rs:1321-1327 | crates/webcodex-cli/src/lib.rs:2578-2584 — both copies are in the same file, so extract the 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) crates/webcodex-environment/src/privilege.rs:219 — crates/webcodex-environment/src/privilege.rs:219-225 | crates/webcodex-environment/src/privilege.rs:242-248 — both copies are in the same file, so extract the 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 `crates/webcodex-environment/src/privilege.rs:219` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/webcodex-environment/src/privilege.rs:384 — crates/webcodex-environment/src/privilege.rs:384-390 | crates/webcodex-environment/src/storage.rs:286-292 — 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) crates/webcodex-environment/src/privilege.rs:391 — crates/webcodex-environment/src/privilege.rs:391-397 | crates/webcodex-environment/src/storage.rs:261-267 — 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 `crates/webcodex-environment/src/privilege.rs:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/webcodex-environment/src/storage.rs:354 — crates/webcodex-environment/src/storage.rs:354-360 | src/upgrade_maintenance_store.rs:279-285 — before extracting anything, compare `crates/webcodex-environment/src/storage.rs` and `src/upgrade_maintenance_store.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/storage.rs:354` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/webcodex-lsp/src/supervisor.rs:511 — crates/webcodex-lsp/src/supervisor.rs:511-517 | crates/webcodex-lsp/src/supervisor.rs:558-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/webcodex-runner-registry/src/job_updates.rs:1647 — crates/webcodex-runner-registry/src/job_updates.rs:1647-1653 | crates/webcodex-runner-registry/src/job_updates.rs:1825-1831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/webcodex-runner-registry/src/reconciliation.rs:1057 — crates/webcodex-runner-registry/src/reconciliation.rs:1057-1063 | crates/webcodex-runner-registry/src/reconciliation.rs:1183-1189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner-registry/src/reconciliation.rs:1057` 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) crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:127 — crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:127-133 | crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:139-145 — both copies are in the same file, so extract the 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, `crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:146` calls `saturating_add`, `now` and `crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:134` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/webcodex-runner/src/webcodex_runner/patches.rs:569 — crates/webcodex-runner/src/webcodex_runner/patches.rs:569-576 | crates/webcodex-runner/src/webcodex_runner/patches.rs:651-657 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/patches.rs:569` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-runner/src/webcodex_runner/patches.rs:657` calls `canonicalize_apply_text_line_endings`, `map_err`, `plain` and `crates/webcodex-runner/src/webcodex_runner/patches.rs:576` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1445 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1445-1452 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1469-1475 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1445` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) crates/webcodex-runner/src/webcodex_runner/transport/project_inventory.rs:150 — crates/webcodex-runner/src/webcodex_runner/transport/project_inventory.rs:150-156 | crates/webcodex-runner/src/webcodex_runner/transport/project_inventory.rs:172-178 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/transport/project_inventory.rs:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/webcodex-store/src/goal.rs:316 — crates/webcodex-store/src/goal.rs:316-322 | crates/webcodex-store/src/goal.rs:419-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/goal.rs:316` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-store/src/goal.rs:418` calls `validate_workflow_session_id`, `map_err` and `crates/webcodex-store/src/goal.rs:315` 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) crates/webcodex-store/src/goal.rs:915 — crates/webcodex-store/src/goal.rs:915-921 | crates/webcodex-store/src/goal.rs:1018-1024 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/goal.rs:915` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/mcp.rs:1216 — src/mcp.rs:1216-1222 | src/mcp.rs:1244-1250 — both copies are in the same file, so extract the 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 `src/mcp.rs:1216` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) src/mcp/tools/call.rs:624 — src/mcp/tools/call.rs:624-630 | src/mcp/tools/call/specialized.rs:89-95 — 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 `src/mcp/tools/call.rs:624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/project_entry_windows.rs:79 — src/project_entry_windows.rs:79-85 | src/project_entry_windows.rs:110-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/project_entry_windows.rs:79` 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 after the matched lines, `src/project_entry_windows.rs:86` calls `is_err`, `remove_file` and `src/project_entry_windows.rs:117` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) src/runner_http/handlers.rs:95 — src/runner_http/handlers.rs:95-101 | src/runner_http/handlers.rs:296-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_http/handlers.rs:95` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) src/tool_runtime/changes.rs:999 — src/tool_runtime/changes.rs:999-1005 | src/tool_runtime/changes.rs:1147-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/tool_runtime/git/diff_hunks.rs:250 — src/tool_runtime/git/diff_hunks.rs:250-256 | src/tool_runtime/git/diff_hunks.rs:280-286 — both copies are in the same file, so extract the 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 `src/tool_runtime/git/diff_hunks.rs:250` 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, `src/tool_runtime/git/diff_hunks.rs:279` calls `update`, `to_be_bytes` and `src/tool_runtime/git/diff_hunks.rs:249` 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.
  • + 38 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×60
  • Duplicated block (11 lines × 2) apps/desktop/src-tauri/src/runtime_selection.rs:281 — apps/desktop/src-tauri/src/runtime_selection.rs:281-291 | apps/desktop/src-tauri/src/runtime_selection.rs:329-339 — both copies are in the same file, so extract the 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) apps/desktop/src-tauri/src/state/environment.rs:144 — apps/desktop/src-tauri/src/state/environment.rs:144-154 | apps/desktop/src-tauri/src/state/environment.rs:174-184 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/state/environment.rs:144` 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 first that the copies are not typed on the same thing: the declarations holding them bind `request` to `crate::models::EnvironmentUserCredentialRequest` in one and `crate::models::EnvironmentServiceRequest` 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 (11 lines × 2) apps/desktop/src-tauri/src/state/workspace_settings.rs:34 — apps/desktop/src-tauri/src/state/workspace_settings.rs:34-44 | apps/desktop/src-tauri/src/state/workspace_settings.rs:61-71 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/state/workspace_settings.rs:34` 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) apps/desktop/src-tauri/src/tray.rs:186 — apps/desktop/src-tauri/src/tray.rs:186-196 | apps/desktop/src-tauri/src/tray.rs:328-339 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/tray.rs:186` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) apps/desktop/src-tauri/src/webcodex/cli.rs:502 — apps/desktop/src-tauri/src/webcodex/cli.rs:502-512 | apps/desktop/src-tauri/src/webcodex/cli.rs:614-624 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/webcodex/cli.rs:502` 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) crates/webcodex-cli/src/lib.rs:1262 — crates/webcodex-cli/src/lib.rs:1262-1272 | crates/webcodex-cli/src/lib.rs:1304-1314 — both copies are in the same file, so extract the 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) crates/webcodex-cli/src/lib.rs:2201 — crates/webcodex-cli/src/lib.rs:2201-2211 | crates/webcodex-cli/src/lib.rs:2442-2452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-cli/src/lib.rs:2198` calls `Some`, `next_value` and `crates/webcodex-cli/src/lib.rs:2441` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/webcodex-cli/src/webcodex_cli/service.rs:976 — crates/webcodex-cli/src/webcodex_cli/service.rs:976-986 | crates/webcodex-cli/src/webcodex_cli/service.rs:990-1000 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/service.rs:976` 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 (11 lines × 2) crates/webcodex-cli/src/webcodex_cli/system.rs:228 — crates/webcodex-cli/src/webcodex_cli/system.rs:228-238 | src/project_entry_windows.rs:180-190 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/system.rs` and `src/project_entry_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/system.rs:228` 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) crates/webcodex-core/src/model_reference.rs:26 — crates/webcodex-core/src/model_reference.rs:26-36 | src/tool_runtime/project_resolution.rs:302-312 — 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 `crates/webcodex-core/src/model_reference.rs:26` 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 (11 lines × 2) crates/webcodex-environment/src/cloudflare_tunnel.rs:752 — crates/webcodex-environment/src/cloudflare_tunnel.rs:752-762 | crates/webcodex-environment/src/upgrade.rs:806-816 — 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 `crates/webcodex-environment/src/cloudflare_tunnel.rs:752` 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 (11 lines × 2) crates/webcodex-environment/src/service/linux.rs:541 — crates/webcodex-environment/src/service/linux.rs:541-551 | crates/webcodex-environment/src/service/windows.rs:1050-1060 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/webcodex-environment/src/unified_update/download.rs:218 — crates/webcodex-environment/src/unified_update/download.rs:218-228 | crates/webcodex-environment/src/unified_update/download.rs:398-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/unified_update/download.rs:218` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/webcodex-lsp/src/navigation.rs:1122 — crates/webcodex-lsp/src/navigation.rs:1122-1132 | crates/webcodex-lsp/src/navigation.rs:1681-1691 — both copies are in the same file, so extract the 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) crates/webcodex-persistent-shell/src/windows.rs:112 — crates/webcodex-persistent-shell/src/windows.rs:112-122 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:294-304 — before extracting anything, compare `crates/webcodex-persistent-shell/src/windows.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/webcodex-runner-registry/src/reconciliation.rs:868 — crates/webcodex-runner-registry/src/reconciliation.rs:868-878 | crates/webcodex-runner-registry/src/reconciliation.rs:950-960 — both copies are in the same file, so extract the 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) crates/webcodex-runner-registry/src/runners.rs:719 — crates/webcodex-runner-registry/src/runners.rs:719-729 | crates/webcodex-runner-registry/src/runners.rs:798-808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-runner-registry/src/runners.rs:809` calls `Some` and `crates/webcodex-runner-registry/src/runners.rs:730` 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 (11 lines × 2) crates/webcodex-runner-registry/src/validation.rs:470 — crates/webcodex-runner-registry/src/validation.rs:470-480 | crates/webcodex-runner-registry/src/validation.rs:493-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner-registry/src/validation.rs:470` 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 (11 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:256 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:256-266 | crates/webcodex-runner/src/webcodex_runner/patches.rs:106-116 — 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 `crates/webcodex-runner/src/webcodex_runner/artifacts.rs:256` 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 (11 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:95 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:95-105 | crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:382-392 — both copies are in the same file, so extract the 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) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:172 — crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:172-182 | crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs:147-157 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs` and `crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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 `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:172` 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) crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:184 — crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:184-194 | crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:205-215 — both copies are in the same file, so extract the 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) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:297 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:297-307 | crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:321-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:297` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1011 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1011-1021 | crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1076-1086 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1011` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1104 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1104-1114 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1782-1792 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs` and `crates/webcodex-runner/src/webcodex_runner/plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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 `crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1104` 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.
  • + 35 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×49
  • Duplicated block (6 lines × 2) apps/desktop/src-tauri/src/runner_capability_grant.rs:134 — apps/desktop/src-tauri/src/runner_capability_grant.rs:134-139 | apps/desktop/src-tauri/src/state/persistence.rs:314-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `apps/desktop/src-tauri/src/runner_capability_grant.rs:134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:80 — apps/desktop/src-tauri/src/webcodex/settings/acp.rs:80-85 | apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:62-67 — 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 `apps/desktop/src-tauri/src/webcodex/settings/acp.rs:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/webcodex-computer/src/platform/macos/accessibility.rs:599 — crates/webcodex-computer/src/platform/macos/accessibility.rs:599-604 | crates/webcodex-computer/src/platform/macos/accessibility.rs:619-624 — both copies are in the same file, so extract the 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) crates/webcodex-computer/src/platform/macos/accessibility.rs:981 — crates/webcodex-computer/src/platform/macos/accessibility.rs:981-986 | crates/webcodex-computer/src/platform/windows/accessibility.rs:779-784 — `crates/webcodex-computer/src/platform/macos/accessibility.rs` and `crates/webcodex-computer/src/platform/windows/accessibility.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 64 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 2) crates/webcodex-environment/src/storage.rs:473 — crates/webcodex-environment/src/storage.rs:473-478 | src/upgrade_maintenance_store.rs:18-23 — before extracting anything, compare `crates/webcodex-environment/src/storage.rs` and `src/upgrade_maintenance_store.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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.
  • Duplicated block (6 lines × 2) crates/webcodex-runner-registry/src/job_updates.rs:540 — crates/webcodex-runner-registry/src/job_updates.rs:540-545 | crates/webcodex-runner-registry/src/reconciliation.rs:283-291 — 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 `crates/webcodex-runner-registry/src/job_updates.rs:540` 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) crates/webcodex-runner-registry/src/jobs.rs:276 — crates/webcodex-runner-registry/src/jobs.rs:276-281 | crates/webcodex-runner-registry/src/reconciliation.rs:714-719 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:21 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:21-26 | src/tool_runtime/files/artifacts.rs:43-48 — 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 `crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1243 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1243-1248 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1877-1882 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs` and `crates/webcodex-runner/src/webcodex_runner/plugin.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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 `crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1243` 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) crates/webcodex-runner/src/webcodex_runner/transport/poll_dispatch.rs:570 — crates/webcodex-runner/src/webcodex_runner/transport/poll_dispatch.rs:570-575 | crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:276-281 — 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 `crates/webcodex-runner/src/webcodex_runner/transport/poll_dispatch.rs:570` 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) crates/webcodex-store/src/agent_task/endpoint_loss.rs:37 — crates/webcodex-store/src/agent_task/endpoint_loss.rs:37-42 | crates/webcodex-store/src/goal_stall.rs:374-379 — 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 `crates/webcodex-store/src/agent_task/endpoint_loss.rs: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 (6 lines × 2) crates/webcodex-store/src/agent_wait.rs:423 — crates/webcodex-store/src/agent_wait.rs:423-428 | crates/webcodex-store/src/agent_wait.rs:632-637 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/agent_wait.rs:423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) crates/webcodex-store/src/communication.rs:2505 — crates/webcodex-store/src/communication.rs:2505-2510 | crates/webcodex-workflow-session/src/persistence/database.rs:346-351 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/communication.rs:2505` 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) crates/webcodex-validation/src/adapters/go.rs:120 — crates/webcodex-validation/src/adapters/go.rs:120-125 | crates/webcodex-validation/src/adapters/go.rs:187-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-validation/src/adapters/go.rs:118` calls `push`, `Value` and `crates/webcodex-validation/src/adapters/go.rs:185` 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) src/auth/middleware.rs:369 — src/auth/middleware.rs:369-374 | src/auth/middleware.rs:494-499 — both copies are in the same file, so extract the 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 `src/auth/middleware.rs:369` 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) src/mcp/tools/call.rs:627 — src/mcp/tools/call.rs:627-632 | src/mcp/tools/call/response.rs:72-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/mcp/tools/call.rs:627` 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) src/runtime_http.rs:291 — src/runtime_http.rs:291-296 | src/runtime_http.rs:385-394 — both copies are in the same file, so extract the 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 `src/runtime_http.rs:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) src/tool_runtime/git/mutations.rs:199 — src/tool_runtime/git/mutations.rs:199-204 | src/tool_runtime/git/mutations.rs:223-228 — both copies are in the same file, so extract the 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 `src/tool_runtime/git/mutations.rs:199` 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) src/tool_runtime/work_result.rs:782 — src/tool_runtime/work_result.rs:782-787 | src/tool_runtime/work_result.rs:881-886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tool_runtime/work_result.rs:781` calls `get`, `and_then` and `src/tool_runtime/work_result.rs:880` 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 (6 lines × 2) apps/desktop/src-tauri/src/coding_agents.rs:303 — apps/desktop/src-tauri/src/coding_agents.rs:303-308 | apps/desktop/src-tauri/src/mcp_providers.rs:518-523 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) apps/desktop/src-tauri/src/diagnostics.rs:138 — apps/desktop/src-tauri/src/diagnostics.rs:138-143 | apps/desktop/src-tauri/src/diagnostics.rs:144-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) crates/webcodex-cli/src/main.rs:2 — crates/webcodex-cli/src/main.rs:2-7 | src/bin/webcodex-server.rs:31-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/main.rs:2` 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) crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:503 — crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:503-508 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:396-401 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs` and `crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 (6 lines × 2) crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:337 — crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:337-342 | crates/webcodex-runner/src/webcodex_runner/transport/websocket.rs:152-157 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/transport/quic.rs` and `crates/webcodex-runner/src/webcodex_runner/transport/websocket.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 `crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:337` 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) crates/webcodex-store/src/communication.rs:745 — crates/webcodex-store/src/communication.rs:745-750 | crates/webcodex-store/src/communication.rs:1982-1987 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/communication.rs:745` 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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×48
  • Duplicated block (10 lines × 2) apps/desktop/src-tauri/src/state/connections.rs:209 — apps/desktop/src-tauri/src/state/connections.rs:209-218 | apps/desktop/src-tauri/src/state/connections.rs:351-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/desktop/src-tauri/src/state/connections.rs:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) apps/desktop/src-tauri/src/state/path_inventory/export.rs:110 — apps/desktop/src-tauri/src/state/path_inventory/export.rs:110-119 | src/upgrade_maintenance_store.rs:243-252 — 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) apps/desktop/src-tauri/src/webcodex/adapter.rs:987 — apps/desktop/src-tauri/src/webcodex/adapter.rs:987-996 | crates/webcodex-environment/src/native.rs:1940-1949 — 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 `apps/desktop/src-tauri/src/webcodex/adapter.rs:987` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/webcodex-cli/src/lib.rs:505 — crates/webcodex-cli/src/lib.rs:505-514 | crates/webcodex-cli/src/lib.rs:936-945 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/lib.rs:505` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/webcodex-cli/src/lib.rs:772 — crates/webcodex-cli/src/lib.rs:772-781 | crates/webcodex-cli/src/lib.rs:832-841 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/lib.rs:772` 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) crates/webcodex-cli/src/webcodex_cli/login.rs:60 — crates/webcodex-cli/src/webcodex_cli/login.rs:60-69 | crates/webcodex-runner/src/webcodex_runner/config.rs:2553-2562 — 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) crates/webcodex-cli/src/webcodex_cli/server.rs:104 — crates/webcodex-cli/src/webcodex_cli/server.rs:104-113 | crates/webcodex-cli/src/webcodex_cli/server.rs:570-579 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/server.rs:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/webcodex-cli/src/webcodex_cli/system.rs:451 — crates/webcodex-cli/src/webcodex_cli/system.rs:451-460 | crates/webcodex-cli/src/webcodex_cli/system.rs:478-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/webcodex-computer/src/lib.rs:1613 — crates/webcodex-computer/src/lib.rs:1613-1622 | crates/webcodex-computer/src/lib.rs:1818-1827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/webcodex-lsp/src/navigation.rs:1750 — crates/webcodex-lsp/src/navigation.rs:1750-1759 | crates/webcodex-lsp/src/navigation.rs:1776-1785 — both copies are in the same file, so extract the 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 `crates/webcodex-lsp/src/navigation.rs:1750` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/webcodex-openai-tunnel/src/run_fence.rs:299 — crates/webcodex-openai-tunnel/src/run_fence.rs:299-308 | crates/webcodex-openai-tunnel/src/run_fence.rs:406-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-openai-tunnel/src/run_fence.rs:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/webcodex-persistent-shell/src/framing.rs:11 — crates/webcodex-persistent-shell/src/framing.rs:11-20 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:511-520 — 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) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:431 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:431-440 | crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:515-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:175 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:175-184 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:263-272 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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. 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) crates/webcodex-runner/src/webcodex_runner/execution_io.rs:40 — crates/webcodex-runner/src/webcodex_runner/execution_io.rs:40-49 | crates/webcodex-runner/src/webcodex_runner/execution_io.rs:61-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:265 — crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:265-274 | crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:270-279 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs` and `crates/webcodex-runner/src/webcodex_runner/validation/execute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:307 — crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:307-316 | crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:317-326 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs` and `crates/webcodex-runner/src/webcodex_runner/validation/execute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:307` 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) crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:150 — crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:150-159 | crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:339-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:148 — crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:148-157 | src/tool_runtime/projects.rs:1491-1500 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/projects/registration.rs` and `src/tool_runtime/projects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:148` 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) crates/webcodex-store/src/job_terminal_wait.rs:314 — crates/webcodex-store/src/job_terminal_wait.rs:314-323 | crates/webcodex-store/src/job_terminal_wait.rs:350-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/job_terminal_wait.rs:314` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:369 — crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:369-378 | crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:580-589 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:369` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:495 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:495-504 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:574-583 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/webcodex-workspace/src/project_recipe.rs:822 — crates/webcodex-workspace/src/project_recipe.rs:822-831 | crates/webcodex-workspace/src/project_recipe.rs:1022-1031 — both copies are in the same file, so extract the 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 `crates/webcodex-workspace/src/project_recipe.rs:822` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) src/cloudflare_ingress.rs:1270 — src/cloudflare_ingress.rs:1270-1279 | src/cloudflare_ingress.rs:1293-1302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/tool_runtime/agent_task.rs:30 — src/tool_runtime/agent_task.rs:30-39 | src/tool_runtime/communication.rs:44-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/agent_task.rs:30` 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.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×43
  • Duplicated block (5 lines × 2) apps/desktop/src-tauri/src/runner_capability_grant.rs:146 — apps/desktop/src-tauri/src/runner_capability_grant.rs:146-150 | crates/webcodex-lsp/src/supervisor.rs:1496-1500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/webcodex-browser/src/supervisor.rs:580 — crates/webcodex-browser/src/supervisor.rs:580-584 | crates/webcodex-browser/src/supervisor.rs:694-698 — both copies are in the same file, so extract the 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 `crates/webcodex-browser/src/supervisor.rs:580` 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) crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:117 — crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:117-122 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:572-576 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs` and `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:577` calls `join` and `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:123` 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 (5 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:227 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:227-233 | crates/webcodex-runner/src/webcodex_runner/computer_session/platform/windows.rs:103-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/webcodex-cli/src/webcodex_cli/service.rs:527 — crates/webcodex-cli/src/webcodex_cli/service.rs:527-531 | crates/webcodex-cli/src/webcodex_cli/service.rs:624-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-cli/src/webcodex_cli/service.rs:525` calls `filter`, `as_os_str`, `is_empty` and `crates/webcodex-cli/src/webcodex_cli/service.rs:622` 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 (5 lines × 2) crates/webcodex-environment/src/privilege.rs:43 — crates/webcodex-environment/src/privilege.rs:43-47 | crates/webcodex-environment/src/privilege.rs:125-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/privilege.rs:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/webcodex-environment/src/unified_update/data_dir.rs:155 — crates/webcodex-environment/src/unified_update/data_dir.rs:155-159 | crates/webcodex-runner/src/webcodex_runner/validation/path.rs:62-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/unified_update/data_dir.rs:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1162 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1162-1166 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1194-1198 — both copies are in the same file, so extract the 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 (5 lines × 2) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1887 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1887-1891 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1931-1935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1930` calls `replace` and `crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1886` 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) crates/webcodex-store/src/goal.rs:1548 — crates/webcodex-store/src/goal.rs:1548-1553 | crates/webcodex-workflow-session/src/persistence/database.rs:343-347 — 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 `crates/webcodex-store/src/goal.rs:1548` 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) crates/webcodex-store/src/peer_collaboration.rs:648 — crates/webcodex-store/src/peer_collaboration.rs:648-652 | crates/webcodex-workflow-session/src/store.rs:2714-2718 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-workflow-session/src/store.rs:2712` calls `finalize` and `crates/webcodex-store/src/peer_collaboration.rs:646` 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 (5 lines × 2) crates/webcodex-store/src/window_activity.rs:172 — crates/webcodex-store/src/window_activity.rs:172-176 | crates/webcodex-store/src/window_activity.rs:284-288 — both copies are in the same file, so extract the 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) src/runner_http/handlers.rs:299 — src/runner_http/handlers.rs:299-303 | src/runner_http/handlers.rs:368-374 — both copies are in the same file, so extract the 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 `src/runner_http/handlers.rs:299` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) src/runtime_console_http/workspace.rs:55 — src/runtime_console_http/workspace.rs:55-59 | src/runtime_console_http/workspace.rs:104-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) apps/desktop/src-tauri/src/platform/windows.rs:38 — apps/desktop/src-tauri/src/platform/windows.rs:38-42 | crates/webcodex-runner/src/webcodex_runner/config.rs:1231-1235 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `Option<&OsStr>` in one and `Option<&std::ffi::OsStr>` 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 (5 lines × 2) crates/webcodex-persistent-shell/src/unix.rs:197 — crates/webcodex-persistent-shell/src/unix.rs:197-201 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:388-392 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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.
  • Duplicated block (5 lines × 2) crates/webcodex-runner-registry/src/validation.rs:653 — crates/webcodex-runner-registry/src/validation.rs:653-657 | crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:50-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/webcodex-runner-registry/src/validation.rs:659 — crates/webcodex-runner-registry/src/validation.rs:659-663 | crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:527-531 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:279 — crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:279-283 | src/tool_runtime/observe_jobs.rs:729-733 — 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:279` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `&'static str` in one and `&str` 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 (5 lines × 2) src/runtime_console_http/store_read.rs:162 — src/runtime_console_http/store_read.rs:162-166 | src/runtime_console_http/window_queries.rs:56-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/webcodex-core/src/sensitive_paths.rs:116 — crates/webcodex-core/src/sensitive_paths.rs:116-120 | crates/webcodex-workspace/src/path_policy.rs:45-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/webcodex-persistent-shell/src/windows.rs:105 — crates/webcodex-persistent-shell/src/windows.rs:105-109 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:307-311 — before extracting anything, compare `crates/webcodex-persistent-shell/src/windows.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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.
  • Duplicated block (5 lines × 2) src/mcp.rs:746 — src/mcp.rs:746-755 | src/mcp.rs:790-794 — both copies are in the same file, so extract the 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 `src/mcp.rs:746` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/webcodex-runner-config/src/paths.rs:127 — crates/webcodex-runner-config/src/paths.rs:127-135 | crates/webcodex-runner-config/src/paths.rs:169-173 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-config/src/paths.rs:127` 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) crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:244 — crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:244-250 | crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:282-286 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 18 more in this group — see findings.md.
D2 · Cognitive Complexity · webcodex_cli · ×42
  • webcodex_cli::environment::run_inner (cognitive 189) crates/webcodex-cli/src/environment.rs:314 — webcodex_cli::environment::run_inner has cognitive complexity 189 (threshold 15). Drivers by points: if/else 80 (144 pts), match/switch 11 (25 pts), boolean chains 18, loops 1 (2 pts) (nesting depth added 79). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_cli::run (cognitive 120) crates/webcodex-cli/src/lib.rs:2749 — webcodex_cli::run has cognitive complexity 120 (threshold 15). Drivers by points: if/else 22 (59 pts), match/switch 30 (59 pts), boolean chains 2 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_cli::webcodex_cli::controller::run_controller_command (cognitive 66) crates/webcodex-cli/src/webcodex_cli/controller.rs:1959 — webcodex_cli::webcodex_cli::controller::run_controller_command has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (54 pts), match/switch 2 (6 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 39). 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.
  • webcodex_cli::environment::parse (cognitive 60) crates/webcodex-cli/src/environment.rs:57 — webcodex_cli::environment::parse has cognitive complexity 60 (threshold 15). Drivers by points: boolean chains 27, if/else 23 (27 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • webcodex_cli::parse_connect (cognitive 56) crates/webcodex-cli/src/lib.rs:474 — webcodex_cli::parse_connect has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (31 pts), match/switch 13 (21 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • webcodex_cli::webcodex_cli::connect::oauth::run_oauth_connect (cognitive 55) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:521 — webcodex_cli::webcodex_cli::connect::oauth::run_oauth_connect has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (40 pts), match/switch 7 (12 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.
  • webcodex_cli::parse_project_subcommand (cognitive 39) crates/webcodex-cli/src/lib.rs:758 — webcodex_cli::parse_project_subcommand has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 6 (13 pts), loops 2 (4 pts) (nesting depth added 22). 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.
  • webcodex_cli::webcodex_cli::controller_tui::run (cognitive 39) crates/webcodex-cli/src/webcodex_cli/controller_tui.rs:744 — webcodex_cli::webcodex_cli::controller_tui::run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_cli::webcodex_cli::project::run_project_activate (cognitive 34) crates/webcodex-cli/src/webcodex_cli/project.rs:635 — webcodex_cli::webcodex_cli::project::run_project_activate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 3 (5 pts), 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.
  • webcodex_cli::webcodex_cli::controller::validate_config (cognitive 29) crates/webcodex-cli/src/webcodex_cli/controller.rs:612 — webcodex_cli::webcodex_cli::controller::validate_config has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 8, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_cli::parse_runner_install_service_with_identity (cognitive 28) crates/webcodex-cli/src/lib.rs:2164 — webcodex_cli::parse_runner_install_service_with_identity has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 5 (6 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_cli::webcodex_cli::controller_tui::pipe_reader (cognitive 28) crates/webcodex-cli/src/webcodex_cli/controller_tui.rs:264 — webcodex_cli::webcodex_cli::controller_tui::pipe_reader has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_cli::parse_login (cognitive 27) crates/webcodex-cli/src/lib.rs:912 — webcodex_cli::parse_login has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 11 (15 pts), if/else 6 (8 pts), boolean chains 3, loops 1 (nesting depth added 6). 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.
  • webcodex_cli::parse_service_kind (cognitive 27) crates/webcodex-cli/src/lib.rs:1956 — webcodex_cli::parse_service_kind has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 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.
  • webcodex_cli::webcodex_cli::ops::ops_smoke_preflight_report (cognitive 27) crates/webcodex-cli/src/webcodex_cli/ops.rs:1015 — webcodex_cli::webcodex_cli::ops::ops_smoke_preflight_report has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 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.
  • webcodex_cli::webcodex_cli::runner_service::run_runner_status (cognitive 27) crates/webcodex-cli/src/webcodex_cli/runner_service.rs:456 — webcodex_cli::webcodex_cli::runner_service::run_runner_status has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (22 pts), match/switch 3 (4 pts), boolean chains 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.
  • webcodex_cli::environment::render (cognitive 26) crates/webcodex-cli/src/environment.rs:1077 — webcodex_cli::environment::render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (6 pts), 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.
  • webcodex_cli::environment::cloudflare::validate_input (cognitive 26) crates/webcodex-cli/src/environment/cloudflare.rs:10 — webcodex_cli::environment::cloudflare::validate_input has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (12 pts) (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.
  • webcodex_cli::environment::update::run_at (cognitive 25) crates/webcodex-cli/src/environment/update.rs:275 — webcodex_cli::environment::update::run_at has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 5 (8 pts), boolean chains 4 (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.
  • webcodex_cli::webcodex_cli::ops::run_ops_command (cognitive 25) crates/webcodex-cli/src/webcodex_cli/ops.rs:131 — webcodex_cli::webcodex_cli::ops::run_ops_command has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 11 (22 pts), if/else 2 (3 pts) (nesting depth added 12). 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.
  • webcodex_cli::parse_runner_status_with_identity (cognitive 24) crates/webcodex-cli/src/lib.rs:2320 — webcodex_cli::parse_runner_status_with_identity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (3 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.
  • webcodex_cli::webcodex_cli::connect::shared_key_oauth::provision_client (cognitive 24) crates/webcodex-cli/src/webcodex_cli/connect/shared_key_oauth.rs:265 — webcodex_cli::webcodex_cli::connect::shared_key_oauth::provision_client has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 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.
  • webcodex_cli::webcodex_cli::login::render_login_result (cognitive 23) crates/webcodex-cli/src/webcodex_cli/login.rs:591 — webcodex_cli::webcodex_cli::login::render_login_result has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webcodex_cli::webcodex_cli::mcp_config::render (cognitive 21) crates/webcodex-cli/src/webcodex_cli/mcp_config.rs:6 — webcodex_cli::webcodex_cli::mcp_config::render has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 3 (5 pts), match/switch 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.
  • webcodex_cli::webcodex_cli::system::resolve_user_api_token (cognitive 20) crates/webcodex-cli/src/webcodex_cli/system.rs:605 — webcodex_cli::webcodex_cli::system::resolve_user_api_token has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×42
  • Duplicated block (12 lines × 2) apps/desktop/src-tauri/src/lifecycle_log.rs:250 — apps/desktop/src-tauri/src/lifecycle_log.rs:250-261 | crates/webcodex-browser/src/profiles.rs:93-104 — 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) apps/desktop/src-tauri/src/state/connections.rs:522 — apps/desktop/src-tauri/src/state/connections.rs:522-533 | apps/desktop/src-tauri/src/state/connections.rs:643-654 — both copies are in the same file, so extract the 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 first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) async fn start_connection_process( &mut` in one and `super) async fn stop_connection_process( &mut` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apps/desktop/src-tauri/src/state/connections.rs:521` calls `check` and `apps/desktop/src-tauri/src/state/connections.rs:642` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) crates/webcodex-browser/src/supervisor.rs:553 — crates/webcodex-browser/src/supervisor.rs:553-564 | crates/webcodex-browser/src/supervisor.rs:582-593 — both copies are in the same file, so extract the 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 `crates/webcodex-browser/src/supervisor.rs:553` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/webcodex-cli/src/lib.rs:977 — crates/webcodex-cli/src/lib.rs:977-988 | crates/webcodex-cli/src/lib.rs:1094-1105 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/lib.rs:977` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:555 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:555-566 | crates/webcodex-cli/src/webcodex_cli/connect/process.rs:643-654 — both copies are in the same file, so extract the 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) crates/webcodex-persistent-shell/src/unix.rs:396 — crates/webcodex-persistent-shell/src/unix.rs:396-407 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:764-775 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-persistent-shell/src/unix.rs:396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/webcodex-persistent-shell/src/unix/readers.rs:56 — crates/webcodex-persistent-shell/src/unix/readers.rs:56-67 | crates/webcodex-persistent-shell/src/windows.rs:379-390 — 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 `crates/webcodex-persistent-shell/src/unix/readers.rs: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 (12 lines × 2) crates/webcodex-runner-registry/src/requests.rs:2671 — crates/webcodex-runner-registry/src/requests.rs:2671-2682 | crates/webcodex-runner-registry/src/requests.rs:2870-2881 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:2671` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:802 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:802-813 | crates/webcodex-runner/src/webcodex_runner/artifacts.rs:924-935 — both copies are in the same file, so extract the 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) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:172 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:172-183 | crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:271-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/webcodex-runner/src/webcodex_runner/plugin.rs:1722 — crates/webcodex-runner/src/webcodex_runner/plugin.rs:1722-1733 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1746-1757 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/plugin.rs:1722` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:135 — crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:135-146 | src/tool_runtime/projects.rs:1475-1486 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/projects/registration.rs` and `src/tool_runtime/projects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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.
  • Duplicated block (12 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/search.rs:50 — crates/webcodex-runner/src/webcodex_runner/shell/search.rs:50-61 | crates/webcodex-runner/src/webcodex_runner/shell/search.rs:70-81 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/shell/search.rs:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:601 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:601-612 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:650-661 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:601` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/webcodex-workflow-session/src/events.rs:1097 — crates/webcodex-workflow-session/src/events.rs:1097-1108 | crates/webcodex-workflow-session/src/events.rs:1237-1248 — both copies are in the same file, so extract the 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 `crates/webcodex-workflow-session/src/events.rs:1097` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/admin_project_lifecycle.rs:138 — src/admin_project_lifecycle.rs:138-149 | src/admin_project_lifecycle.rs:178-189 — both copies are in the same file, so extract the 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 `src/admin_project_lifecycle.rs:138` 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 first that the copies are not typed on the same thing: the declarations holding them bind `request` to `RegisterProjectRequest` in one and `CreateProjectRequest` 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 (12 lines × 2) src/mcp.rs:438 — src/mcp.rs:438-449 | src/tool_runtime/job_audit.rs:226-237 — 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 `src/mcp.rs:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/mcp_gateway.rs:225 — src/mcp_gateway.rs:225-236 | src/mcp_gateway.rs:320-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/tool_runtime/agent_task.rs:807 — src/tool_runtime/agent_task.rs:807-819 | src/tool_runtime/agent_task.rs:843-854 — both copies are in the same file, so extract the 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 `src/tool_runtime/agent_task.rs:807` 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) src/tool_runtime/checkpoint.rs:267 — src/tool_runtime/checkpoint.rs:267-278 | src/tool_runtime/checkpoint.rs:393-404 — both copies are in the same file, so extract the 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 `src/tool_runtime/checkpoint.rs:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/tool_runtime/files/mutations/preflight.rs:72 — src/tool_runtime/files/mutations/preflight.rs:72-83 | src/tool_runtime/helpers.rs:534-545 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/tool_runtime/goal.rs:1392 — src/tool_runtime/goal.rs:1392-1403 | src/tool_runtime/goal.rs:1470-1481 — both copies are in the same file, so extract the 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) src/tool_runtime/project_resolution.rs:583 — src/tool_runtime/project_resolution.rs:583-594 | src/tool_runtime/project_resolution.rs:613-624 — both copies are in the same file, so extract the 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 `src/tool_runtime/project_resolution.rs:583` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/tool_runtime/review_changes.rs:244 — src/tool_runtime/review_changes.rs:244-255 | src/tool_runtime/review_changes.rs:459-470 — both copies are in the same file, so extract the 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 `src/tool_runtime/review_changes.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/tool_runtime/skills.rs:2075 — src/tool_runtime/skills.rs:2075-2086 | src/tool_runtime/skills.rs:2200-2211 — both copies are in the same file, so extract the 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 `src/tool_runtime/skills.rs:2075` 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.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×40
  • Duplicated block (13 lines × 2) apps/desktop/src-tauri/src/webcodex/cli.rs:585 — apps/desktop/src-tauri/src/webcodex/cli.rs:585-597 | apps/desktop/src-tauri/src/webcodex/cli.rs:599-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:570 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:570-582 | crates/webcodex-cli/src/webcodex_cli/connect/process.rs:699-711 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/connect/process.rs:570` 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) crates/webcodex-cli/src/webcodex_cli/system.rs:492 — crates/webcodex-cli/src/webcodex_cli/system.rs:492-504 | crates/webcodex-cli/src/webcodex_cli/system.rs:534-546 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/system.rs:492` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/webcodex-core/src/apply_patch_shared.rs:361 — crates/webcodex-core/src/apply_patch_shared.rs:361-373 | crates/webcodex-core/src/apply_patch_shared.rs:417-429 — both copies are in the same file, so extract the 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 `crates/webcodex-core/src/apply_patch_shared.rs:361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) crates/webcodex-core/src/coding_agent.rs:1192 — crates/webcodex-core/src/coding_agent.rs:1192-1204 | crates/webcodex-core/src/plugin.rs:457-469 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-core/src/coding_agent.rs:1192` 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) crates/webcodex-core/src/runner_protocol/job.rs:422 — crates/webcodex-core/src/runner_protocol/job.rs:422-434 | crates/webcodex-core/src/runner_protocol/job.rs:766-778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-core/src/runner_protocol/job.rs:436` calls `Err` and `crates/webcodex-core/src/runner_protocol/job.rs:779` 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 (13 lines × 2) crates/webcodex-core/src/validation_identity.rs:379 — crates/webcodex-core/src/validation_identity.rs:379-391 | crates/webcodex-core/src/validation_identity.rs:406-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:146 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:146-158 | crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:548-560 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:146` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:375 — crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:375-387 | crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:443-456 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:375` 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) crates/webcodex-runner/src/webcodex_runner/patches.rs:1718 — crates/webcodex-runner/src/webcodex_runner/patches.rs:1718-1730 | crates/webcodex-runner/src/webcodex_runner/patches.rs:1749-1762 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/patches.rs:1749` 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) crates/webcodex-runner/src/webcodex_runner/plugin.rs:1404 — crates/webcodex-runner/src/webcodex_runner/plugin.rs:1404-1416 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1424-1436 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/plugin.rs:1404` 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, `crates/webcodex-runner/src/webcodex_runner/plugin.rs:1403` calls `store` and `crates/webcodex-runner/src/webcodex_runner/plugin.rs:1423` 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 (13 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:872 — crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:872-884 | crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:982-994 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/projects/lifecycle.rs:872` 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) crates/webcodex-store/src/communication.rs:1638 — crates/webcodex-store/src/communication.rs:1638-1650 | crates/webcodex-store/src/communication.rs:1675-1687 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/communication.rs:1638` 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) crates/webcodex-store/src/goal.rs:901 — crates/webcodex-store/src/goal.rs:901-913 | crates/webcodex-store/src/goal.rs:1004-1016 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/goal.rs:901` 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) crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:353 — crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:353-365 | crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:563-575 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:576` calls `schema_type` and `crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:366` 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 (13 lines × 2) src/cloudflare_host.rs:92 — src/cloudflare_host.rs:92-104 | src/cloudflare_ingress.rs:486-498 — 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 `src/cloudflare_host.rs:92` 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) src/oauth_http/managed_authorize.rs:1268 — src/oauth_http/managed_authorize.rs:1268-1280 | src/oauth_http/managed_authorize.rs:1385-1397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/project_entry_regular_tunnel.rs:341 — src/project_entry_regular_tunnel.rs:341-353 | src/project_entry_share.rs:1052-1064 — 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 `src/project_entry_regular_tunnel.rs:341` 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) src/tool_runtime/artifact_transfer.rs:560 — src/tool_runtime/artifact_transfer.rs:560-572 | src/tool_runtime/artifact_transfer.rs:923-935 — both copies are in the same file, so extract the 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 `src/tool_runtime/artifact_transfer.rs:560` 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) src/tool_runtime/coding_agent.rs:879 — src/tool_runtime/coding_agent.rs:879-891 | src/tool_runtime/coding_agent.rs:1026-1038 — both copies are in the same file, so extract the 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 `src/tool_runtime/coding_agent.rs:1026` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) src/tool_runtime/projects.rs:912 — src/tool_runtime/projects.rs:912-924 | src/tool_runtime/projects.rs:1011-1023 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/projects.rs:912` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:496 — REDACTED:496-508 | src/tool_runtime/search_project_texts.rs:116-128 — before extracting anything, compare `REDACTED` and `src/tool_runtime/search_project_texts.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:496` 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) src/tool_runtime/skills.rs:2045 — src/tool_runtime/skills.rs:2045-2057 | src/tool_runtime/skills.rs:2168-2180 — both copies are in the same file, so extract the 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 `src/tool_runtime/skills.rs:2045` 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) crates/webcodex-admin/src/commands.rs:214 — crates/webcodex-admin/src/commands.rs:214-226 | crates/webcodex-admin/src/commands.rs:322-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-admin/src/commands.rs:320` calls `value` and `crates/webcodex-admin/src/commands.rs:212` 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 (13 lines × 2) crates/webcodex-core/src/runner_skill.rs:444 — crates/webcodex-core/src/runner_skill.rs:444-456 | src/tool_runtime/skills.rs:2628-2640 — 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.
  • + 15 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded src/agent_wake.rs:304 — `std::thread::Builder::new().name("webcodex-agent-continuations".to_string()).spawn(move||{while let Ok(agent_id)=dispatch_rx.recv(){loop{worker_state.dispatch_one(&agent_id);let mut scheduled=worker_state.scheduled_agents.lock().expect("Agent continuation schedule mutex poisoned");let run_again=scheduled.get_mut(&agent_id).is_some_and(|dirty|{let run_again=*dirty;*dirty=false;run_again});if!run_again{scheduled.remove(&agent_id);break;}}}})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/client_window.rs:66 — `peer_id_from_window_key(&self.key)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `peer_id` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/client_window.rs:257 — `ClientWindow::from_opaque("http-cookie",&raw)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `api_window` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/model_surface.rs:178 — `canonical.get_mut("properties").and_then(Value::as_object_mut)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/model_surface.rs:181 — `properties.remove("follow_up_kind")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/model_surface.rs:184 — `properties.remove("tool")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/model_surface.rs:187 — `properties.remove("arguments")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_call_schema_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/model_surface.rs:316 — `schema.pointer("/properties/follow_up_kind/const").and_then(Value::as_str)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `project_suggested_tool_calls_in_value_node` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/runtime_console_http.rs:1331 — `lists.remove(&project.id)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `scan_runtime_home` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/runtime_http.rs:411 — `outcome.result` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `tools_call` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/ssh_resource_gateway.rs:467 — `auth` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `list` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/ssh_resource_gateway.rs:618 — `auth` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve_binding` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/upgrade_http.rs:95 — `crate::runner_http::runner_access_from_auth(Some(&auth))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `maintenance` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/browser_tools.rs:389 — `serde_json::to_value(&operation)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_browser_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/browser_tools.rs:406 — `payload.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_browser_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/cargo.rs:121 — `validation_adapter_for_tool("cargo_fmt")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cargo_fmt_with_context_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/cargo.rs:127 — `adapter.build_command(ValidationCommandOptions{check:true,..ValidationCommandOptions::default()})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cargo_fmt_with_context_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/cargo.rs:230 — `adapter.build_command(ValidationCommandOptions{check:false,..ValidationCommandOptions::default()})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cargo_fmt_with_context_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/cargo_tools.rs:198 — `result.output.as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_cargo_tool` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/changes.rs:1015 — `std::str::from_utf8(&raw[..error.valid_up_to()])` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `frozen_changes_file_content` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/closeout_evidence.rs:193 — `serde_json::to_value(self)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `to_value` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/closeout_projection.rs:101 — `projected.as_object()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `install_closeout_decision` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/control_sidecar.rs:301 — `schema["properties"].as_object_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `phase_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/control_sidecar.rs:305 — `schema["required"].as_array_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `phase_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded src/tool_runtime/control_sidecar.rs:306 — `field.as_str()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `phase_schema` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×39
  • Duplicated block (14 lines × 2) apps/desktop/src-tauri/src/webcodex/adapter.rs:451 — apps/desktop/src-tauri/src/webcodex/adapter.rs:451-464 | apps/desktop/src-tauri/src/webcodex/adapter.rs:511-524 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/webcodex/adapter.rs:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) apps/desktop/src-tauri/src/webcodex/cli.rs:761 — apps/desktop/src-tauri/src/webcodex/cli.rs:761-774 | apps/desktop/src-tauri/src/webcodex/cli.rs:785-798 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/webcodex/cli.rs:761` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `task` to `&mut Option<JoinHandle<std::io::Result<()>>>` in one and `&mut Option<JoinHandle<Vec<u8>>>` 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 (14 lines × 2) crates/webcodex-cli/src/webcodex_cli/project.rs:237 — crates/webcodex-cli/src/webcodex_cli/project.rs:237-250 | crates/webcodex-cli/src/webcodex_cli/project.rs:324-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.
  • Duplicated block (14 lines × 2) crates/webcodex-core/src/coding_agent.rs:756 — crates/webcodex-core/src/coding_agent.rs:756-769 | crates/webcodex-runner/src/webcodex_runner/coding_agent/protocol.rs:447-460 — 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 `crates/webcodex-core/src/coding_agent.rs:756` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/webcodex-runner-registry/src/requests.rs:2955 — crates/webcodex-runner-registry/src/requests.rs:2955-2968 | crates/webcodex-runner-registry/src/requests.rs:3105-3118 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:2955` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/webcodex-runner/src/main.rs:117 — crates/webcodex-runner/src/main.rs:117-130 | crates/webcodex-runner/src/main.rs:145-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:332 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:332-345 | crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:561-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:331` calls `read_ooxml_content_types_entry` and `crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:560` 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 (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:56 — crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:56-69 | src/tool_runtime/files/artifacts.rs:198-211 — 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 (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:133 — crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:133-146 | crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:158-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 (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:286 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:286-299 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:300-313 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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 (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/dispatch.rs:189 — crates/webcodex-runner/src/webcodex_runner/dispatch.rs:189-202 | crates/webcodex-runner/src/webcodex_runner/job_manager/admission.rs:303-316 — 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 `crates/webcodex-runner/src/webcodex_runner/dispatch.rs:189` 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 (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:68 — crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:68-81 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:70-83 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs` and `crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs: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.
  • Duplicated block (14 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:227 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:227-240 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:384-397 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/shell/process.rs` and `crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 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 `crates/webcodex-runner/src/webcodex_runner/shell/process.rs:227` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/webcodex-store/src/agent_wake.rs:2117 — crates/webcodex-store/src/agent_wake.rs:2117-2130 | crates/webcodex-store/src/agent_wake.rs:2649-2662 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/agent_wake.rs:2117` 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) crates/webcodex-store/src/goal.rs:383 — crates/webcodex-store/src/goal.rs:383-396 | crates/webcodex-store/src/goal.rs:502-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/goal.rs:383` 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 (14 lines × 2) crates/webcodex-store/src/goal.rs:962 — crates/webcodex-store/src/goal.rs:962-975 | crates/webcodex-store/src/goal.rs:1072-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/goal.rs:962` 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 (14 lines × 2) crates/webcodex-store/src/memory.rs:954 — crates/webcodex-store/src/memory.rs:954-967 | crates/webcodex-store/src/memory.rs:1217-1230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/webcodex-workflow-session/src/handoff_brief.rs:724 — crates/webcodex-workflow-session/src/handoff_brief.rs:724-737 | crates/webcodex-workflow-session/src/handoff_brief.rs:762-775 — both copies are in the same file, so extract the 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 `crates/webcodex-workflow-session/src/handoff_brief.rs:724` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/oauth_http/metadata.rs:27 — src/oauth_http/metadata.rs:27-40 | src/oauth_http/metadata.rs:68-81 — both copies are in the same file, so extract the 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 `src/oauth_http/metadata.rs:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) src/tool_request_trace/writer.rs:123 — src/tool_request_trace/writer.rs:123-136 | src/tool_request_trace/writer.rs:165-178 — both copies are in the same file, so extract the 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 `src/tool_request_trace/writer.rs:123` 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 (14 lines × 2) src/tool_runtime/changes.rs:982 — src/tool_runtime/changes.rs:982-995 | src/tool_runtime/changes.rs:1115-1128 — both copies are in the same file, so extract the 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 `src/tool_runtime/changes.rs:982` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/tool_runtime/files/artifacts.rs:967 — src/tool_runtime/files/artifacts.rs:967-980 | src/tool_runtime/files/artifacts.rs:993-1006 — both copies are in the same file, so extract the 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 `src/tool_runtime/files/artifacts.rs:967` 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) src/tool_runtime/kernel/recording.rs:189 — src/tool_runtime/kernel/recording.rs:189-202 | src/tool_runtime/kernel/recording.rs:303-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/kernel/recording.rs:189` 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 (14 lines × 2) src/tool_runtime/observe_jobs.rs:417 — src/tool_runtime/observe_jobs.rs:417-430 | src/tool_runtime/observe_jobs.rs:581-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/tool_runtime/runner_instructions.rs:23 — src/tool_runtime/runner_instructions.rs:23-36 | src/tool_runtime/runner_instructions.rs:45-58 — both copies are in the same file, so extract the 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 `src/tool_runtime/runner_instructions.rs:23` 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.
  • + 14 more in this group — see findings.md.
D2 · Cognitive Complexity · webcodex_environment · ×38
  • webcodex_environment::migration::migrate_legacy_environment (cognitive 62) crates/webcodex-environment/src/migration.rs:171 — webcodex_environment::migration::migrate_legacy_environment has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (48 pts), boolean chains 7, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::unified_update::source::verify_source_manifest_for_flavor (cognitive 56) crates/webcodex-environment/src/unified_update/source.rs:100 — webcodex_environment::unified_update::source::verify_source_manifest_for_flavor has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 16, loops 3 (5 pts), match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::upgrade::verify_upgrade_candidate (cognitive 41) crates/webcodex-environment/src/upgrade.rs:1078 — webcodex_environment::upgrade::verify_upgrade_candidate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 12, loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::inventory::inspect_environment_paths (cognitive 40) crates/webcodex-environment/src/inventory.rs:153 — webcodex_environment::inventory::inspect_environment_paths has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (31 pts), loops 4 (5 pts), match/switch 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.
  • webcodex_environment::tunnel_recovery::recover (cognitive 40) crates/webcodex-environment/src/tunnel_recovery.rs:113 — webcodex_environment::tunnel_recovery::recover has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::upgrade::desktop_tree::digest_named (cognitive 38) crates/webcodex-environment/src/upgrade/desktop_tree.rs:75 — webcodex_environment::upgrade::desktop_tree::digest_named has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::upgrade::parse_desktop_payload (cognitive 37) crates/webcodex-environment/src/upgrade.rs:926 — webcodex_environment::upgrade::parse_desktop_payload has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::upgrade::restore_programs_from_journal (cognitive 35) crates/webcodex-environment/src/upgrade.rs:2573 — webcodex_environment::upgrade::restore_programs_from_journal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 8, 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.
  • webcodex_environment::service::linux::install (cognitive 28) crates/webcodex-environment/src/service/linux.rs:391 — webcodex_environment::service::linux::install has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (26 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.
  • webcodex_environment::unified_update::installer::apply_verified_installer (cognitive 28) crates/webcodex-environment/src/unified_update/installer.rs:401 — webcodex_environment::unified_update::installer::apply_verified_installer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 5, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • webcodex_environment::upgrade::freeze_installer_upgrade (cognitive 28) crates/webcodex-environment/src/upgrade.rs:544 — webcodex_environment::upgrade::freeze_installer_upgrade has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::migration::inspect_import (cognitive 27) crates/webcodex-environment/src/migration.rs:767 — webcodex_environment::migration::inspect_import has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 1 (3 pts), 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.
  • webcodex_environment::native::service_spec (cognitive 24) crates/webcodex-environment/src/native.rs:2114 — webcodex_environment::native::service_spec has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, match/switch 4 (6 pts), boolean chains 4 (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.
  • webcodex_environment::service::windows::validate_credential (cognitive 24) crates/webcodex-environment/src/service/windows.rs:1202 — webcodex_environment::service::windows::validate_credential has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 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.
  • webcodex_environment::upgrade::native_executable_architecture (cognitive 24) crates/webcodex-environment/src/upgrade.rs:2913 — webcodex_environment::upgrade::native_executable_architecture has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (6 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.
  • webcodex_environment::cloudflare_tunnel::complete_cloudflare_profile_cleanup (cognitive 23) crates/webcodex-environment/src/cloudflare_tunnel.rs:228 — webcodex_environment::cloudflare_tunnel::complete_cloudflare_profile_cleanup has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::upgrade::desktop_tree::copy (cognitive 23) crates/webcodex-environment/src/upgrade/desktop_tree.rs:210 — webcodex_environment::upgrade::desktop_tree::copy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::installer_unix::finish_authorized_installation (cognitive 22) crates/webcodex-environment/src/installer_unix.rs:481 — webcodex_environment::installer_unix::finish_authorized_installation 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.
  • webcodex_environment::service::validate_spec (cognitive 21) crates/webcodex-environment/src/service/mod.rs:479 — webcodex_environment::service::validate_spec has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (9 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.
  • webcodex_environment::local_status::collect (cognitive 20) crates/webcodex-environment/src/local_status.rs:35 — webcodex_environment::local_status::collect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 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.
  • webcodex_environment::service::windows::grant_access_paths (cognitive 20) crates/webcodex-environment/src/service/windows.rs:240 — webcodex_environment::service::windows::grant_access_paths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 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.
  • webcodex_environment::inventory::entries::role_entries (cognitive 19) crates/webcodex-environment/src/inventory/entries.rs:3 — webcodex_environment::inventory::entries::role_entries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_environment::inventory::paths::local_path_entry (cognitive 19) crates/webcodex-environment/src/inventory/paths.rs:20 — webcodex_environment::inventory::paths::local_path_entry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webcodex_environment::migration::copy_data_tree (cognitive 19) crates/webcodex-environment/src/migration.rs:1046 — webcodex_environment::migration::copy_data_tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 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.
  • webcodex_environment::native::validate_request_with_preserved_listen (cognitive 19) crates/webcodex-environment/src/native.rs:1998 — webcodex_environment::native::validate_request_with_preserved_listen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7 (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.
  • + 13 more in this group — see findings.md.
D2 · Cognitive Complexity · webcodex_core · ×35
  • webcodex_core::apply_patch_shared::parse_codex_patch (cognitive 102) crates/webcodex-core/src/apply_patch_shared.rs:320 — webcodex_core::apply_patch_shared::parse_codex_patch has cognitive complexity 102 (threshold 15). Drivers by points: if/else 26 (78 pts), boolean chains 10, loops 5 (10 pts), match/switch 1 (4 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_core::plugin::preflight_plugin_schema_node (cognitive 68) crates/webcodex-core/src/plugin.rs:667 — webcodex_core::plugin::preflight_plugin_schema_node has cognitive complexity 68 (threshold 15). Drivers by points: if/else 25 (51 pts), loops 4 (8 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 31). 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.
  • webcodex_core::runner_operation::decode_operation (cognitive 56) crates/webcodex-core/src/runner_operation.rs:1351 — webcodex_core::runner_operation::decode_operation has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 17, match/switch 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.
  • webcodex_core::project_build::canonical_project_build_process_with_manager (cognitive 46) crates/webcodex-core/src/project_build.rs:266 — webcodex_core::project_build::canonical_project_build_process_with_manager has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 3 (9 pts), boolean chains 4, match/switch 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.
  • webcodex_core::coding_agent::validate_coding_agent_run_snapshot (cognitive 44) crates/webcodex-core/src/coding_agent.rs:846 — webcodex_core::coding_agent::validate_coding_agent_run_snapshot has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 11, match/switch 3 (5 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.
  • webcodex_core::runner_operation::decode_job_operation (cognitive 43) crates/webcodex-core/src/runner_operation.rs:1798 — webcodex_core::runner_operation::decode_job_operation has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 7, 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.
  • webcodex_core::runner_protocol::job::is_canonical_cargo_flags (cognitive 43) crates/webcodex-core/src/runner_protocol/job.rs:661 — webcodex_core::runner_protocol::job::is_canonical_cargo_flags has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 3 (8 pts), boolean chains 6, 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.
  • webcodex_core::plugin::diagnose_invalid_tools (cognitive 42) crates/webcodex-core/src/plugin.rs:1071 — webcodex_core::plugin::diagnose_invalid_tools has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 19). Of this number, 30 points are the body's own statements and 12 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.
  • webcodex_core::plugin::plugin_schema_matches (cognitive 41) crates/webcodex-core/src/plugin.rs:918 — webcodex_core::plugin::plugin_schema_matches has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 3, loops 1 (2 pts), match/switch 2 (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.
  • webcodex_core::validation_identity::structured_validation_target_identity (cognitive 39) crates/webcodex-core/src/validation_identity.rs:112 — webcodex_core::validation_identity::structured_validation_target_identity has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 6, match/switch 3 (4 pts) (nesting depth added 14). 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.
  • webcodex_core::coding_agent::validate_response_for_request (cognitive 37) crates/webcodex-core/src/coding_agent.rs:630 — webcodex_core::coding_agent::validate_response_for_request has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 5, loops 2 (4 pts), match/switch 2 (3 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.
  • webcodex_core::audit_preview::process_preview (cognitive 35) crates/webcodex-core/src/audit_preview.rs:22 — webcodex_core::audit_preview::process_preview has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_core::mcp_gateway::validate_tool_result (cognitive 33) crates/webcodex-core/src/mcp_gateway.rs:517 — webcodex_core::mcp_gateway::validate_tool_result has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_core::coding_agent::validate_request (cognitive 31) crates/webcodex-core/src/coding_agent.rs:559 — webcodex_core::coding_agent::validate_request has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • webcodex_core::apply_patch_shared::derive_codex_patch_update_with_matching_mode (cognitive 30) crates/webcodex-core/src/apply_patch_shared.rs:799 — webcodex_core::apply_patch_shared::derive_codex_patch_update_with_matching_mode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 2, loops 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.
  • webcodex_core::coding_agent::validate_live_acp_diagnostic (cognitive 30) crates/webcodex-core/src/coding_agent.rs:780 — webcodex_core::coding_agent::validate_live_acp_diagnostic has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 7, loops 2 (4 pts), 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.
  • webcodex_core::project_listing::glob_match_segment (cognitive 30) crates/webcodex-core/src/project_listing.rs:116 — webcodex_core::project_listing::glob_match_segment has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 12, loops 5 (11 pts), if/else 5 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_core::validation_evidence::parse_go_test_diagnostics (cognitive 29) crates/webcodex-core/src/validation_evidence.rs:445 — webcodex_core::validation_evidence::parse_go_test_diagnostics has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 3 (6 pts), loops 2, 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.
  • webcodex_core::plugin::validate_check_report (cognitive 28) crates/webcodex-core/src/plugin.rs:1358 — webcodex_core::plugin::validate_check_report has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 8, 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.
  • webcodex_core::apply_patch_shared::seek_sequence (cognitive 25) crates/webcodex-core/src/apply_patch_shared.rs:624 — webcodex_core::apply_patch_shared::seek_sequence has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 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.
  • webcodex_core::job_observation::project_log_stream (cognitive 25) crates/webcodex-core/src/job_observation.rs:297 — webcodex_core::job_observation::project_log_stream has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 9, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webcodex_core::runner_protocol::job::normalize_go_package (cognitive 25) crates/webcodex-core/src/runner_protocol/job.rs:526 — webcodex_core::runner_protocol::job::normalize_go_package has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 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.
  • webcodex_core::runner_protocol::validate_script_request (cognitive 22) crates/webcodex-core/src/runner_protocol.rs:2174 — webcodex_core::runner_protocol::validate_script_request has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_core::mcp_gateway::validate_tools_with_description_limit (cognitive 21) crates/webcodex-core/src/mcp_gateway.rs:438 — webcodex_core::mcp_gateway::validate_tools_with_description_limit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 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.
  • webcodex_core::validation_evidence::strip_ansi (cognitive 21) crates/webcodex-core/src/validation_evidence.rs:1056 — webcodex_core::validation_evidence::strip_ansi has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), boolean chains 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.
  • + 10 more in this group — see findings.md.
D1 · Cyclomatic Complexity · webcodex_cli · ×30
  • webcodex_cli::environment::run_inner (cyclomatic 120) crates/webcodex-cli/src/environment.rs:314 — webcodex_cli::environment::run_inner has cyclomatic complexity 120 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_cli::environment::parse (cyclomatic 95) crates/webcodex-cli/src/environment.rs:57 — webcodex_cli::environment::parse has cyclomatic complexity 95 (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.
  • webcodex_cli::run (cyclomatic 83) crates/webcodex-cli/src/lib.rs:2749 — webcodex_cli::run has cyclomatic complexity 83 (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.
  • webcodex_cli::parse_connect (cyclomatic 62) crates/webcodex-cli/src/lib.rs:474 — webcodex_cli::parse_connect has cyclomatic complexity 62 (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.
  • webcodex_cli::parse_runner_install_service_with_identity (cyclomatic 38) crates/webcodex-cli/src/lib.rs:2164 — webcodex_cli::parse_runner_install_service_with_identity has cyclomatic complexity 38 (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.
  • webcodex_cli::webcodex_cli::connect::oauth::run_oauth_connect (cyclomatic 37) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:521 — webcodex_cli::webcodex_cli::connect::oauth::run_oauth_connect 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.
  • webcodex_cli::parse_login (cyclomatic 36) crates/webcodex-cli/src/lib.rs:912 — webcodex_cli::parse_login has cyclomatic complexity 36 (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.
  • webcodex_cli::webcodex_cli::controller::run_controller_command (cyclomatic 36) crates/webcodex-cli/src/webcodex_cli/controller.rs:1959 — webcodex_cli::webcodex_cli::controller::run_controller_command 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.
  • webcodex_cli::cli_action (cyclomatic 35) crates/webcodex-cli/src/lib.rs:379 — webcodex_cli::cli_action has cyclomatic complexity 35 (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.
  • webcodex_cli::webcodex_cli::project::run_project_activate (cyclomatic 29) crates/webcodex-cli/src/webcodex_cli/project.rs:635 — webcodex_cli::webcodex_cli::project::run_project_activate 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.
  • webcodex_cli::webcodex_cli::controller::parse_controller_command (cyclomatic 28) crates/webcodex-cli/src/webcodex_cli/controller.rs:1821 — webcodex_cli::webcodex_cli::controller::parse_controller_command has cyclomatic complexity 28 (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.
  • webcodex_cli::parse_project_subcommand (cyclomatic 26) crates/webcodex-cli/src/lib.rs:758 — webcodex_cli::parse_project_subcommand 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.
  • webcodex_cli::environment::cloudflare::validate_input (cyclomatic 26) crates/webcodex-cli/src/environment/cloudflare.rs:10 — webcodex_cli::environment::cloudflare::validate_input has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • webcodex_cli::webcodex_cli::controller::validate_config (cyclomatic 26) crates/webcodex-cli/src/webcodex_cli/controller.rs:612 — webcodex_cli::webcodex_cli::controller::validate_config 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.
  • webcodex_cli::parse_cli_runner_init (cyclomatic 25) crates/webcodex-cli/src/lib.rs:2622 — webcodex_cli::parse_cli_runner_init has cyclomatic complexity 25 (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.
  • webcodex_cli::parse_runner_status_with_identity (cyclomatic 24) crates/webcodex-cli/src/lib.rs:2320 — webcodex_cli::parse_runner_status_with_identity 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.
  • webcodex_cli::parse_server_install_service (cyclomatic 24) crates/webcodex-cli/src/lib.rs:2418 — webcodex_cli::parse_server_install_service has cyclomatic complexity 24 (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.
  • webcodex_cli::environment::update::run_at (cyclomatic 23) crates/webcodex-cli/src/environment/update.rs:275 — webcodex_cli::environment::update::run_at has cyclomatic complexity 23 (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.
  • webcodex_cli::webcodex_cli::mcp_config::render (cyclomatic 22) crates/webcodex-cli/src/webcodex_cli/mcp_config.rs:6 — webcodex_cli::webcodex_cli::mcp_config::render has cyclomatic complexity 22 (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.
  • webcodex_cli::webcodex_cli::controller_tui::run (cyclomatic 21) crates/webcodex-cli/src/webcodex_cli/controller_tui.rs:744 — webcodex_cli::webcodex_cli::controller_tui::run 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.
  • webcodex_cli::webcodex_cli::runner_service::render_runner_readiness_summary (cyclomatic 20) crates/webcodex-cli/src/webcodex_cli/runner_service.rs:350 — webcodex_cli::webcodex_cli::runner_service::render_runner_readiness_summary has cyclomatic complexity 20 (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.
  • webcodex_cli::environment::update::parse (cyclomatic 19) crates/webcodex-cli/src/environment/update.rs:44 — webcodex_cli::environment::update::parse has cyclomatic complexity 19 (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.
  • webcodex_cli::webcodex_cli::connect::shared_key_oauth::finish_shared_key_oauth_connect (cyclomatic 19) crates/webcodex-cli/src/webcodex_cli/connect/shared_key_oauth.rs:506 — webcodex_cli::webcodex_cli::connect::shared_key_oauth::finish_shared_key_oauth_connect 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.
  • webcodex_cli::webcodex_cli::runner_service::run_runner_status (cyclomatic 19) crates/webcodex-cli/src/webcodex_cli/runner_service.rs:456 — webcodex_cli::webcodex_cli::runner_service::run_runner_status 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.
  • webcodex_cli::webcodex_cli::ops::run_ops_command (cyclomatic 18) crates/webcodex-cli/src/webcodex_cli/ops.rs:131 — webcodex_cli::webcodex_cli::ops::run_ops_command has cyclomatic complexity 18 (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.
  • + 5 more in this group — see findings.md.
D1 · Cyclomatic Complexity · webcodex_core · ×29
  • webcodex_core::runner_operation::decode_operation (cyclomatic 61) crates/webcodex-core/src/runner_operation.rs:1351 — webcodex_core::runner_operation::decode_operation has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_core::apply_patch_shared::parse_codex_patch (cyclomatic 45) crates/webcodex-core/src/apply_patch_shared.rs:320 — webcodex_core::apply_patch_shared::parse_codex_patch 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.
  • webcodex_core::plugin::preflight_plugin_schema_node (cyclomatic 38) crates/webcodex-core/src/plugin.rs:667 — webcodex_core::plugin::preflight_plugin_schema_node has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_core::coding_agent::validate_coding_agent_run_snapshot (cyclomatic 35) crates/webcodex-core/src/coding_agent.rs:846 — webcodex_core::coding_agent::validate_coding_agent_run_snapshot 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.
  • webcodex_core::runner_operation::decode_job_operation (cyclomatic 33) crates/webcodex-core/src/runner_operation.rs:1798 — webcodex_core::runner_operation::decode_job_operation 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.
  • webcodex_core::plugin::plugin_schema_matches (cyclomatic 32) crates/webcodex-core/src/plugin.rs:918 — webcodex_core::plugin::plugin_schema_matches 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.
  • webcodex_core::runner_operation::encode_operation (cyclomatic 32) crates/webcodex-core/src/runner_operation.rs:972 — webcodex_core::runner_operation::encode_operation has cyclomatic complexity 32 (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. This is NOT this file's highest cyclomatic complexity: RunnerOperation::wire_kind (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • webcodex_core::validation_identity::structured_validation_target_identity (cyclomatic 32) crates/webcodex-core/src/validation_identity.rs:112 — webcodex_core::validation_identity::structured_validation_target_identity 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.
  • webcodex_core::project_build::canonical_project_build_process_with_manager (cyclomatic 30) crates/webcodex-core/src/project_build.rs:266 — webcodex_core::project_build::canonical_project_build_process_with_manager 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.
  • webcodex_core::runner_protocol::job::is_canonical_cargo_flags (cyclomatic 25) crates/webcodex-core/src/runner_protocol/job.rs:661 — webcodex_core::runner_protocol::job::is_canonical_cargo_flags 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.
  • webcodex_core::coding_agent::validate_response_for_request (cyclomatic 24) crates/webcodex-core/src/coding_agent.rs:630 — webcodex_core::coding_agent::validate_response_for_request 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.
  • webcodex_core::runner_operation::encode_job_operation (cyclomatic 24) crates/webcodex-core/src/runner_operation.rs:1184 — webcodex_core::runner_operation::encode_job_operation has cyclomatic complexity 24 (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. This is NOT this file's highest cyclomatic complexity: RunnerOperation::wire_kind (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • webcodex_core::plugin::diagnose_invalid_tools (cyclomatic 23) crates/webcodex-core/src/plugin.rs:1071 — webcodex_core::plugin::diagnose_invalid_tools has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 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.
  • webcodex_core::coding_agent::validate_request (cyclomatic 22) crates/webcodex-core/src/coding_agent.rs:559 — webcodex_core::coding_agent::validate_request 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.
  • webcodex_core::plugin::validate_check_report (cyclomatic 22) crates/webcodex-core/src/plugin.rs:1358 — webcodex_core::plugin::validate_check_report 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.
  • webcodex_core::project_listing::glob_match_segment (cyclomatic 22) crates/webcodex-core/src/project_listing.rs:116 — webcodex_core::project_listing::glob_match_segment has cyclomatic complexity 22 (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.
  • webcodex_core::audit_preview::process_preview (cyclomatic 21) crates/webcodex-core/src/audit_preview.rs:22 — webcodex_core::audit_preview::process_preview 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.
  • webcodex_core::mcp_gateway::validate_tool_result (cyclomatic 21) crates/webcodex-core/src/mcp_gateway.rs:517 — webcodex_core::mcp_gateway::validate_tool_result 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.
  • webcodex_core::validation_evidence::parse_go_test_diagnostics (cyclomatic 20) crates/webcodex-core/src/validation_evidence.rs:445 — webcodex_core::validation_evidence::parse_go_test_diagnostics 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.
  • webcodex_core::coding_agent::validate_live_acp_diagnostic (cyclomatic 19) crates/webcodex-core/src/coding_agent.rs:780 — webcodex_core::coding_agent::validate_live_acp_diagnostic 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.
  • webcodex_core::runner_protocol::job::normalize_go_package (cyclomatic 19) crates/webcodex-core/src/runner_protocol/job.rs:526 — webcodex_core::runner_protocol::job::normalize_go_package 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.
  • webcodex_core::validation_evidence::pytest_summary_line (cyclomatic 19) crates/webcodex-core/src/validation_evidence.rs:156 — webcodex_core::validation_evidence::pytest_summary_line has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • webcodex_core::job_observation::project_log_stream (cyclomatic 18) crates/webcodex-core/src/job_observation.rs:297 — webcodex_core::job_observation::project_log_stream 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.
  • webcodex_core::runner_operation::validate_file_payload (cyclomatic 18) crates/webcodex-core/src/runner_operation.rs:2225 — webcodex_core::runner_operation::validate_file_payload 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. This is NOT this file's highest cyclomatic complexity: RunnerOperation::wire_kind (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • webcodex_core::runner_protocol::validate_script_request (cyclomatic 17) crates/webcodex-core/src/runner_protocol.rs:2174 — webcodex_core::runner_protocol::validate_script_request 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×27
  • Edited copy of a member (7 corresponding lines) crates/webcodex-environment/src/process/unix.rs:48 — crates/webcodex-environment/src/process/unix.rs:48-54 | crates/webcodex-persistent-shell/src/unix/readers.rs:6-19 — 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) src/tool_runtime/git/show_changes.rs:1220 — src/tool_runtime/git/show_changes.rs:1220-1226 | src/tool_runtime/git/show_changes.rs:1232-1246 — 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) crates/webcodex-runner-config/src/paths.rs:33 — crates/webcodex-runner-config/src/paths.rs:33-39 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:156-162 — 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) src/tool_runtime/runtime.rs:21 — src/tool_runtime/runtime.rs:21-27 | src/tool_runtime/coding_agent.rs:2015-2021 — 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) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:100 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:100-106 | crates/webcodex-runner/src/webcodex_runner/patches.rs:141-147 — 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) crates/webcodex-workflow-session/src/events.rs:216 — crates/webcodex-workflow-session/src/events.rs:216-226 | src/tool_runtime/job_audit.rs:63-69 — 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) src/tool_runtime/search_and_read.rs:144 — src/tool_runtime/search_and_read.rs:144-159 | src/tool_runtime/search_project_texts.rs:829-835 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) REDACTED:1119 — REDACTED:1119-1126 | src/admin_project_lifecycle.rs:940-946 — 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) src/runtime_console_http.rs:930 — src/runtime_console_http.rs:930-938 | src/tool_runtime/work_result.rs:1416-1422 — 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) crates/webcodex-core/src/runner_skill.rs:466 — crates/webcodex-core/src/runner_skill.rs:466-472 | src/tool_runtime/files/search.rs:1113-1121 — 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) crates/webcodex-cli/src/environment/cloudflare.rs:355 — crates/webcodex-cli/src/environment/cloudflare.rs:355-361 | crates/webcodex-environment/src/native.rs:2242-2254 — 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) crates/webcodex-core/src/desktop_runtime_contract.rs:97 — crates/webcodex-core/src/desktop_runtime_contract.rs:97-103 | crates/webcodex-environment/src/unified_update/cache.rs:36-44 — 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) crates/webcodex-workflow-session/src/persistence.rs:620 — crates/webcodex-workflow-session/src/persistence.rs:620-626 | src/tool_runtime/files/mutations/patch_result.rs:8-16 — 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) crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:222 — crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:222-228 | crates/webcodex-workflow-session/src/events.rs:66-72 — 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) crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:359 — crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:359-365 | crates/webcodex-runner/src/webcodex_runner/validation/pyright.rs:404-411 — 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) crates/webcodex-core/src/validation_evidence.rs:1029 — crates/webcodex-core/src/validation_evidence.rs:1029-1036 | src/runtime_console_http.rs:916-922 — 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) crates/webcodex-store/src/agent_task/invariants.rs:322 — crates/webcodex-store/src/agent_task/invariants.rs:322-328 | crates/webcodex-store/src/goal.rs:1303-1310 — 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) crates/webcodex-computer/src/lib.rs:287 — crates/webcodex-computer/src/lib.rs:287-293 | src/tool_runtime/computer_tools/inputs.rs:66-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) crates/webcodex-environment/src/native.rs:1806 — crates/webcodex-environment/src/native.rs:1806-1817 | crates/webcodex-environment/src/upgrade.rs:919-925 — 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) crates/webcodex-core/src/mcp_gateway.rs:164 — crates/webcodex-core/src/mcp_gateway.rs:164-170 | crates/webcodex-core/src/plugin.rs:151-158 — 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) src/oauth_http/managed_authorize.rs:18 — src/oauth_http/managed_authorize.rs:18-24 | src/oauth_http/responses.rs:23-30 — 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) crates/webcodex-cli/src/lib.rs:85 — crates/webcodex-cli/src/lib.rs:85-91 | crates/webcodex-environment/src/service/scope.rs:36-42 — 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) crates/webcodex-core/src/validation_bridge.rs:294 — crates/webcodex-core/src/validation_bridge.rs:294-300 | crates/webcodex-workflow-session/src/console.rs:1068-1075 — 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) crates/webcodex-environment/src/native.rs:2260 — crates/webcodex-environment/src/native.rs:2260-2266 | src/pairing_http.rs:101-107 — 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) scripts/e2e_project_share_roots.py:54 — scripts/e2e_project_share_roots.py:54-60 | scripts/e2e_share_oauth_restart.py:57-63 — 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×26
  • Duplicated block (15 lines × 2) apps/desktop/src-tauri/src/mcp_providers.rs:475 — apps/desktop/src-tauri/src/mcp_providers.rs:475-489 | crates/webcodex-process/src/program.rs:235-249 — 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 `apps/desktop/src-tauri/src/mcp_providers.rs:475` 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 (15 lines × 2) apps/desktop/src-tauri/src/tunnel_config.rs:119 — apps/desktop/src-tauri/src/tunnel_config.rs:119-133 | apps/desktop/src-tauri/src/tunnel_config.rs:542-556 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/tunnel_config.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-cli/src/webcodex_cli/profiles.rs:123 — crates/webcodex-cli/src/webcodex_cli/profiles.rs:123-137 | crates/webcodex-runner/src/webcodex_runner/config.rs:1306-1320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) crates/webcodex-cli/src/webcodex_cli/system.rs:414 — crates/webcodex-cli/src/webcodex_cli/system.rs:414-428 | crates/webcodex-cli/src/webcodex_cli/system.rs:456-470 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/system.rs:414` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-environment/src/upgrade.rs:2121 — crates/webcodex-environment/src/upgrade.rs:2121-2135 | crates/webcodex-environment/src/upgrade.rs:2313-2327 — both copies are in the same file, so extract the 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 `crates/webcodex-environment/src/upgrade.rs:2121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-runner-registry/src/requests.rs:999 — crates/webcodex-runner-registry/src/requests.rs:999-1013 | crates/webcodex-runner-registry/src/requests.rs:1137-1151 — both copies are in the same file, so extract the 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 (15 lines × 2) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:370 — crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:370-384 | crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:390-404 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) crates/webcodex-runner/src/webcodex_runner/patches.rs:2215 — crates/webcodex-runner/src/webcodex_runner/patches.rs:2215-2229 | crates/webcodex-runner/src/webcodex_runner/patches.rs:2262-2276 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/patches.rs:2215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:225 — crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:225-239 | crates/webcodex-runner/src/webcodex_runner/transport/websocket.rs:97-111 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/transport/quic.rs` and `crates/webcodex-runner/src/webcodex_runner/transport/websocket.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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) crates/webcodex-store/src/artifact_handoff.rs:738 — crates/webcodex-store/src/artifact_handoff.rs:738-752 | crates/webcodex-store/src/artifact_handoff.rs:794-808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:700 — crates/webcodex-tool-contracts/src/tool_call/parsing.rs:700-714 | crates/webcodex-tool-contracts/src/tool_call/parsing.rs:864-878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:486 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:486-500 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:699-713 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:486` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-workflow-session/src/events.rs:1125 — crates/webcodex-workflow-session/src/events.rs:1125-1139 | crates/webcodex-workflow-session/src/events.rs:1265-1279 — both copies are in the same file, so extract the 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 `crates/webcodex-workflow-session/src/events.rs:1125` 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 (15 lines × 2) src/tool_runtime/communication.rs:1347 — src/tool_runtime/communication.rs:1347-1361 | src/tool_runtime/communication.rs:1378-1392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `ListConversationsInput` in one and `ReadConversationInput` 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 (15 lines × 2) src/tool_runtime/docx_document.rs:114 — src/tool_runtime/docx_document.rs:114-128 | src/tool_runtime/pdf_document.rs:184-198 — before extracting anything, compare `src/tool_runtime/docx_document.rs` and `src/tool_runtime/pdf_document.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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) src/tool_runtime/session_shell.rs:642 — src/tool_runtime/session_shell.rs:642-656 | src/tool_runtime/session_shell.rs:704-718 — both copies are in the same file, so extract the 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 `src/tool_runtime/session_shell.rs:642` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/tool_runtime/work_result.rs:746 — src/tool_runtime/work_result.rs:746-760 | src/tool_runtime/work_result.rs:844-858 — both copies are in the same file, so extract the 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 `src/tool_runtime/work_result.rs:746` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-validation/src/adapters/go.rs:86 — crates/webcodex-validation/src/adapters/go.rs:86-100 | crates/webcodex-validation/src/adapters/go.rs:166-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-validation/src/adapters/go.rs:165` calls `is_some` and `crates/webcodex-validation/src/adapters/go.rs:85` 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 (15 lines × 2) crates/webcodex-store/src/window_activity.rs:77 — crates/webcodex-store/src/window_activity.rs:77-91 | crates/webcodex-store/src/window_activity.rs:385-399 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/window_activity.rs: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-store/src/window_activity.rs:383` calls `fetch_add` and `crates/webcodex-store/src/window_activity.rs: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 (15 lines × 2) crates/webcodex-runner-registry/src/requests.rs:1407 — crates/webcodex-runner-registry/src/requests.rs:1407-1421 | crates/webcodex-runner-registry/src/requests.rs:1615-1629 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:1407` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1183 — crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1183-1197 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1203-1217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1200` calls `as_deref` and `crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1180` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) plugins/examples/python-raw/plugin.py:71 — plugins/examples/python-raw/plugin.py:71-85 | plugins/project-knowledge/plugin.py:71-85 — before extracting anything, compare `plugins/examples/python-raw/plugin.py` and `plugins/project-knowledge/plugin.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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.
  • Duplicated block (15 lines × 2) crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:334 — crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:334-348 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:351-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) src/mcp_tests/file_import.rs:412 — src/mcp_tests/file_import.rs:412-426 | src/mcp_tests/file_import.rs:463-477 — both copies are in the same file, so extract the 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 `src/mcp_tests/file_import.rs:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) src/mcp_tests/http_transport.rs:1323 — src/mcp_tests/http_transport.rs:1323-1337 | src/mcp_tests/http_transport.rs:1416-1430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×25
  • Edited copy of a member (9 corresponding lines) src/runner_quic.rs:53 — src/runner_quic.rs:53-67 | src/runner_quic.rs:71-79 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:1058 — REDACTED:1058-1068 | src/tool_runtime/session_shell.rs:957-965 — 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) crates/webcodex-store/src/accounts.rs:292 — crates/webcodex-store/src/accounts.rs:292-300 | crates/webcodex-store/src/accounts.rs:304-312 — 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) src/tool_request_trace/lifecycle.rs:240 — src/tool_request_trace/lifecycle.rs:240-248 | src/tool_request_trace/lifecycle.rs:255-270 — 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) crates/webcodex-runner-registry/src/runners.rs:1434 — crates/webcodex-runner-registry/src/runners.rs:1434-1442 | crates/webcodex-runner-registry/src/runners.rs:1454-1470 — 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) crates/webcodex-runner-registry/src/runners.rs:1472 — crates/webcodex-runner-registry/src/runners.rs:1472-1480 | crates/webcodex-runner-registry/src/runners.rs:1514-1522 — 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) crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:480 — crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:480-489 | crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:546-554 — 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) crates/webcodex-core/src/mcp_gateway.rs:659 — crates/webcodex-core/src/mcp_gateway.rs:659-667 | crates/webcodex-core/src/plugin.rs:1474-1482 — 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) crates/webcodex-code-mode/src/runtime.rs:1263 — crates/webcodex-code-mode/src/runtime.rs:1263-1271 | crates/webcodex-code-mode/src/runtime.rs:1277-1285 — 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) src/mcp/resources.rs:254 — src/mcp/resources.rs:254-262 | src/mcp/resources.rs:405-413 — 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) crates/webcodex-runner-registry/src/validation.rs:129 — crates/webcodex-runner-registry/src/validation.rs:129-137 | crates/webcodex-runner/src/webcodex_runner/external_tools.rs:1548-1559 — 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) crates/webcodex-lsp/src/supervisor.rs:1591 — crates/webcodex-lsp/src/supervisor.rs:1591-1603 | crates/webcodex-runner/src/webcodex_runner/external_tools.rs:1507-1515 — 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) crates/webcodex-runner/src/webcodex_runner/fake_claude_mcp.rs:240 — crates/webcodex-runner/src/webcodex_runner/fake_claude_mcp.rs:240-249 | crates/webcodex-lsp/src/fake_server.rs:366-374 — 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) crates/webcodex-runner-registry/src/validation.rs:794 — crates/webcodex-runner-registry/src/validation.rs:794-802 | src/auth/pat.rs:182-191 — 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) apps/desktop/src-tauri/src/desktop_locale.rs:72 — apps/desktop/src-tauri/src/desktop_locale.rs:72-80 | apps/desktop/src-tauri/src/desktop_shell.rs:110-118 — 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) crates/webcodex-computer/src/platform/windows/accessibility.rs:156 — crates/webcodex-computer/src/platform/windows/accessibility.rs:156-164 | crates/webcodex-computer/src/platform/windows/accessibility.rs:516-531 — 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) crates/webcodex-runner/src/webcodex_runner/external_tools.rs:433 — crates/webcodex-runner/src/webcodex_runner/external_tools.rs:433-441 | crates/webcodex-runner/src/webcodex_runner/lsp/adapter.rs:113-123 — 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) crates/webcodex-runner/src/webcodex_runner/project_build/rust.rs:242 — crates/webcodex-runner/src/webcodex_runner/project_build/rust.rs:242-250 | crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:482-490 — 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) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:185 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:185-193 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:607-615 — 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) crates/webcodex-runner/src/webcodex_runner/output.rs:91 — crates/webcodex-runner/src/webcodex_runner/output.rs:91-99 | REDACTED:1482-1490 — 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) crates/webcodex-store/src/accounts.rs:126 — crates/webcodex-store/src/accounts.rs:126-134 | crates/webcodex-store/src/oauth.rs:737-745 — 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) apps/desktop/src-tauri/src/coding_agents.rs:249 — apps/desktop/src-tauri/src/coding_agents.rs:249-257 | apps/desktop/src-tauri/src/mcp_providers.rs:342-350 — 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) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:10 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:10-19 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:90-98 — 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) crates/webcodex-runner/src/webcodex_runner/transport/metrics.rs:15 — crates/webcodex-runner/src/webcodex_runner/transport/metrics.rs:15-23 | src/runner_http/telemetry.rs:31-39 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) scripts/e2e_share_oauth_restart.py:68 — scripts/e2e_share_oauth_restart.py:68-76 | scripts/e2e_project_share_roots.py:65-74 — 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.
D2 · Cognitive Complexity · webcodex_workflow_session · ×24
  • webcodex_workflow_session::events::classify_failure_expectation (cognitive 47) crates/webcodex-workflow-session/src/events.rs:434 — webcodex_workflow_session::events::classify_failure_expectation has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29 (46 pts), boolean chains 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.
  • webcodex_workflow_session::task_context::task_context_value (cognitive 42) crates/webcodex-workflow-session/src/task_context.rs:22 — webcodex_workflow_session::task_context::task_context_value has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (10 pts), boolean chains 7 (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.
  • webcodex_workflow_session::console::group_exploration_activity (cognitive 30) crates/webcodex-workflow-session/src/console.rs:568 — webcodex_workflow_session::console::group_exploration_activity has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, loops 2 (3 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.
  • webcodex_workflow_session::console::console_interaction_summary (cognitive 30) crates/webcodex-workflow-session/src/console.rs:879 — webcodex_workflow_session::console::console_interaction_summary has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (27 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.
  • webcodex_workflow_session::events::changed_paths_for_tool (cognitive 29) crates/webcodex-workflow-session/src/events.rs:622 — webcodex_workflow_session::events::changed_paths_for_tool has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (12 pts), match/switch 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.
  • webcodex_workflow_session::handoff_brief::build_handoff_brief (cognitive 29) crates/webcodex-workflow-session/src/handoff_brief.rs:86 — webcodex_workflow_session::handoff_brief::build_handoff_brief has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 6, match/switch 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.
  • webcodex_workflow_session::task_context::stall_diagnostic (cognitive 29) crates/webcodex-workflow-session/src/task_context.rs:362 — webcodex_workflow_session::task_context::stall_diagnostic has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 8, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workflow_session::audit::session_input_summary_for_tool (cognitive 28) crates/webcodex-workflow-session/src/audit.rs:24 — webcodex_workflow_session::audit::session_input_summary_for_tool has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (13 pts), match/switch 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.
  • webcodex_workflow_session::persistence::database::write_row (cognitive 28) crates/webcodex-workflow-session/src/persistence/database.rs:368 — webcodex_workflow_session::persistence::database::write_row has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3, 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.
  • webcodex_workflow_session::events::push_lsp_result_paths (cognitive 25) crates/webcodex-workflow-session/src/events.rs:878 — webcodex_workflow_session::events::push_lsp_result_paths has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (12 pts), match/switch 1 (nesting depth added 14). 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.
  • webcodex_workflow_session::continuation::compare_scopes (cognitive 24) crates/webcodex-workflow-session/src/continuation.rs:1555 — webcodex_workflow_session::continuation::compare_scopes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, boolean chains 9. 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.
  • webcodex_workflow_session::continuation::build_attempt_validation (cognitive 19) crates/webcodex-workflow-session/src/continuation.rs:1047 — webcodex_workflow_session::continuation::build_attempt_validation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_workflow_session::continuation::build_suggested_next_actions (cognitive 19) crates/webcodex-workflow-session/src/continuation.rs:1232 — webcodex_workflow_session::continuation::build_suggested_next_actions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_workflow_session::events::validation_output_summary_for_tool_result (cognitive 19) crates/webcodex-workflow-session/src/events.rs:1033 — webcodex_workflow_session::events::validation_output_summary_for_tool_result has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 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.
  • webcodex_workflow_session::continuation::has_unclosed_mutating_call (cognitive 18) crates/webcodex-workflow-session/src/continuation.rs:642 — webcodex_workflow_session::continuation::has_unclosed_mutating_call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
  • webcodex_workflow_session::handoff_brief::project_validation (cognitive 18) crates/webcodex-workflow-session/src/handoff_brief.rs:582 — webcodex_workflow_session::handoff_brief::project_validation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, match/switch 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.
  • webcodex_workflow_session::console::build_overview (cognitive 17) crates/webcodex-workflow-session/src/console.rs:358 — webcodex_workflow_session::console::build_overview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_workflow_session::continuation::build_attempt_exploration (cognitive 17) crates/webcodex-workflow-session/src/continuation.rs:944 — webcodex_workflow_session::continuation::build_attempt_exploration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 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.
  • webcodex_workflow_session::events::canonical_tool_call_finished_event_refs (cognitive 17) crates/webcodex-workflow-session/src/events.rs:90 — webcodex_workflow_session::events::canonical_tool_call_finished_event_refs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 1 (3 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.
  • webcodex_workflow_session::events::observed_paths_for_successful_result (cognitive 17) crates/webcodex-workflow-session/src/events.rs:829 — webcodex_workflow_session::events::observed_paths_for_successful_result has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 1 (5 pts), match/switch 2 (3 pts) (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.
  • webcodex_workflow_session::store::writer::writer_loop (cognitive 17) crates/webcodex-workflow-session/src/store/writer.rs:299 — webcodex_workflow_session::store::writer::writer_loop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), boolean chains 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.
  • webcodex_workflow_session::events::classify_error_message (cognitive 16) crates/webcodex-workflow-session/src/events.rs:526 — webcodex_workflow_session::events::classify_error_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. 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.
  • webcodex_workflow_session::events::sanitize_persisted_validation_output_summary (cognitive 16) crates/webcodex-workflow-session/src/events.rs:1194 — webcodex_workflow_session::events::sanitize_persisted_validation_output_summary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 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.
  • webcodex_workflow_session::handoff_brief::bounded_path_list (cognitive 16) crates/webcodex-workflow-session/src/handoff_brief.rs:699 — webcodex_workflow_session::handoff_brief::bounded_path_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×22
  • Edited copy of a member (15 corresponding lines) crates/webcodex-core/src/project_build.rs:199 — crates/webcodex-core/src/project_build.rs:199-219 | crates/webcodex-core/src/project_validation.rs:218-232 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/skills.rs:9 — crates/webcodex-tool-contracts/src/registry/output_schemas/skills.rs:9-26 | crates/webcodex-tool-contracts/src/registry/output_schemas/skills.rs:58-72 — 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) crates/webcodex-persistent-shell/src/windows.rs:89 — crates/webcodex-persistent-shell/src/windows.rs:89-103 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:394-416 — 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) apps/desktop/src-tauri/src/runner_capability_grant.rs:114 — apps/desktop/src-tauri/src/runner_capability_grant.rs:114-128 | src/cloudflare_transport.rs:451-470 — 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) crates/webcodex-runner-registry/src/jobs.rs:408 — crates/webcodex-runner-registry/src/jobs.rs:408-424 | src/tool_runtime/files/inspection.rs:634-648 — 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) crates/webcodex-code-mode/src/runtime.rs:1164 — crates/webcodex-code-mode/src/runtime.rs:1164-1178 | crates/webcodex-code-mode/src/runtime.rs:1183-1199 — 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) crates/webcodex-cli/src/webcodex_cli/service.rs:1756 — crates/webcodex-cli/src/webcodex_cli/service.rs:1756-1770 | crates/webcodex-cli/src/webcodex_cli/service.rs:1775-1793 — 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) crates/webcodex-environment/src/service/log.rs:218 — crates/webcodex-environment/src/service/log.rs:218-232 | src/upgrade_maintenance_store.rs:143-159 — 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) apps/desktop/src-tauri/src/updates/install/native.rs:51 — apps/desktop/src-tauri/src/updates/install/native.rs:51-65 | crates/webcodex-cli/src/environment/update/launcher.rs:71-86 — 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) crates/webcodex-store/src/communication.rs:3117 — crates/webcodex-store/src/communication.rs:3117-3139 | crates/webcodex-store/src/communication.rs:3141-3155 — 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) crates/webcodex-workflow-session/src/store.rs:2177 — crates/webcodex-workflow-session/src/store.rs:2177-2191 | crates/webcodex-workflow-session/src/store.rs:2197-2211 — 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) crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:248 — crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:248-263 | src/tool_runtime/checkpoint.rs:621-635 — 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) crates/webcodex-workflow-session/src/messages.rs:309 — crates/webcodex-workflow-session/src/messages.rs:309-323 | crates/webcodex-workflow-session/src/messages.rs:328-342 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) REDACTED:41 — REDACTED:41-55 | REDACTED:96-113 — 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) crates/webcodex-store/src/oauth.rs:432 — crates/webcodex-store/src/oauth.rs:432-446 | crates/webcodex-store/src/oauth.rs:491-505 — 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) crates/webcodex-store/src/oauth.rs:817 — crates/webcodex-store/src/oauth.rs:817-831 | crates/webcodex-store/src/oauth.rs:878-892 — 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) crates/webcodex-runner-registry/src/validation.rs:248 — crates/webcodex-runner-registry/src/validation.rs:248-267 | crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:34-48 — 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) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:411 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:411-426 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:906-920 — 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) crates/webcodex-validation/src/adapters/mod.rs:552 — crates/webcodex-validation/src/adapters/mod.rs:552-566 | crates/webcodex-validation/src/adapters/mod.rs:570-587 — 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) crates/webcodex-cli/src/webcodex_cli/connections.rs:340 — crates/webcodex-cli/src/webcodex_cli/connections.rs:340-354 | crates/webcodex-cli/src/webcodex_cli/service.rs:188-202 — 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) src/mcp_tests/agent_continuation_app.rs:146 — src/mcp_tests/agent_continuation_app.rs:146-162 | src/mcp_tests/agent_continuation_app.rs:197-211 — 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) scripts/agent_loop_benchmark.py:101 — scripts/agent_loop_benchmark.py:101-115 | scripts/e2e_cloudflare_oauth.py:66-81 — 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.
D1 · Cyclomatic Complexity · webcodex_environment · ×21
  • webcodex_environment::unified_update::source::verify_source_manifest_for_flavor (cyclomatic 39) crates/webcodex-environment/src/unified_update/source.rs:100 — webcodex_environment::unified_update::source::verify_source_manifest_for_flavor has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_environment::migration::migrate_legacy_environment (cyclomatic 38) crates/webcodex-environment/src/migration.rs:171 — webcodex_environment::migration::migrate_legacy_environment has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_environment::upgrade::verify_upgrade_candidate (cyclomatic 34) crates/webcodex-environment/src/upgrade.rs:1078 — webcodex_environment::upgrade::verify_upgrade_candidate 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.
  • webcodex_environment::inventory::inspect_environment_paths (cyclomatic 28) crates/webcodex-environment/src/inventory.rs:153 — webcodex_environment::inventory::inspect_environment_paths 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.
  • webcodex_environment::tunnel_recovery::recover (cyclomatic 28) crates/webcodex-environment/src/tunnel_recovery.rs:113 — webcodex_environment::tunnel_recovery::recover 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.
  • webcodex_environment::upgrade::parse_desktop_payload (cyclomatic 25) crates/webcodex-environment/src/upgrade.rs:926 — webcodex_environment::upgrade::parse_desktop_payload 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.
  • webcodex_environment::upgrade::restore_programs_from_journal (cyclomatic 25) crates/webcodex-environment/src/upgrade.rs:2573 — webcodex_environment::upgrade::restore_programs_from_journal 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.
  • webcodex_environment::unified_update::installer::apply_verified_installer (cyclomatic 23) crates/webcodex-environment/src/unified_update/installer.rs:401 — webcodex_environment::unified_update::installer::apply_verified_installer has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_environment::native::service_spec (cyclomatic 21) crates/webcodex-environment/src/native.rs:2114 — webcodex_environment::native::service_spec 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.
  • webcodex_environment::service::validate_spec (cyclomatic 20) crates/webcodex-environment/src/service/mod.rs:479 — webcodex_environment::service::validate_spec has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • webcodex_environment::upgrade::freeze_installer_upgrade (cyclomatic 20) crates/webcodex-environment/src/upgrade.rs:544 — webcodex_environment::upgrade::freeze_installer_upgrade 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.
  • webcodex_environment::cloudflare_tunnel::complete_cloudflare_profile_cleanup (cyclomatic 19) crates/webcodex-environment/src/cloudflare_tunnel.rs:228 — webcodex_environment::cloudflare_tunnel::complete_cloudflare_profile_cleanup 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.
  • webcodex_environment::service::linux::install (cyclomatic 19) crates/webcodex-environment/src/service/linux.rs:391 — webcodex_environment::service::linux::install 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.
  • webcodex_environment::upgrade::native_executable_architecture (cyclomatic 19) crates/webcodex-environment/src/upgrade.rs:2913 — webcodex_environment::upgrade::native_executable_architecture 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.
  • webcodex_environment::migration::validate_import (cyclomatic 18) crates/webcodex-environment/src/migration.rs:689 — webcodex_environment::migration::validate_import 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.
  • webcodex_environment::privilege::apply (cyclomatic 18) crates/webcodex-environment/src/privilege.rs:163 — webcodex_environment::privilege::apply 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.
  • webcodex_environment::native::validate_request_with_preserved_listen (cyclomatic 17) crates/webcodex-environment/src/native.rs:1998 — webcodex_environment::native::validate_request_with_preserved_listen 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.
  • webcodex_environment::service::windows::validate_credential (cyclomatic 17) crates/webcodex-environment/src/service/windows.rs:1202 — webcodex_environment::service::windows::validate_credential 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.
  • webcodex_environment::upgrade::verify_prepared_installation_for (cyclomatic 17) crates/webcodex-environment/src/upgrade.rs:406 — webcodex_environment::upgrade::verify_prepared_installation_for 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.
  • webcodex_environment::upgrade::desktop_tree::digest_named (cyclomatic 17) crates/webcodex-environment/src/upgrade/desktop_tree.rs:75 — webcodex_environment::upgrade::desktop_tree::digest_named 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.
  • webcodex_environment::migration::inspect_import (cyclomatic 16) crates/webcodex-environment/src/migration.rs:767 — webcodex_environment::migration::inspect_import 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.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×21
  • Edited copy of a member (13 corresponding lines) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:108 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:108-120 | crates/webcodex-runner/src/webcodex_runner/artifacts.rs:122-136 — 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) crates/webcodex-cli/src/webcodex_cli/ops.rs:492 — crates/webcodex-cli/src/webcodex_cli/ops.rs:492-504 | crates/webcodex-cli/src/webcodex_cli/ops.rs:617-629 — 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) crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:80 — crates/webcodex-runner/src/webcodex_runner/transport/quic.rs:80-92 | src/runner_quic.rs:87-99 — 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) crates/webcodex-environment/src/installer_authorization.rs:246 — crates/webcodex-environment/src/installer_authorization.rs:246-258 | crates/webcodex-environment/src/installer_authorization.rs:323-339 — 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) src/tool_runtime/agent_wait.rs:157 — src/tool_runtime/agent_wait.rs:157-169 | src/tool_runtime/agent_wait.rs:175-194 — 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) crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:123 — crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:123-135 | crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:137-149 — 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) crates/webcodex-persistent-shell/src/unix/launch.rs:63 — crates/webcodex-persistent-shell/src/unix/launch.rs:63-75 | src/server_listener.rs:147-164 — 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) crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:76 — crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:76-88 | src/tool_runtime/session_tools.rs:779-792 — 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) crates/webcodex-store/src/oauth.rs:158 — crates/webcodex-store/src/oauth.rs:158-170 | crates/webcodex-store/src/oauth.rs:187-199 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:75 — crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:75-87 | crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:152-164 — 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) src/mcp/tools/invocation.rs:221 — src/mcp/tools/invocation.rs:221-233 | src/mcp/tools/invocation.rs:265-279 — 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) crates/webcodex-runner-registry/src/reconciliation.rs:671 — crates/webcodex-runner-registry/src/reconciliation.rs:671-687 | crates/webcodex-runner-registry/src/reconciliation.rs:795-807 — 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) crates/webcodex-cli/src/webcodex_cli/service.rs:974 — crates/webcodex-cli/src/webcodex_cli/service.rs:974-986 | crates/webcodex-cli/src/webcodex_cli/service.rs:988-1000 — 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) src/mcp_gateway.rs:673 — src/mcp_gateway.rs:673-685 | src/plugin_gateway.rs:1256-1269 — 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) src/runner_tokens_http/responses.rs:6 — src/runner_tokens_http/responses.rs:6-20 | src/users_http/tokens.rs:58-70 — 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) crates/webcodex-cli/src/webcodex_cli/service.rs:492 — crates/webcodex-cli/src/webcodex_cli/service.rs:492-504 | crates/webcodex-cli/src/webcodex_cli/service.rs:1538-1550 — 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) crates/webcodex-store/src/communication.rs:3182 — crates/webcodex-store/src/communication.rs:3182-3194 | crates/webcodex-store/src/communication.rs:3196-3208 — 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) src/tool_runtime/communication.rs:235 — src/tool_runtime/communication.rs:235-247 | src/tool_runtime/goal.rs:448-460 — 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) src/runtime_console_http.rs:2401 — src/runtime_console_http.rs:2401-2413 | src/runtime_console_http.rs:2437-2449 — 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) crates/webcodex-core/src/project_format.rs:293 — crates/webcodex-core/src/project_format.rs:293-307 | crates/webcodex-core/src/project_build.rs:466-478 — 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) crates/webcodex-runner/src/webcodex_runner/config.rs:1159 — crates/webcodex-runner/src/webcodex_runner/config.rs:1159-1171 | src/tool_runtime/runner_config.rs:39-51 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D2 · Cognitive Complexity · webcodex_desktop · ×20
  • webcodex_desktop::webcodex::settings::mcp::reconcile_document (cognitive 47) apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:26 — webcodex_desktop::webcodex::settings::mcp::reconcile_document has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 6 (12 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.
  • webcodex_desktop::webcodex::settings::acp::reconcile_document (cognitive 43) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:31 — webcodex_desktop::webcodex::settings::acp::reconcile_document has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 6 (12 pts), boolean chains 2 (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.
  • webcodex_desktop::updates::install::native::macos::launch (cognitive 28) apps/desktop/src-tauri/src/updates/install/native.rs:248 — webcodex_desktop::updates::install::native::macos::launch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 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.
  • webcodex_desktop::tray::build_menu (cognitive 26) apps/desktop/src-tauri/src/tray.rs:393 — webcodex_desktop::tray::build_menu has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_desktop::coding_agents::validate_profile (cognitive 21) apps/desktop/src-tauri/src/coding_agents.rs:281 — webcodex_desktop::coding_agents::validate_profile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 3 (4 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.
  • webcodex_desktop::state::operation_completion::reconcile_after_operation_failure (cognitive 21) apps/desktop/src-tauri/src/state/operation_completion.rs:174 — webcodex_desktop::state::operation_completion::reconcile_after_operation_failure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_desktop::webcodex::cli::run_bounded_until (cognitive 21) apps/desktop/src-tauri/src/webcodex/cli.rs:401 — webcodex_desktop::webcodex::cli::run_bounded_until has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 7 (8 pts), 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.
  • webcodex_desktop::project_inventory::unregister_batch (cognitive 20) apps/desktop/src-tauri/src/project_inventory.rs:177 — webcodex_desktop::project_inventory::unregister_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, match/switch 1 (3 pts), 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.
  • webcodex_desktop::state::environment::validate_legacy_runner_layout (cognitive 20) apps/desktop/src-tauri/src/state/environment.rs:26 — webcodex_desktop::state::environment::validate_legacy_runner_layout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webcodex_desktop::mcp_providers::validate_profile (cognitive 19) apps/desktop/src-tauri/src/mcp_providers.rs:490 — webcodex_desktop::mcp_providers::validate_profile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, 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.
  • webcodex_desktop::state::environment::config_fingerprint (cognitive 19) apps/desktop/src-tauri/src/state/environment.rs:259 — webcodex_desktop::state::environment::config_fingerprint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 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.
  • webcodex_desktop::state::connections::persistent_runtime_projection (cognitive 18) apps/desktop/src-tauri/src/state/connections.rs:794 — webcodex_desktop::state::connections::persistent_runtime_projection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_desktop::updates::install::native::launch_windows (cognitive 18) apps/desktop/src-tauri/src/updates/install/native.rs:377 — webcodex_desktop::updates::install::native::launch_windows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 5 (6 pts), loops 2, 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.
  • webcodex_desktop::webcodex::settings::provider_preflight::preflight_providers (cognitive 18) apps/desktop/src-tauri/src/webcodex/settings/provider_preflight.rs:26 — webcodex_desktop::webcodex::settings::provider_preflight::preflight_providers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (9 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.
  • webcodex_desktop::state::environment::adopt_saved_environment (cognitive 17) apps/desktop/src-tauri/src/state/environment.rs:330 — webcodex_desktop::state::environment::adopt_saved_environment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_desktop::state::path_inventory::append_legacy_locations (cognitive 17) apps/desktop/src-tauri/src/state/path_inventory.rs:374 — webcodex_desktop::state::path_inventory::append_legacy_locations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), 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.
  • webcodex_desktop::mcp_providers::validate_manifest (cognitive 16) apps/desktop/src-tauri/src/mcp_providers.rs:542 — webcodex_desktop::mcp_providers::validate_manifest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_desktop::runtime_selection::probe_binary (cognitive 16) apps/desktop/src-tauri/src/runtime_selection.rs:237 — webcodex_desktop::runtime_selection::probe_binary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 5 (6 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.
  • webcodex_desktop::runtime_selection::probe (cognitive 16) apps/desktop/src-tauri/src/runtime_selection.rs:347 — webcodex_desktop::runtime_selection::probe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3, boolean chains 1, match/switch 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.
  • webcodex_desktop::tray::handle_menu_event (cognitive 16) apps/desktop/src-tauri/src/tray.rs:547 — webcodex_desktop::tray::handle_menu_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (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.
D3 · God Classes · TooManyMethods · ×20
  • TooManyMethods: ToolRuntime src/tool_runtime/runtime.rs:106 — TooManyMethods — 522 methods, declared across 120 files: tool_runtime/communication.rs (29), tool_runtime/skills.rs (20), tool_runtime/agent_task.rs (18), tool_runtime/goal.rs (18), +116 more file(s). The bar is 30 methods; this is 492 over it, 17.40× 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: Database crates/webcodex-store/src/lib.rs:175 — TooManyMethods — 284 methods, declared across 35 files: agent_task/operations.rs (32), src/oauth.rs (32), src/communication.rs (24), src/accounts.rs (21), +31 more file(s). The bar is 30 methods; this is 254 over it, 9.47× 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: RunnerRegistry crates/webcodex-runner-registry/src/registry.rs:79 — TooManyMethods — 164 methods, declared across 13 files: src/requests.rs (44), src/job_updates.rs (42), src/runners.rs (38), src/maintenance.rs (10), +9 more file(s). The bar is 30 methods; this is 134 over it, 5.47× 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: AppState apps/desktop/src-tauri/src/state.rs:90 — TooManyMethods — 88 methods, declared across 17 files: state/app_state.rs (27), state/updates.rs (12), state/workspace_settings.rs (6), state/runtime_shell.rs (5), +13 more file(s). The bar is 30 methods; this is 58 over it, 2.93× 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: Ir REDACTED:1463 — TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× 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: SessionStore crates/webcodex-workflow-session/src/store.rs:98 — TooManyMethods — 76 methods, declared across 4 files: src/store.rs (52), src/messages.rs (22), store/residency.rs (1), store/writer.rs (1). The bar is 30 methods; this is 46 over it, 2.53× 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: DesktopCore apps/desktop/src-tauri/src/state/desktop_core.rs:1 — TooManyMethods — 64 methods, declared across 8 files: state/desktop_core.rs (24), state/connections.rs (12), state/environment.rs (10), state/runtime_shell.rs (6), +4 more file(s). The bar is 30 methods; this is 34 over it, 2.13× 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: l src/mcp_pdf_app.html:700 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× 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: NativeEnvironment crates/webcodex-environment/src/native.rs:22 — TooManyMethods — 59 methods, declared across 7 files: src/upgrade.rs (22), src/native.rs (21), src/tunnel.rs (12), src/cloudflare_tunnel.rs (1), +3 more file(s). The bar is 30 methods; this is 29 over it, 1.97× 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: Dr REDACTED:1463 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: BrowserSupervisor crates/webcodex-browser/src/supervisor.rs:37 — TooManyMethods — 44 methods, declared across 2 files: src/supervisor.rs (42), supervisor/user_handoff.rs (2). The bar is 30 methods; this is 14 over it, 1.47× 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: JobManager crates/webcodex-runner/src/webcodex_runner/job_manager.rs:148 — TooManyMethods — 41 methods, declared across 12 files: job_manager/shutdown.rs (8), webcodex_runner/job_manager.rs (7), job_manager/delivery.rs (5), job_manager/detached.rs (5), +8 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: SkillStore crates/webcodex-runner/src/webcodex_runner/skill_store.rs:152 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× 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: fi src/mcp_pdf_app.html:690 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× 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: UpdateManager crates/webcodex-environment/src/unified_update/download.rs:151 — TooManyMethods — 33 methods, declared across 3 files: unified_update/download.rs (20), unified_update/install.rs (8), unified_update/view.rs (5). 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: CodingAgentManager crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:218 — TooManyMethods — 33 methods, declared across 5 files: coding_agent/lifecycle.rs (13), webcodex_runner/coding_agent.rs (9), coding_agent/setup.rs (5), coding_agent/run.rs (4), +1 more file(s). 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: xn src/mcp_pdf_app.html:647 — 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: Mn src/mcp_pdf_app.html:647 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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: WebCodexAdapter apps/desktop/src-tauri/src/webcodex/adapter.rs:46 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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: ComputerRuntime crates/webcodex-computer/src/lib.rs:933 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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.
D2 · Cognitive Complexity · webcodex_workspace · ×19
  • webcodex_workspace::project_overview::validate_project_overview (cognitive 69) crates/webcodex-workspace/src/project_overview.rs:832 — webcodex_workspace::project_overview::validate_project_overview has cognitive complexity 69 (threshold 15). Drivers by points: if/else 38 (57 pts), loops 8 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workspace::project_overview::build_project_overview (cognitive 61) crates/webcodex-workspace/src/project_overview.rs:103 — webcodex_workspace::project_overview::build_project_overview has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (43 pts), match/switch 5 (13 pts), loops 3 (5 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.
  • webcodex_workspace::project_recipe::workspace_member_witnesses (cognitive 52) crates/webcodex-workspace/src/project_recipe.rs:535 — webcodex_workspace::project_recipe::workspace_member_witnesses has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (44 pts), loops 4 (6 pts), boolean chains 1, match/switch 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.
  • webcodex_workspace::project_recipe::project_cargo_all_packages_provenance_files (cognitive 46) crates/webcodex-workspace/src/project_recipe.rs:212 — webcodex_workspace::project_recipe::project_cargo_all_packages_provenance_files has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 4 (7 pts), boolean chains 3, match/switch 1 (3 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.
  • webcodex_workspace::project_context::fallback_manifest_paths (cognitive 40) crates/webcodex-workspace/src/project_context.rs:935 — webcodex_workspace::project_context::fallback_manifest_paths has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 2 (3 pts), boolean chains 2 (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.
  • webcodex_workspace::workspace_checkpoint::collect_untracked (cognitive 29) crates/webcodex-workspace/src/workspace_checkpoint.rs:536 — webcodex_workspace::workspace_checkpoint::collect_untracked has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workspace::workspace_checkpoint::status_summary (cognitive 27) crates/webcodex-workspace/src/workspace_checkpoint.rs:434 — webcodex_workspace::workspace_checkpoint::status_summary has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workspace::project_context::worktree_sha256 (cognitive 23) crates/webcodex-workspace/src/project_context.rs:505 — webcodex_workspace::project_context::worktree_sha256 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workspace::project_recipe::nearest_recipe_root (cognitive 23) crates/webcodex-workspace/src/project_recipe.rs:1314 — webcodex_workspace::project_recipe::nearest_recipe_root has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1, 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.
  • webcodex_workspace::project_context::untracked_files_sha256 (cognitive 22) crates/webcodex-workspace/src/project_context.rs:654 — webcodex_workspace::project_context::untracked_files_sha256 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (3 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.
  • webcodex_workspace::project_recipe::collect_workspace_member_dependencies (cognitive 22) crates/webcodex-workspace/src/project_recipe.rs:846 — webcodex_workspace::project_recipe::collect_workspace_member_dependencies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workspace::project_recipe::cargo_manifest_uses_workspace_inheritance (cognitive 22) crates/webcodex-workspace/src/project_recipe.rs:1156 — webcodex_workspace::project_recipe::cargo_manifest_uses_workspace_inheritance has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (8 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.
  • webcodex_workspace::project_recipe::extend_cargo_workspace_member_routes (cognitive 21) crates/webcodex-workspace/src/project_recipe.rs:738 — webcodex_workspace::project_recipe::extend_cargo_workspace_member_routes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 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.
  • webcodex_workspace::project_recipe::project_cargo_all_packages_provenance_inner (cognitive 20) crates/webcodex-workspace/src/project_recipe.rs:372 — webcodex_workspace::project_recipe::project_cargo_all_packages_provenance_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 6 (10 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, 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.
  • webcodex_workspace::project_recipe::add_path_dependency_witnesses (cognitive 20) crates/webcodex-workspace/src/project_recipe.rs:907 — webcodex_workspace::project_recipe::add_path_dependency_witnesses has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), match/switch 1 (3 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.
  • webcodex_workspace::project_overview::classify_key_file (cognitive 19) crates/webcodex-workspace/src/project_overview.rs:465 — webcodex_workspace::project_overview::classify_key_file has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (9 pts) (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.
  • webcodex_workspace::project_context::git_fingerprint (cognitive 18) crates/webcodex-workspace/src/project_context.rs:430 — webcodex_workspace::project_context::git_fingerprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 3 (nesting depth added 6). 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.
  • webcodex_workspace::project_recipe::rust_workspace_root (cognitive 17) crates/webcodex-workspace/src/project_recipe.rs:122 — webcodex_workspace::project_recipe::rust_workspace_root has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_workspace::project_context::compare_project_context (cognitive 16) crates/webcodex-workspace/src/project_context.rs:228 — webcodex_workspace::project_context::compare_project_context has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), 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.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×19
  • Edited copy of a member (10 corresponding lines) src/tool_runtime/git/log.rs:182 — src/tool_runtime/git/log.rs:182-192 | src/tool_runtime/git/show_changes.rs:1736-1745 — 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) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:142 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:142-151 | crates/webcodex-runner/src/webcodex_runner/artifacts.rs:157-166 — 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) crates/webcodex-runner/src/webcodex_runner/exit_diagnostics.rs:428 — crates/webcodex-runner/src/webcodex_runner/exit_diagnostics.rs:428-439 | crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:498-507 — 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) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:189 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:189-199 | crates/webcodex-runner/src/webcodex_runner/artifacts.rs:201-210 — 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) src/tool_request_trace/store.rs:176 — src/tool_request_trace/store.rs:176-187 | src/tool_request_trace/store.rs:189-198 — 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) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2031 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2031-2040 | src/tool_runtime/model_ergonomics_telemetry/job_convergence.rs:49-58 — 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) crates/webcodex-store/src/oauth.rs:212 — crates/webcodex-store/src/oauth.rs:212-221 | crates/webcodex-store/src/oauth.rs:227-238 — 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) src/auth/pat.rs:220 — src/auth/pat.rs:220-229 | src/pairing_http.rs:76-86 — 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) apps/desktop/src-tauri/src/state/app_state.rs:234 — apps/desktop/src-tauri/src/state/app_state.rs:234-243 | apps/desktop/src-tauri/src/state/app_state.rs:328-337 — 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) crates/webcodex-lsp/src/fake_server.rs:871 — crates/webcodex-lsp/src/fake_server.rs:871-880 | crates/webcodex-runner/src/webcodex_runner/fake_claude_mcp.rs:297-306 — 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) crates/webcodex-cli/src/webcodex_cli/ops.rs:1680 — crates/webcodex-cli/src/webcodex_cli/ops.rs:1680-1689 | crates/webcodex-cli/src/webcodex_cli/runner_service.rs:322-331 — 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) crates/webcodex-browser/src/types.rs:651 — crates/webcodex-browser/src/types.rs:651-660 | crates/webcodex-runner/src/webcodex_runner/detached_job/model.rs:525-534 — 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) crates/webcodex-computer/src/platform/macos/display.rs:203 — crates/webcodex-computer/src/platform/macos/display.rs:203-214 | crates/webcodex-computer/src/platform/windows/display.rs:105-114 — 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) crates/webcodex-core/src/ssh_resource.rs:36 — crates/webcodex-core/src/ssh_resource.rs:36-46 | crates/webcodex-environment/src/tunnel.rs:261-270 — 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) crates/webcodex-store/src/communication.rs:3248 — crates/webcodex-store/src/communication.rs:3248-3259 | crates/webcodex-store/src/goal.rs:1349-1358 — 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) apps/desktop/src-tauri/src/activity.rs:178 — apps/desktop/src-tauri/src/activity.rs:178-187 | src/tool_runtime/projects.rs:1531-1542 — 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) scripts/release_publication.py:241 — scripts/release_publication.py:241-250 | scripts/release_readiness.py:249-258 — 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) scripts/e2e_codex_bidirectional_ws.py:359 — scripts/e2e_codex_bidirectional_ws.py:359-369 | scripts/e2e_session_continuity_ws.py:83-92 — 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) scripts/collect_release_bundle.py:303 — scripts/collect_release_bundle.py:303-312 | scripts/verify_public_release.py:208-217 — 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 · Edited copy of a member (11 corresponding lines) · ×18
  • Edited copy of a member (11 corresponding lines) crates/webcodex-workflow-session/src/assignment.rs:231 — crates/webcodex-workflow-session/src/assignment.rs:231-241 | crates/webcodex-workflow-session/src/messages.rs:640-654 — 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) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:219 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:219-242 | crates/webcodex-runner/src/webcodex_runner/computer_session/platform/windows.rs:101-111 — 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) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:253 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:253-263 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:276-286 — 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) crates/webcodex-runner-registry/src/runners.rs:1309 — crates/webcodex-runner-registry/src/runners.rs:1309-1319 | crates/webcodex-runner-registry/src/runners.rs:1328-1343 — 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) crates/webcodex-workflow-session/src/console.rs:1077 — crates/webcodex-workflow-session/src/console.rs:1077-1091 | src/tool_runtime/patch.rs:95-105 — 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) crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:510 — crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:510-520 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:403-413 — 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) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:245 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:245-255 | crates/webcodex-cli/src/webcodex_cli/connect/process.rs:290-301 — 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) apps/desktop/src-tauri/src/desktop_locale.rs:53 — apps/desktop/src-tauri/src/desktop_locale.rs:53-63 | apps/desktop/src-tauri/src/desktop_shell.rs:91-101 — 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) crates/webcodex-core/src/coding_agent.rs:1171 — crates/webcodex-core/src/coding_agent.rs:1171-1181 | crates/webcodex-core/src/plugin.rs:1462-1472 — 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) crates/webcodex-workflow-session/src/messages.rs:349 — crates/webcodex-workflow-session/src/messages.rs:349-359 | crates/webcodex-workflow-session/src/messages.rs:367-382 — 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) crates/webcodex-lsp/src/supervisor.rs:2673 — crates/webcodex-lsp/src/supervisor.rs:2673-2683 | crates/webcodex-runner/src/webcodex_runner/shell/preparation.rs:43-56 — 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) crates/webcodex-store/src/agent_task/invariants.rs:256 — crates/webcodex-store/src/agent_task/invariants.rs:256-266 | crates/webcodex-store/src/agent_task/invariants.rs:282-297 — 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) crates/webcodex-persistent-shell/src/framing.rs:188 — crates/webcodex-persistent-shell/src/framing.rs:188-200 | crates/webcodex-runner/src/webcodex_runner/config.rs:463-473 — 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) apps/desktop/src-tauri/src/lifecycle_log.rs:209 — apps/desktop/src-tauri/src/lifecycle_log.rs:209-219 | crates/webcodex-browser/src/profiles.rs:28-38 — 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) crates/webcodex-store/src/memory.rs:363 — crates/webcodex-store/src/memory.rs:363-373 | crates/webcodex-store/src/store_primitives.rs:260-273 — 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) src/tool_runtime/files/artifacts.rs:174 — src/tool_runtime/files/artifacts.rs:174-184 | src/tool_runtime/permissions/mod.rs:213-224 — 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) crates/webcodex-computer/src/windows_uia_tests/scroll.rs:4 — crates/webcodex-computer/src/windows_uia_tests/scroll.rs:4-14 | crates/webcodex-computer/src/windows_uia_tests/selection.rs:3-13 — 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) src/mcp_tests/plugin_check.rs:9 — src/mcp_tests/plugin_check.rs:9-19 | src/mcp_tests/plugin_tools.rs:71-81 — 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×17
  • Edited copy of a member (19 corresponding lines) crates/webcodex-process/src/bin/process_tree_helper.rs:95 — crates/webcodex-process/src/bin/process_tree_helper.rs:95-113 | crates/webcodex-runner/src/webcodex_runner/validation/validation_tree_helper.rs:135-158 — 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) src/project_entry_windows.rs:69 — src/project_entry_windows.rs:69-90 | src/project_entry_windows.rs:100-118 — 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) apps/desktop/src-tauri/src/webcodex/cli.rs:758 — apps/desktop/src-tauri/src/webcodex/cli.rs:758-776 | apps/desktop/src-tauri/src/webcodex/cli.rs:782-800 — 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) src/tool_runtime/git/mutations.rs:193 — src/tool_runtime/git/mutations.rs:193-211 | src/tool_runtime/git/mutations.rs:217-235 — 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) crates/webcodex-workspace/src/workspace_checkpoint.rs:838 — crates/webcodex-workspace/src/workspace_checkpoint.rs:838-856 | src/tool_runtime/checkpoint.rs:837-856 — 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) crates/webcodex-runner/src/webcodex_runner/transport/listeners.rs:27 — crates/webcodex-runner/src/webcodex_runner/transport/listeners.rs:27-45 | crates/webcodex-runner/src/webcodex_runner/transport/listeners.rs:51-70 — 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) crates/webcodex-cli/src/webcodex_cli/service.rs:812 — crates/webcodex-cli/src/webcodex_cli/service.rs:812-830 | crates/webcodex-cli/src/webcodex_cli/service.rs:1730-1754 — 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) crates/webcodex-core/src/runner_protocol/job.rs:421 — crates/webcodex-core/src/runner_protocol/job.rs:421-439 | crates/webcodex-core/src/runner_protocol/job.rs:762-780 — 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) crates/webcodex-core/src/validation_evidence.rs:123 — crates/webcodex-core/src/validation_evidence.rs:123-143 | crates/webcodex-core/src/validation_evidence.rs:221-239 — 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) src/tool_request_trace/store.rs:70 — src/tool_request_trace/store.rs:70-88 | src/tool_request_trace/store.rs:93-111 — 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) src/tool_runtime/agent_task.rs:568 — src/tool_runtime/agent_task.rs:568-588 | src/tool_runtime/communication.rs:561-579 — 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) REDACTED:288 — REDACTED:288-306 | src/tool_runtime/result_projection.rs:423-444 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/agent_waits.rs:102 — crates/webcodex-tool-contracts/src/registry/output_schemas/agent_waits.rs:102-120 | crates/webcodex-tool-contracts/src/registry/output_schemas/goals.rs:276-319 — 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) crates/webcodex-store/src/goal.rs:1425 — crates/webcodex-store/src/goal.rs:1425-1443 | crates/webcodex-store/src/store_primitives.rs:114-133 — 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) scripts/release_publication.py:873 — scripts/release_publication.py:873-891 | scripts/release_readiness.py:601-619 — 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) scripts/release_publication.py:156 — scripts/release_publication.py:156-174 | scripts/release_publication.py:178-196 — 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) src/mcp_tests/plugin_tools.rs:393 — src/mcp_tests/plugin_tools.rs:393-415 | src/mcp_tests/plugin_tools.rs:539-557 — 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 (12 corresponding lines) · ×17
  • Edited copy of a member (12 corresponding lines) src/tool_runtime/agent_task.rs:28 — src/tool_runtime/agent_task.rs:28-39 | src/tool_runtime/communication.rs:42-53 — 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) src/tool_runtime/files/mutations/preflight.rs:156 — src/tool_runtime/files/mutations/preflight.rs:156-172 | src/tool_runtime/files/mutations/text_edits.rs:413-424 — 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) crates/webcodex-admin/src/commands.rs:238 — crates/webcodex-admin/src/commands.rs:238-249 | crates/webcodex-admin/src/commands.rs:371-382 — 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) apps/desktop/src-tauri/src/webcodex/adapter.rs:860 — apps/desktop/src-tauri/src/webcodex/adapter.rs:860-871 | crates/webcodex-cli/src/webcodex_cli/project.rs:362-373 — 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) crates/webcodex-cli/src/webcodex_cli/connect/probe.rs:46 — crates/webcodex-cli/src/webcodex_cli/connect/probe.rs:46-57 | crates/webcodex-cli/src/webcodex_cli/connect/probe.rs:63-78 — 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) crates/webcodex-store/src/accounts.rs:6 — crates/webcodex-store/src/accounts.rs:6-17 | crates/webcodex-store/src/accounts.rs:365-376 — 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) crates/webcodex-store/src/accounts.rs:49 — crates/webcodex-store/src/accounts.rs:49-61 | crates/webcodex-store/src/accounts.rs:316-327 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs:276 — crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs:276-287 | crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs:289-305 — 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) apps/desktop/src-tauri/src/mcp_providers.rs:232 — apps/desktop/src-tauri/src/mcp_providers.rs:232-243 | apps/desktop/src-tauri/src/tunnel_config.rs:414-427 — 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) apps/desktop/src-tauri/src/process/supervisor.rs:614 — apps/desktop/src-tauri/src/process/supervisor.rs:614-626 | apps/desktop/src-tauri/src/webcodex/cli.rs:842-853 — 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) crates/webcodex-process/src/unix.rs:99 — crates/webcodex-process/src/unix.rs:99-110 | crates/webcodex-process/src/unix.rs:137-148 — 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) crates/webcodex-store/src/workbench_preferences.rs:192 — crates/webcodex-store/src/workbench_preferences.rs:192-208 | crates/webcodex-store/src/workbench_preferences.rs:214-225 — 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) src/tool_runtime/communication.rs:221 — src/tool_runtime/communication.rs:221-233 | src/tool_runtime/agent_task.rs:123-134 — 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) src/agent_wake.rs:128 — src/agent_wake.rs:128-139 | src/job_terminal_attention.rs:547-558 — 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) src/tool_runtime/control_sidecar.rs:428 — src/tool_runtime/control_sidecar.rs:428-439 | src/tool_runtime/kernel.rs:153-164 — 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) crates/webcodex-validation/src/adapters/go.rs:145 — crates/webcodex-validation/src/adapters/go.rs:145-156 | crates/webcodex-validation/src/adapters/node.rs:82-95 — 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) scripts/collect_release_bundle.py:388 — scripts/collect_release_bundle.py:388-399 | scripts/verify_public_release.py:634-645 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×16
  • Duplicated block (10 lines × 3) apps/desktop/src-tauri/src/state/workspace_settings.rs:46 — apps/desktop/src-tauri/src/state/workspace_settings.rs:46-55 | apps/desktop/src-tauri/src/state/workspace_settings.rs:73-83 | apps/desktop/src-tauri/src/state/workspace_settings.rs:118-127 — 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 `apps/desktop/src-tauri/src/state/workspace_settings.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/webcodex-cli/src/lib.rs:2048 — crates/webcodex-cli/src/lib.rs:2048-2057 | crates/webcodex-cli/src/lib.rs:2182-2191 | crates/webcodex-cli/src/lib.rs:2339-2348 — 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 `crates/webcodex-cli/src/lib.rs:2048` 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 × 3) crates/webcodex-core/src/runner_operation.rs:2344 — crates/webcodex-core/src/runner_operation.rs:2344-2353 | crates/webcodex-core/src/runner_operation.rs:2359-2368 | crates/webcodex-core/src/runner_operation.rs:2373-2382 — 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 `crates/webcodex-core/src/runner_operation.rs:2344` 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 × 3) crates/webcodex-runner-registry/src/job_updates.rs:912 — crates/webcodex-runner-registry/src/job_updates.rs:912-921 | crates/webcodex-runner-registry/src/job_updates.rs:958-967 | crates/webcodex-runner-registry/src/job_updates.rs:999-1008 — 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.
  • Duplicated block (10 lines × 3) crates/webcodex-runner-registry/src/job_updates.rs:1944 — crates/webcodex-runner-registry/src/job_updates.rs:1944-1953 | crates/webcodex-runner-registry/src/job_updates.rs:1992-2001 | crates/webcodex-runner-registry/src/job_updates.rs:2039-2048 — 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 `crates/webcodex-runner-registry/src/job_updates.rs:1944` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 3) crates/webcodex-runner-registry/src/job_updates.rs:2270 — crates/webcodex-runner-registry/src/job_updates.rs:2270-2279 | crates/webcodex-runner-registry/src/polling.rs:523-532 | crates/webcodex-runner-registry/src/polling.rs:833-842 — 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 before the matched lines, `crates/webcodex-runner-registry/src/polling.rs:830` calls `normalize_persistent_shell_result` and `crates/webcodex-runner-registry/src/polling.rs:513` 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 × 3) crates/webcodex-runner-registry/src/validation.rs:465 — crates/webcodex-runner-registry/src/validation.rs:465-474 | crates/webcodex-runner-registry/src/validation.rs:488-497 | crates/webcodex-runner-registry/src/validation.rs:505-514 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/webcodex-runner/src/webcodex_runner/dispatch.rs:507 — crates/webcodex-runner/src/webcodex_runner/dispatch.rs:507-516 | crates/webcodex-runner/src/webcodex_runner/dispatch.rs:529-538 | crates/webcodex-runner/src/webcodex_runner/dispatch.rs:544-553 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:331 — crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:331-340 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:359-368 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:386-395 — 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 `crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:331` 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 × 3) crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:390 — crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:390-399 | crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:601-610 | crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:940-949 — 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 `crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:785 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:785-794 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:851-860 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:925-934 — 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:785` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) src/tool_runtime/coding_agent.rs:879 — src/tool_runtime/coding_agent.rs:879-888 | src/tool_runtime/coding_agent.rs:914-923 | src/tool_runtime/coding_agent.rs:1026-1035 — 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 `src/tool_runtime/coding_agent.rs:879` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) src/tool_runtime/communication.rs:765 — src/tool_runtime/communication.rs:765-774 | src/tool_runtime/communication.rs:818-827 | src/tool_runtime/communication.rs:951-960 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) src/tool_runtime/git_review.rs:203 — src/tool_runtime/git_review.rs:203-212 | src/tool_runtime/git_review.rs:257-266 | src/tool_runtime/git_review.rs:292-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 `src/tool_runtime/git_review.rs: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. 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 first that the copies are not typed on the same thing: the declarations holding them bind `stdout` to `&str) -> (Vec<NameStatusRecord>` in one and `&str) -> (Vec<NumstatRecord>` 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 × 3) crates/webcodex-runner/src/webcodex_runner/plugin.rs:961 — crates/webcodex-runner/src/webcodex_runner/plugin.rs:961-970 | src/tool_runtime/git/diff_hunks.rs:584-593 | src/tool_runtime/startup_catalog.rs:213-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (10 lines × 3) crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:276 — crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:276-285 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:336-345 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:351-360 — 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.
D3 · God Classes · ClassTooLong · ×15
  • ClassTooLong: ToolCall crates/webcodex-tool-contracts/src/tool_call/canonical_enum.rs:8 — ClassTooLong — 2168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods. The bar is 400 significant lines; this is 1768 over it, 5.42× 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: SessionStore crates/webcodex-workflow-session/src/store.rs:98 — ClassTooLong — 1577 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 76 methods, 3 blocks, lines 98-2262. The bar is 400 significant lines; this is 1177 over it, 3.94× 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: NativeEnvironment crates/webcodex-environment/src/native.rs:22 — ClassTooLong — 1255 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 3 blocks, lines 22-1712. The bar is 400 significant lines; this is 855 over it, 3.14× 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: DesktopCore apps/desktop/src-tauri/src/state/desktop_core.rs:1 — ClassTooLong — 1199 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 2 blocks, lines 1-1510. The bar is 400 significant lines; this is 799 over it, 3.00× 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: AgentContinuationController src/agent_wake.rs:262 — ClassTooLong — 1160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 2 blocks, lines 262-1687. The bar is 400 significant lines; this is 760 over it, 2.90× 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: SkillStore crates/webcodex-runner/src/webcodex_runner/skill_store.rs:152 — ClassTooLong — 1065 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods. The bar is 400 significant lines; this is 665 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: BrowserSupervisor crates/webcodex-browser/src/supervisor.rs:37 — ClassTooLong — 893 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 44 methods, 4 blocks, lines 37-1198. The bar is 400 significant lines; this is 493 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ComputerRuntime crates/webcodex-computer/src/lib.rs:933 — ClassTooLong — 741 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 2 blocks, lines 933-1871. The bar is 400 significant lines; this is 341 over it, 1.85× 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: SessionStoreInner crates/webcodex-workflow-session/src/store.rs:154 — ClassTooLong — 678 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 154-3633. The bar is 400 significant lines; this is 278 over it, 1.70× 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: LspSupervisor crates/webcodex-lsp/src/supervisor.rs:330 — ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 3 blocks, lines 330-1293. The bar is 400 significant lines; this is 222 over it, 1.56× 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: JobStartPlan crates/webcodex-runner-registry/src/job_updates/start.rs:166 — ClassTooLong — 482 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 2 blocks, lines 166-786. The bar is 400 significant lines; this is 82 over it, 1.21× 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: CloudflareControl src/cloudflare_ingress.rs:58 — ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 4 blocks, lines 58-997. The bar is 400 significant lines; this is 70 over it, 1.18× 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: AdminProjectLifecycleService src/admin_project_lifecycle.rs:119 — ClassTooLong — 456 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 119-695. The bar is 400 significant lines; this is 56 over it, 1.14× 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: PluginManager crates/webcodex-runner/src/webcodex_runner/plugin.rs:43 — ClassTooLong — 434 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 3 blocks, lines 43-927. The bar is 400 significant lines; this is 34 over it, 1.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: UpdateManager crates/webcodex-environment/src/unified_update/download.rs:151 — ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 151-669. The bar is 400 significant lines; this is 9 over it, 1.02× 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×15
  • Members sharing a duplicated core (4 members, 50+ identical tokens) apps/desktop/src-tauri/src/state/path_inventory.rs:47 — apps/desktop/src-tauri/src/state/path_inventory.rs:47-57 | apps/desktop/src-tauri/src/state/path_inventory.rs:62-74 | apps/desktop/src-tauri/src/state/path_inventory.rs:79-95 | apps/desktop/src-tauri/src/state/path_inventory.rs:100-116 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) apps/desktop/src-tauri/src/state/persistence.rs:175 — apps/desktop/src-tauri/src/state/persistence.rs:175-203 | crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:325-355 | crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:542-566 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2154-2181 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-admin/src/commands.rs:804 — crates/webcodex-admin/src/commands.rs:804-830 | crates/webcodex-cli/src/webcodex_cli/pairing.rs:7-48 | crates/webcodex-cli/src/webcodex_cli/server.rs:512-542 | crates/webcodex-runner-config/src/lib.rs:155-181 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-browser/src/supervisor.rs:526 — crates/webcodex-browser/src/supervisor.rs:526-536 | crates/webcodex-browser/src/supervisor.rs:538-564 | crates/webcodex-browser/src/supervisor.rs:566-593 | crates/webcodex-browser/src/supervisor.rs:602-721 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-lsp/src/navigation.rs:450 — crates/webcodex-lsp/src/navigation.rs:450-494 | crates/webcodex-lsp/src/navigation.rs:559-610 | crates/webcodex-lsp/src/navigation.rs:622-674 | crates/webcodex-lsp/src/navigation.rs:711-940 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-runner-registry/src/jobs.rs:368 — crates/webcodex-runner-registry/src/jobs.rs:368-406 | crates/webcodex-runner/src/webcodex_runner/detached_job/model.rs:540-567 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:40-80 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:82-116 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-runner-registry/src/projects.rs:200 — crates/webcodex-runner-registry/src/projects.rs:200-215 | crates/webcodex-runner-registry/src/projects.rs:257-273 | crates/webcodex-runner-registry/src/runners.rs:718-738 | crates/webcodex-runner-registry/src/runners.rs:789-827 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-runner-registry/src/requests.rs:1992 — crates/webcodex-runner-registry/src/requests.rs:1992-2048 | crates/webcodex-runner-registry/src/requests.rs:2060-2115 | crates/webcodex-runner-registry/src/requests.rs:2188-2245 | crates/webcodex-runner-registry/src/requests.rs:2259-2328 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-store/src/artifact_handoff.rs:620 — crates/webcodex-store/src/artifact_handoff.rs:620-704 | crates/webcodex-store/src/artifact_handoff.rs:737-781 | crates/webcodex-store/src/artifact_handoff.rs:793-849 | crates/webcodex-store/src/artifact_handoff.rs:861-936 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-store/src/oauth.rs:539 — crates/webcodex-store/src/oauth.rs:539-682 | crates/webcodex-store/src/oauth.rs:686-716 | crates/webcodex-store/src/oauth.rs:781-812 | crates/webcodex-store/src/oauth.rs:919-1081 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/oauth_http/managed_authorize.rs:514 — src/oauth_http/managed_authorize.rs:514-639 | src/oauth_http/managed_authorize.rs:646-787 | src/oauth_http/metadata.rs:23-57 | src/oauth_http/metadata.rs:64-98 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/runner_tokens_http/routes.rs:66 — src/runner_tokens_http/routes.rs:66-150 | src/runner_tokens_http/routes.rs:162-252 | src/users_http/tokens.rs:78-147 | src/users_http/tokens.rs:150-219 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/tool_runtime/process.rs:545 — src/tool_runtime/process.rs:545-766 | src/tool_runtime/process.rs:814-1143 | src/tool_runtime/script.rs:56-299 | src/tool_runtime/shell.rs:370-729 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/webcodex-runner/src/main_tests/apply_patch.rs:12 — crates/webcodex-runner/src/main_tests/apply_patch.rs:12-50 | crates/webcodex-runner/src/main_tests/apply_text_edits.rs:7-58 | crates/webcodex-runner/src/main_tests/file_read.rs:9-42 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:602-635 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/mcp_tests/file_import.rs:828 — src/mcp_tests/file_import.rs:828-949 | src/mcp_tests/file_import.rs:958-1037 | src/mcp_tests/file_import.rs:1046-1119 | src/mcp_tests/file_import.rs:1128-1213 — 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 · Duplicated block (16 lines × 2) · ×15
  • Duplicated block (16 lines × 2) apps/desktop/src-tauri/src/webcodex/settings.rs:151 — apps/desktop/src-tauri/src/webcodex/settings.rs:151-166 | apps/desktop/src-tauri/src/webcodex/settings.rs:174-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:210 — crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:210-225 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:868-883 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs` and `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:210` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (16 lines × 2) crates/webcodex-environment/src/service/linux.rs:273 — crates/webcodex-environment/src/service/linux.rs:273-288 | crates/webcodex-environment/src/service/macos.rs:223-238 — before extracting anything, compare `crates/webcodex-environment/src/service/linux.rs` and `crates/webcodex-environment/src/service/macos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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 `crates/webcodex-environment/src/service/linux.rs:273` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/webcodex-environment/src/upgrade.rs:1929 — crates/webcodex-environment/src/upgrade.rs:1929-1944 | crates/webcodex-environment/src/upgrade.rs:2226-2241 — both copies are in the same file, so extract the 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) crates/webcodex-runner-registry/src/requests.rs:926 — crates/webcodex-runner-registry/src/requests.rs:926-941 | crates/webcodex-runner-registry/src/requests.rs:1140-1155 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:926` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/webcodex-tool-contracts/src/tool_definition/documents.rs:33 — crates/webcodex-tool-contracts/src/tool_definition/documents.rs:33-48 | crates/webcodex-tool-contracts/src/tool_definition/docx.rs:32-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-tool-contracts/src/tool_definition/documents.rs:33` 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 (16 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1156 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1156-1171 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1173-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) crates/webcodex-workspace/src/project_recipe.rs:756 — crates/webcodex-workspace/src/project_recipe.rs:756-771 | crates/webcodex-workspace/src/project_recipe.rs:920-935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-workspace/src/project_recipe.rs:917` calls `starts_with` and `crates/webcodex-workspace/src/project_recipe.rs:755` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) src/tool_runtime/agent_task.rs:1127 — src/tool_runtime/agent_task.rs:1127-1142 | src/tool_runtime/agent_task.rs:1331-1346 — both copies are in the same file, so extract the 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 `src/tool_runtime/agent_task.rs:1127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) src/tool_runtime/browser_tools.rs:417 — src/tool_runtime/browser_tools.rs:417-432 | src/tool_runtime/browser_tools.rs:469-484 — both copies are in the same file, so extract the 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 `src/tool_runtime/browser_tools.rs:417` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) src/tool_runtime/coding_agent.rs:897 — src/tool_runtime/coding_agent.rs:897-912 | src/tool_runtime/coding_agent.rs:1088-1103 — both copies are in the same file, so extract the 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 `src/tool_runtime/coding_agent.rs:897` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) src/tool_runtime/review_changes.rs:287 — src/tool_runtime/review_changes.rs:287-302 | src/tool_runtime/review_changes.rs:378-393 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:318 — crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:318-333 | crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:328-343 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs` and `crates/webcodex-runner/src/webcodex_runner/validation/execute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:318` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) src/mcp_tests/fixed_scope.rs:79 — src/mcp_tests/fixed_scope.rs:79-94 | src/mcp_tests/result_app.rs:1780-1795 — 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 `src/mcp_tests/fixed_scope.rs:79` 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 (16 lines × 2) src/mcp_tests/http_transport.rs:2111 — src/mcp_tests/http_transport.rs:2111-2127 | src/mcp_tests/http_transport.rs:2372-2387 — both copies are in the same file, so extract the 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 `src/mcp_tests/http_transport.rs:2111` 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.
D1 · Cyclomatic Complexity · webcodex_workflow_session · ×14
  • webcodex_workflow_session::handoff_brief::build_handoff_brief (cyclomatic 26) crates/webcodex-workflow-session/src/handoff_brief.rs:86 — webcodex_workflow_session::handoff_brief::build_handoff_brief 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.
  • webcodex_workflow_session::continuation::compare_scopes (cyclomatic 25) crates/webcodex-workflow-session/src/continuation.rs:1555 — webcodex_workflow_session::continuation::compare_scopes 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.
  • webcodex_workflow_session::task_context::task_context_value (cyclomatic 25) crates/webcodex-workflow-session/src/task_context.rs:22 — webcodex_workflow_session::task_context::task_context_value 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.
  • webcodex_workflow_session::events::classify_failure_expectation (cyclomatic 23) crates/webcodex-workflow-session/src/events.rs:434 — webcodex_workflow_session::events::classify_failure_expectation 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.
  • webcodex_workflow_session::console::console_interaction_summary (cyclomatic 22) crates/webcodex-workflow-session/src/console.rs:879 — webcodex_workflow_session::console::console_interaction_summary 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.
  • webcodex_workflow_session::task_context::stall_diagnostic (cyclomatic 21) crates/webcodex-workflow-session/src/task_context.rs:362 — webcodex_workflow_session::task_context::stall_diagnostic 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.
  • webcodex_workflow_session::handoff_brief::project_validation (cyclomatic 20) crates/webcodex-workflow-session/src/handoff_brief.rs:582 — webcodex_workflow_session::handoff_brief::project_validation has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • webcodex_workflow_session::audit::session_input_summary_for_tool (cyclomatic 19) crates/webcodex-workflow-session/src/audit.rs:24 — webcodex_workflow_session::audit::session_input_summary_for_tool has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • webcodex_workflow_session::persistence::database::write_row (cyclomatic 19) crates/webcodex-workflow-session/src/persistence/database.rs:368 — webcodex_workflow_session::persistence::database::write_row 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.
  • webcodex_workflow_session::events::validation_output_summary_for_tool_result (cyclomatic 18) crates/webcodex-workflow-session/src/events.rs:1033 — webcodex_workflow_session::events::validation_output_summary_for_tool_result 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.
  • webcodex_workflow_session::console::build_overview (cyclomatic 17) crates/webcodex-workflow-session/src/console.rs:358 — webcodex_workflow_session::console::build_overview 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.
  • webcodex_workflow_session::console::group_exploration_activity (cyclomatic 16) crates/webcodex-workflow-session/src/console.rs:568 — webcodex_workflow_session::console::group_exploration_activity 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.
  • webcodex_workflow_session::events::classify_error_message (cyclomatic 16) crates/webcodex-workflow-session/src/events.rs:526 — webcodex_workflow_session::events::classify_error_message 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.
  • webcodex_workflow_session::events::push_lsp_result_paths (cyclomatic 16) crates/webcodex-workflow-session/src/events.rs:878 — webcodex_workflow_session::events::push_lsp_result_paths 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.
D2 · Cognitive Complexity · webcodex_browser · ×14
  • webcodex_browser::cdp::infer_control_container_labels::visit (cognitive 91) crates/webcodex-browser/src/cdp.rs:3161 — webcodex_browser::cdp::infer_control_container_labels::visit has cognitive complexity 91 (threshold 15). Drivers by points: if/else 21 (65 pts), loops 5 (21 pts), boolean chains 5 (nesting depth added 60). 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.
  • webcodex_browser::cdp::apply_dom_capabilities (cognitive 54) crates/webcodex-browser/src/cdp.rs:1999 — webcodex_browser::cdp::apply_dom_capabilities has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (47 pts), loops 4, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 30). 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.
  • webcodex_browser::cdp::clickable::admit_clickable_cards (cognitive 35) crates/webcodex-browser/src/cdp/clickable.rs:51 — webcodex_browser::cdp::clickable::admit_clickable_cards has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 4, 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.
  • webcodex_browser::cdp::cdp_call_on_websocket_until (cognitive 33) crates/webcodex-browser/src/cdp.rs:3800 — webcodex_browser::cdp::cdp_call_on_websocket_until has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 1 (2 pts), 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.
  • webcodex_browser::cdp::walk_dom_controls (cognitive 30) crates/webcodex-browser/src/cdp.rs:2399 — webcodex_browser::cdp::walk_dom_controls has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 9). 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.
  • webcodex_browser::cdp::index_dom_semantics::walk (cognitive 25) crates/webcodex-browser/src/cdp.rs:2569 — webcodex_browser::cdp::index_dom_semantics::walk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 1 (2 pts) (nesting depth added 15). 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.
  • webcodex_browser::profiles::windows::private_path (cognitive 25) crates/webcodex-browser/src/profiles/windows.rs:75 — webcodex_browser::profiles::windows::private_path has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 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.
  • webcodex_browser::cdp::walk_form_contexts (cognitive 23) crates/webcodex-browser/src/cdp.rs:2628 — webcodex_browser::cdp::walk_form_contexts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (10 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.
  • webcodex_browser::bridge::serve_peer (cognitive 21) crates/webcodex-browser/src/bridge.rs:452 — webcodex_browser::bridge::serve_peer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), match/switch 2 (4 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.
  • webcodex_browser::bridge::native::run_inner (cognitive 20) crates/webcodex-browser/src/bridge/native.rs:70 — webcodex_browser::bridge::native::run_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3, 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.
  • webcodex_browser::cdp::clickable::collect_candidates (cognitive 20) crates/webcodex-browser/src/cdp/clickable.rs:203 — webcodex_browser::cdp::clickable::collect_candidates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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.
  • webcodex_browser::bridge::serve (cognitive 19) crates/webcodex-browser/src/bridge.rs:410 — webcodex_browser::bridge::serve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), 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.
  • webcodex_browser::cdp::clickable::safe_content (cognitive 18) crates/webcodex-browser/src/cdp/clickable.rs:283 — webcodex_browser::cdp::clickable::safe_content has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • webcodex_browser::cdp::semantic_element_label (cognitive 16) crates/webcodex-browser/src/cdp.rs:3276 — webcodex_browser::cdp::semantic_element_label has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), 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 · NativeEnvironment · ×14
  • NativeEnvironment::upgrade_rollback_with_target (cognitive 77) crates/webcodex-environment/src/upgrade.rs:2162 — NativeEnvironment::upgrade_rollback_with_target has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (61 pts), boolean chains 8, loops 4 (8 pts) (nesting depth added 45). 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.
  • NativeEnvironment::doctor (cognitive 63) crates/webcodex-environment/src/native.rs:631 — NativeEnvironment::doctor has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (40 pts), match/switch 5 (14 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeEnvironment::reconcile (cognitive 55) crates/webcodex-environment/src/native.rs:1254 — NativeEnvironment::reconcile has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (37 pts), match/switch 6 (14 pts), boolean chains 4 (nesting depth added 26). 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.
  • NativeEnvironment::apply (cognitive 52) crates/webcodex-environment/src/native.rs:1433 — NativeEnvironment::apply has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (3 pts) (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.
  • NativeEnvironment::configure_cloudflare_tunnel_profile (cognitive 51) crates/webcodex-environment/src/cloudflare_tunnel.rs:1084 — NativeEnvironment::configure_cloudflare_tunnel_profile has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (34 pts), boolean chains 13, match/switch 3 (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, 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.
  • NativeEnvironment::upgrade_prepare_with_options (cognitive 49) crates/webcodex-environment/src/upgrade.rs:1655 — NativeEnvironment::upgrade_prepare_with_options has cognitive complexity 49 (threshold 15). Drivers by points: if/else 29 (45 pts), loops 2 (4 pts) (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.
  • NativeEnvironment::configure_tunnel_profile_under_lock (cognitive 48) crates/webcodex-environment/src/tunnel.rs:803 — NativeEnvironment::configure_tunnel_profile_under_lock has cognitive complexity 48 (threshold 15). Drivers by points: if/else 31 (41 pts), boolean chains 6, match/switch 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • NativeEnvironment::complete_upgrade_preparation (cognitive 35) crates/webcodex-environment/src/upgrade.rs:1881 — NativeEnvironment::complete_upgrade_preparation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeEnvironment::ensure_project_authority (cognitive 33) crates/webcodex-environment/src/native/project_addition.rs:35 — NativeEnvironment::ensure_project_authority has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeEnvironment::control_tunnel_with_observation (cognitive 32) crates/webcodex-environment/src/tunnel.rs:1343 — NativeEnvironment::control_tunnel_with_observation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 11 (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.
  • NativeEnvironment::remove_tunnel_fenced (cognitive 27) crates/webcodex-environment/src/tunnel.rs:1167 — NativeEnvironment::remove_tunnel_fenced has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 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.
  • NativeEnvironment::remove_project (cognitive 24) crates/webcodex-environment/src/native.rs:391 — NativeEnvironment::remove_project has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 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.
  • NativeEnvironment::complete_upgrade_finish (cognitive 18) crates/webcodex-environment/src/upgrade.rs:2068 — NativeEnvironment::complete_upgrade_finish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeEnvironment::control_service_for_environment (cognitive 17) crates/webcodex-environment/src/native.rs:96 — NativeEnvironment::control_service_for_environment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6 (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.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×14
  • Edited copy of a member (14 corresponding lines) src/admin_http.rs:19 — src/admin_http.rs:19-34 | src/runner_http/mod.rs:32-45 — 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) crates/webcodex-computer/src/platform/macos/accessibility.rs:598 — crates/webcodex-computer/src/platform/macos/accessibility.rs:598-611 | crates/webcodex-computer/src/platform/macos/accessibility.rs:618-631 — 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) crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:279 — crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:279-298 | crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:630-643 — 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) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:16 — apps/desktop/src-tauri/src/webcodex/settings/acp.rs:16-29 | apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:11-24 — 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) crates/webcodex-computer/src/lib.rs:1611 — crates/webcodex-computer/src/lib.rs:1611-1624 | crates/webcodex-computer/src/lib.rs:1750-1765 — 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) crates/webcodex-lsp/src/supervisor.rs:2690 — crates/webcodex-lsp/src/supervisor.rs:2690-2706 | crates/webcodex-runner/src/webcodex_runner/external_tools.rs:1362-1375 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/communication.rs:193 — crates/webcodex-tool-contracts/src/registry/output_schemas/communication.rs:193-215 | crates/webcodex-tool-contracts/src/registry/output_schemas/communication.rs:217-230 — 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) src/cloudflare_transport.rs:433 — src/cloudflare_transport.rs:433-449 | src/oauth_http/managed_authorize.rs:29-42 — 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) crates/webcodex-cli/src/webcodex_cli/service.rs:173 — crates/webcodex-cli/src/webcodex_cli/service.rs:173-186 | src/oauth_http/html.rs:4-17 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/common.rs:153 — crates/webcodex-tool-contracts/src/registry/output_schemas/common.rs:153-166 | crates/webcodex-tool-contracts/src/registry/output_schemas/common.rs:177-190 — 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) src/tool_runtime/job_terminal_wait.rs:436 — src/tool_runtime/job_terminal_wait.rs:436-449 | src/tool_runtime/job_terminal_wait.rs:456-470 — 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) crates/webcodex-validation/src/adapters/node.rs:47 — crates/webcodex-validation/src/adapters/node.rs:47-60 | crates/webcodex-validation/src/adapters/python.rs:124-141 — 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) src/mcp_tests/agent_continuation_app.rs:91 — src/mcp_tests/agent_continuation_app.rs:91-104 | src/mcp_tests/goal_plan_app.rs:11-26 — 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) scripts/e2e_project_share_roots.py:132 — scripts/e2e_project_share_roots.py:132-145 | scripts/e2e_share_oauth_restart.py:139-153 — 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.
D2 · Cognitive Complexity · RunnerRegistry · ×13
  • RunnerRegistry::poll_checked (cognitive 128) crates/webcodex-runner-registry/src/polling.rs:63 — RunnerRegistry::poll_checked has cognitive complexity 128 (threshold 15). Drivers by points: if/else 49 (116 pts), match/switch 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RunnerRegistry::update_job_checked (cognitive 88) crates/webcodex-runner-registry/src/job_updates.rs:2183 — RunnerRegistry::update_job_checked has cognitive complexity 88 (threshold 15). Drivers by points: if/else 52 (70 pts), boolean chains 18 (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.
  • RunnerRegistry::complete_checked (cognitive 80) crates/webcodex-runner-registry/src/polling.rs:505 — RunnerRegistry::complete_checked has cognitive complexity 80 (threshold 15). Drivers by points: if/else 40 (65 pts), boolean chains 9, match/switch 3 (6 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.
  • RunnerRegistry::apply_project_inventory_page_checked (cognitive 50) crates/webcodex-runner-registry/src/project_inventory.rs:200 — RunnerRegistry::apply_project_inventory_page_checked has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 14, loops 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.
  • RunnerRegistry::job_log_with_paging_for_auth (cognitive 45) crates/webcodex-runner-registry/src/job_updates.rs:1908 — RunnerRegistry::job_log_with_paging_for_auth has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 5, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RunnerRegistry::register_session (cognitive 45) crates/webcodex-runner-registry/src/runners.rs:232 — RunnerRegistry::register_session has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 7, loops 1 (3 pts), 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.
  • RunnerRegistry::job_attention_snapshot_locked (cognitive 25) crates/webcodex-runner-registry/src/job_updates.rs:1499 — RunnerRegistry::job_attention_snapshot_locked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, 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.
  • RunnerRegistry::reconcile_disconnect_checked (cognitive 25) crates/webcodex-runner-registry/src/runners.rs:1153 — RunnerRegistry::reconcile_disconnect_checked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 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.
  • RunnerRegistry::enqueue_computer_checked (cognitive 23) crates/webcodex-runner-registry/src/requests.rs:2557 — RunnerRegistry::enqueue_computer_checked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, match/switch 2 (3 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.
  • RunnerRegistry::begin_maintenance (cognitive 21) crates/webcodex-runner-registry/src/maintenance.rs:204 — RunnerRegistry::begin_maintenance has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 6 (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.
  • RunnerRegistry::select_projects_for_auth (cognitive 20) crates/webcodex-runner-registry/src/project_selection.rs:53 — RunnerRegistry::select_projects_for_auth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 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.
  • RunnerRegistry::enqueue_project_file_mutation (cognitive 19) crates/webcodex-runner-registry/src/requests.rs:962 — RunnerRegistry::enqueue_project_file_mutation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, 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.
  • RunnerRegistry::enqueue_run_with_ssh_typed (cognitive 18) crates/webcodex-runner-registry/src/requests.rs:1719 — RunnerRegistry::enqueue_run_with_ssh_typed has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 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.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×13
  • Edited copy of a member (17 corresponding lines) crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:112 — crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:112-132 | crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:134-150 — 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) src/tool_runtime/runner_instructions.rs:20 — src/tool_runtime/runner_instructions.rs:20-36 | src/tool_runtime/runner_instructions.rs:42-58 — 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) src/tool_runtime/git/diff_hunks.rs:954 — src/tool_runtime/git/diff_hunks.rs:954-970 | src/tool_runtime/git/diff_hunks.rs:972-991 — 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) crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:127 — crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:127-143 | crates/webcodex-runner/src/webcodex_runner/detached_job/store.rs:34-51 — 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) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1092 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1092-1114 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1776-1792 — 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) src/tool_runtime/closeout_projection.rs:10 — src/tool_runtime/closeout_projection.rs:10-26 | src/tool_runtime/closeout_projection.rs:32-55 — 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) crates/webcodex-core/src/coding_agent.rs:1188 — crates/webcodex-core/src/coding_agent.rs:1188-1204 | crates/webcodex-core/src/plugin.rs:453-469 — 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) apps/desktop/src-tauri/src/tunnel_config.rs:372 — apps/desktop/src-tauri/src/tunnel_config.rs:372-389 | apps/desktop/src-tauri/src/tunnel_config.rs:396-412 — 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) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:332 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:332-348 | crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:96-115 — 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) crates/webcodex-store/src/agent_continuation_reference.rs:128 — crates/webcodex-store/src/agent_continuation_reference.rs:128-144 | crates/webcodex-store/src/agent_task_attempt_reference.rs:173-190 — 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) apps/desktop/src-tauri/src/mcp_providers.rs:473 — apps/desktop/src-tauri/src/mcp_providers.rs:473-489 | crates/webcodex-process/src/program.rs:233-249 — 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) apps/desktop/src-tauri/src/webcodex/adapter.rs:82 — apps/desktop/src-tauri/src/webcodex/adapter.rs:82-98 | apps/desktop/src-tauri/src/webcodex/adapter.rs:104-120 — 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) src/oauth_http/shared_key_bridge.rs:108 — src/oauth_http/shared_key_bridge.rs:108-129 | crates/webcodex-cli/src/webcodex_cli/connect/shared_key_oauth.rs:118-134 — 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 (16 corresponding lines) · ×13
  • Edited copy of a member (16 corresponding lines) crates/webcodex-environment/src/native.rs:1935 — crates/webcodex-environment/src/native.rs:1935-1957 | crates/webcodex-runner/src/webcodex_runner/config.rs:1617-1632 — 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) crates/webcodex-core/src/coding_agent.rs:754 — crates/webcodex-core/src/coding_agent.rs:754-769 | crates/webcodex-runner/src/webcodex_runner/coding_agent/protocol.rs:445-460 — 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) crates/webcodex-core/src/model_reference.rs:21 — crates/webcodex-core/src/model_reference.rs:21-36 | src/tool_runtime/project_resolution.rs:297-312 — 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) crates/webcodex-store/src/artifact_handoff.rs:1001 — crates/webcodex-store/src/artifact_handoff.rs:1001-1016 | crates/webcodex-store/src/artifact_handoff.rs:1035-1056 — 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) crates/webcodex-cli/src/webcodex_cli/system.rs:367 — crates/webcodex-cli/src/webcodex_cli/system.rs:367-382 | crates/webcodex-cli/src/webcodex_cli/system.rs:384-403 — 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) crates/webcodex-store/src/artifact_handoff.rs:1076 — crates/webcodex-store/src/artifact_handoff.rs:1076-1092 | crates/webcodex-store/src/job_terminal_wait.rs:623-638 — 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) crates/webcodex-validation/src/adapters/mod.rs:193 — crates/webcodex-validation/src/adapters/mod.rs:193-208 | crates/webcodex-validation/src/adapters/mod.rs:210-230 — 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) crates/webcodex-environment/src/installer_authorization.rs:22 — crates/webcodex-environment/src/installer_authorization.rs:22-37 | crates/webcodex-environment/src/installer_authorization.rs:50-68 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/common.rs:313 — crates/webcodex-tool-contracts/src/registry/output_schemas/common.rs:313-329 | crates/webcodex-tool-contracts/src/registry/output_schemas/common.rs:359-374 — 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) src/tool_runtime/semantic_navigation.rs:136 — src/tool_runtime/semantic_navigation.rs:136-159 | src/tool_runtime/semantic_navigation.rs:183-198 — 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) crates/webcodex-core/src/validation_evidence.rs:717 — crates/webcodex-core/src/validation_evidence.rs:717-732 | crates/webcodex-validation/src/adapters/node.rs:28-45 — 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) crates/webcodex-browser/src/cdp.rs:1513 — crates/webcodex-browser/src/cdp.rs:1513-1528 | crates/webcodex-browser/src/cdp.rs:1535-1550 — 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) crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:727 — crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:727-746 | crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:748-763 — 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 (8 corresponding lines) · ×13
  • Edited copy of a member (8 corresponding lines) src/runtime_console_http/goals.rs:381 — src/runtime_console_http/goals.rs:381-388 | src/runtime_console_http/goals.rs:391-398 — 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) src/auth/project_share.rs:28 — src/auth/project_share.rs:28-35 | src/oauth_http/managed_authorize.rs:408-415 — 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) crates/webcodex-workflow-session/src/events.rs:206 — crates/webcodex-workflow-session/src/events.rs:206-214 | src/runtime_http.rs:567-574 — 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) src/project_entry_openai_tunnel.rs:331 — src/project_entry_openai_tunnel.rs:331-338 | src/project_entry_share.rs:455-462 — 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) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:637 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:637-644 | src/tool_runtime/skills.rs:2650-2657 — 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) crates/webcodex-environment/src/service/linux.rs:89 — crates/webcodex-environment/src/service/linux.rs:89-96 | crates/webcodex-environment/src/service/macos.rs:98-105 — 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) crates/webcodex-browser/src/bridge.rs:94 — crates/webcodex-browser/src/bridge.rs:94-101 | src/tool_runtime/git/diff_hunks.rs:322-329 — 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) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:1079 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:1079-1090 | crates/webcodex-runner/src/webcodex_runner/runner_instructions.rs:128-135 — 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) apps/desktop/src-tauri/src/operation.rs:284 — apps/desktop/src-tauri/src/operation.rs:284-291 | apps/desktop/src-tauri/src/runtime_selection.rs:106-113 — 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) crates/webcodex-runner/src/webcodex_runner/transport/bootstrap.rs:66 — crates/webcodex-runner/src/webcodex_runner/transport/bootstrap.rs:66-73 | src/tool_runtime/git/show_changes.rs:840-847 — 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) crates/webcodex-runner-registry/src/job_updates.rs:82 — crates/webcodex-runner-registry/src/job_updates.rs:82-89 | src/tool_runtime/observe_jobs.rs:49-57 — 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) scripts/collect_release_bundle.py:50 — scripts/collect_release_bundle.py:50-57 | scripts/prepare_release_metadata.py:151-158 — 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) scripts/e2e_linux_socket_activation.py:69 — scripts/e2e_linux_socket_activation.py:69-76 | scripts/e2e_session_continuity_ws.py:43-51 — 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.
D1 · Cyclomatic Complexity · RunnerRegistry · ×12
  • RunnerRegistry::update_job_checked (cyclomatic 63) crates/webcodex-runner-registry/src/job_updates.rs:2183 — RunnerRegistry::update_job_checked 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.
  • RunnerRegistry::poll_checked (cyclomatic 58) crates/webcodex-runner-registry/src/polling.rs:63 — RunnerRegistry::poll_checked has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RunnerRegistry::complete_checked (cyclomatic 44) crates/webcodex-runner-registry/src/polling.rs:505 — RunnerRegistry::complete_checked 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.
  • RunnerRegistry::apply_project_inventory_page_checked (cyclomatic 40) crates/webcodex-runner-registry/src/project_inventory.rs:200 — RunnerRegistry::apply_project_inventory_page_checked 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.
  • RunnerRegistry::register_session (cyclomatic 37) crates/webcodex-runner-registry/src/runners.rs:232 — RunnerRegistry::register_session 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.
  • RunnerRegistry::enqueue_computer_checked (cyclomatic 35) crates/webcodex-runner-registry/src/requests.rs:2557 — RunnerRegistry::enqueue_computer_checked has cyclomatic complexity 35 (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.
  • RunnerRegistry::job_log_with_paging_for_auth (cyclomatic 22) crates/webcodex-runner-registry/src/job_updates.rs:1908 — RunnerRegistry::job_log_with_paging_for_auth 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.
  • RunnerRegistry::enqueue_project_file_mutation (cyclomatic 20) crates/webcodex-runner-registry/src/requests.rs:962 — RunnerRegistry::enqueue_project_file_mutation 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.
  • RunnerRegistry::begin_maintenance (cyclomatic 18) crates/webcodex-runner-registry/src/maintenance.rs:204 — RunnerRegistry::begin_maintenance 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.
  • RunnerRegistry::enqueue_run_with_ssh_typed (cyclomatic 17) crates/webcodex-runner-registry/src/requests.rs:1719 — RunnerRegistry::enqueue_run_with_ssh_typed has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: RunnerRegistry::enqueue_browser (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • RunnerRegistry::reconcile_disconnect_checked (cyclomatic 17) crates/webcodex-runner-registry/src/runners.rs:1153 — RunnerRegistry::reconcile_disconnect_checked 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.
  • RunnerRegistry::job_attention_snapshot_locked (cyclomatic 16) crates/webcodex-runner-registry/src/job_updates.rs:1499 — RunnerRegistry::job_attention_snapshot_locked 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 · NativeEnvironment · ×12
  • NativeEnvironment::configure_cloudflare_tunnel_profile (cyclomatic 45) crates/webcodex-environment/src/cloudflare_tunnel.rs:1084 — NativeEnvironment::configure_cloudflare_tunnel_profile has cyclomatic complexity 45 (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.
  • NativeEnvironment::reconcile (cyclomatic 38) crates/webcodex-environment/src/native.rs:1254 — NativeEnvironment::reconcile has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeEnvironment::apply (cyclomatic 35) crates/webcodex-environment/src/native.rs:1433 — NativeEnvironment::apply 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.
  • NativeEnvironment::upgrade_rollback_with_target (cyclomatic 32) crates/webcodex-environment/src/upgrade.rs:2162 — NativeEnvironment::upgrade_rollback_with_target 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.
  • NativeEnvironment::configure_tunnel_profile_under_lock (cyclomatic 31) crates/webcodex-environment/src/tunnel.rs:803 — NativeEnvironment::configure_tunnel_profile_under_lock 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.
  • NativeEnvironment::doctor (cyclomatic 29) crates/webcodex-environment/src/native.rs:631 — NativeEnvironment::doctor 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.
  • NativeEnvironment::control_tunnel_with_observation (cyclomatic 27) crates/webcodex-environment/src/tunnel.rs:1343 — NativeEnvironment::control_tunnel_with_observation 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.
  • NativeEnvironment::upgrade_prepare_with_options (cyclomatic 26) crates/webcodex-environment/src/upgrade.rs:1655 — NativeEnvironment::upgrade_prepare_with_options 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.
  • NativeEnvironment::ensure_project_authority (cyclomatic 22) crates/webcodex-environment/src/native/project_addition.rs:35 — NativeEnvironment::ensure_project_authority 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.
  • NativeEnvironment::complete_upgrade_preparation (cyclomatic 20) crates/webcodex-environment/src/upgrade.rs:1881 — NativeEnvironment::complete_upgrade_preparation 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.
  • NativeEnvironment::remove_tunnel_fenced (cyclomatic 18) crates/webcodex-environment/src/tunnel.rs:1167 — NativeEnvironment::remove_tunnel_fenced 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.
  • NativeEnvironment::remove_project (cyclomatic 17) crates/webcodex-environment/src/native.rs:391 — NativeEnvironment::remove_project 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×12
  • Duplicated block (19 lines × 2) apps/desktop/src-tauri/src/state/environment.rs:381 — apps/desktop/src-tauri/src/state/environment.rs:381-399 | apps/desktop/src-tauri/src/state/environment.rs:1049-1067 — both copies are in the same file, so extract the 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 `apps/desktop/src-tauri/src/state/environment.rs:381` 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 (19 lines × 2) crates/webcodex-environment/src/service/linux.rs:66 — crates/webcodex-environment/src/service/linux.rs:66-84 | crates/webcodex-environment/src/service/macos.rs:65-83 — before extracting anything, compare `crates/webcodex-environment/src/service/linux.rs` and `crates/webcodex-environment/src/service/macos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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 `crates/webcodex-environment/src/service/linux.rs: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 (19 lines × 2) crates/webcodex-runner-registry/src/job_updates.rs:1397 — crates/webcodex-runner-registry/src/job_updates.rs:1397-1415 | crates/webcodex-runner-registry/src/job_updates.rs:1425-1443 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/job_updates.rs:1397` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/webcodex-runner-registry/src/requests.rs:936 — crates/webcodex-runner-registry/src/requests.rs:936-954 | crates/webcodex-runner-registry/src/requests.rs:1078-1096 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:936` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:50 — crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:50-68 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:90-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/run.rs:153 — crates/webcodex-runner/src/webcodex_runner/shell/run.rs:153-171 | crates/webcodex-runner/src/webcodex_runner/shell/run.rs:183-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:434 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:434-452 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:472-490 — both copies are in the same file, so extract the 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, `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:453` calls `copy_keys` and `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:491` 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 (19 lines × 2) src/mcp/tools/call/specialized.rs:239 — src/mcp/tools/call/specialized.rs:239-257 | src/mcp/tools/call/specialized.rs:275-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/mcp/tools/call/specialized.rs:239` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) src/oauth_http/managed_authorize.rs:807 — src/oauth_http/managed_authorize.rs:807-825 | src/oauth_http/shared_key_bridge.rs:980-998 — 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 (19 lines × 2) src/tool_runtime/skills.rs:769 — src/tool_runtime/skills.rs:769-787 | src/tool_runtime/skills.rs:1515-1533 — both copies are in the same file, so extract the 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 `src/tool_runtime/skills.rs:769` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) src/oauth_http/managed_authorize.rs:1027 — src/oauth_http/managed_authorize.rs:1027-1045 | src/oauth_http/managed_authorize.rs:1048-1066 — both copies are in the same file, so extract the 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 `src/oauth_http/managed_authorize.rs:1027` 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 (19 lines × 2) src/mcp_tests/agent_continuation_app.rs:120 — src/mcp_tests/agent_continuation_app.rs:120-138 | src/mcp_tests/job_terminal_continuation_app.rs:35-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×12
  • Duplicated block (18 lines × 2) crates/webcodex-browser/src/cdp.rs:2423 — crates/webcodex-browser/src/cdp.rs:2423-2440 | crates/webcodex-browser/src/cdp.rs:2659-2676 — both copies are in the same file, so extract the 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 `crates/webcodex-browser/src/cdp.rs:2423` 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 (18 lines × 2) crates/webcodex-environment/src/service/linux.rs:303 — crates/webcodex-environment/src/service/linux.rs:303-320 | crates/webcodex-environment/src/service/macos.rs:251-268 — before extracting anything, compare `crates/webcodex-environment/src/service/linux.rs` and `crates/webcodex-environment/src/service/macos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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 `crates/webcodex-environment/src/service/linux.rs: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 (18 lines × 2) crates/webcodex-environment/src/storage.rs:499 — crates/webcodex-environment/src/storage.rs:499-516 | src/upgrade_maintenance_store.rs:45-62 — before extracting anything, compare `crates/webcodex-environment/src/storage.rs` and `src/upgrade_maintenance_store.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/storage.rs:499` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:221 — crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:221-238 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:771-788 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:221` 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 (18 lines × 2) crates/webcodex-store/src/activity.rs:153 — crates/webcodex-store/src/activity.rs:153-170 | crates/webcodex-store/src/activity.rs:217-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:772 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:772-789 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:806-823 — both copies are in the same file, so extract the 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, `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:826` calls `copy_keys` and `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:790` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) crates/webcodex-workspace/src/project_context.rs:434 — crates/webcodex-workspace/src/project_context.rs:434-451 | crates/webcodex-workspace/src/project_context.rs:453-470 — both copies are in the same file, so extract the 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 `crates/webcodex-workspace/src/project_context.rs:434` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) src/runner_tokens_http/routes.rs:323 — src/runner_tokens_http/routes.rs:323-340 | src/users_http/tokens.rs:277-294 — before extracting anything, compare `src/runner_tokens_http/routes.rs` and `src/users_http/tokens.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_tokens_http/routes.rs:323` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) src/ssh_resource_gateway.rs:503 — src/ssh_resource_gateway.rs:503-520 | src/ssh_resource_gateway.rs:541-558 — both copies are in the same file, so extract the 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 `src/ssh_resource_gateway.rs:503` 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 (18 lines × 2) src/tool_runtime/communication.rs:787 — src/tool_runtime/communication.rs:787-804 | src/tool_runtime/communication.rs:899-916 — both copies are in the same file, so extract the 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 `src/tool_runtime/communication.rs:787` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) src/tool_runtime/files/inspection.rs:1167 — src/tool_runtime/files/inspection.rs:1167-1184 | src/tool_runtime/files/inspection.rs:1447-1464 — both copies are in the same file, so extract the 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 `src/tool_runtime/files/inspection.rs:1167` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) src/mcp_tests/artifact_export.rs:53 — src/mcp_tests/artifact_export.rs:53-70 | src/mcp_tests/file_import.rs:343-360 — 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 `src/mcp_tests/artifact_export.rs:53` 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×12
  • Duplicated block (9 lines × 3) crates/webcodex-runner-registry/src/jobs.rs:378 — crates/webcodex-runner-registry/src/jobs.rs:378-386 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:53-61 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:93-101 — 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 `crates/webcodex-runner-registry/src/jobs.rs:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/webcodex-runner/src/webcodex_runner/job_manager/delivery.rs:81 — crates/webcodex-runner/src/webcodex_runner/job_manager/delivery.rs:81-89 | crates/webcodex-runner/src/webcodex_runner/job_manager/delivery.rs:602-610 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:23-31 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:853 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:853-861 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:922-930 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:979-987 — 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 `crates/webcodex-runner/src/webcodex_runner/skill_store.rs:853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/mcp/tools/call/specialized.rs:76 — src/mcp/tools/call/specialized.rs:76-84 | src/mcp/tools/call/specialized.rs:90-98 | src/mcp/tools/call/specialized.rs:307-315 — 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 `src/mcp/tools/call/specialized.rs:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/project_entry_cloudflared.rs:622 — src/project_entry_cloudflared.rs:622-630 | src/project_entry_setup.rs:1166-1174 | src/project_entry_setup.rs:1229-1237 — before extracting anything, compare `src/project_entry_cloudflared.rs` and `src/project_entry_setup.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `src/project_entry_cloudflared.rs:622` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/tool_runtime/coding_agent.rs:2101 — src/tool_runtime/coding_agent.rs:2101-2109 | src/tool_runtime/git/diff_hunks.rs:236-244 | src/tool_runtime/git/diff_hunks.rs:265-273 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) crates/webcodex-runner-registry/src/requests.rs:911 — crates/webcodex-runner-registry/src/requests.rs:911-919 | crates/webcodex-runner-registry/src/requests.rs:985-993 | crates/webcodex-runner-registry/src/requests.rs:1127-1135 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner-registry/src/requests.rs:984` calls `apply_text_edits_capability_requirements` and `crates/webcodex-runner-registry/src/requests.rs:910` 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 (9 lines × 3) crates/webcodex-runner/src/webcodex_runner/files.rs:137 — crates/webcodex-runner/src/webcodex_runner/files.rs:137-145 | crates/webcodex-runner/src/webcodex_runner/files.rs:502-510 | crates/webcodex-runner/src/webcodex_runner/runner_skills.rs:505-513 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `code` to `&'static str` in one and `&str` 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 (9 lines × 3) crates/webcodex-core/src/runner_operation.rs:2389 — crates/webcodex-core/src/runner_operation.rs:2389-2397 | crates/webcodex-core/src/runner_operation.rs:2403-2414 | crates/webcodex-core/src/runner_operation.rs:2420-2431 — 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 `crates/webcodex-core/src/runner_operation.rs:2389` 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 × 3) src/tool_runtime/coding_task/closeout.rs:43 — src/tool_runtime/coding_task/closeout.rs:43-51 | src/tool_runtime/session_tools.rs:438-446 | src/tool_runtime/validation_events.rs:54-62 — 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 `src/tool_runtime/coding_task/closeout.rs:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/webcodex-environment/src/service/linux.rs:350 — crates/webcodex-environment/src/service/linux.rs:350-358 | crates/webcodex-environment/src/service/macos.rs:288-296 | crates/webcodex-environment/src/service/windows.rs:834-842 — before extracting anything, compare `crates/webcodex-environment/src/service/linux.rs` and `crates/webcodex-environment/src/service/macos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 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 `crates/webcodex-environment/src/service/linux.rs:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) scripts/release_readiness.py:173 — scripts/release_readiness.py:173-181 | scripts/release_readiness.py:286-294 | scripts/release_readiness.py:334-342 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×12
  • Duplicated block (6 lines × 3) apps/desktop/src-tauri/src/diagnostics.rs:624 — apps/desktop/src-tauri/src/diagnostics.rs:624-631 | src/project_entry_cloudflared.rs:625-630 | src/project_entry_setup.rs:1169-1174 — before extracting anything, compare `src/project_entry_cloudflared.rs` and `src/project_entry_setup.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) crates/webcodex-core/src/mcp_gateway.rs:649 — crates/webcodex-core/src/mcp_gateway.rs:649-654 | src/mcp/resources.rs:557-562 | src/tool_runtime/computer_tools/snapshot_receipts.rs:175-180 — 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 `crates/webcodex-core/src/mcp_gateway.rs:649` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/webcodex-environment/src/migration.rs:367 — crates/webcodex-environment/src/migration.rs:367-372 | crates/webcodex-environment/src/migration.rs:404-409 | crates/webcodex-environment/src/migration.rs:433-438 — 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 `crates/webcodex-environment/src/migration.rs:367` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 3) crates/webcodex-store/src/agent_wait.rs:574 — crates/webcodex-store/src/agent_wait.rs:574-579 | crates/webcodex-store/src/communication.rs:2510-2515 | crates/webcodex-store/src/communication.rs:2770-2775 — before extracting anything, compare `crates/webcodex-store/src/agent_wait.rs` and `crates/webcodex-store/src/communication.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `crates/webcodex-store/src/agent_wait.rs:574` 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) src/tool_runtime/external_observations.rs:98 — src/tool_runtime/external_observations.rs:98-103 | src/tool_runtime/session_tools.rs:440-447 | src/tool_runtime/validation_events.rs:56-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/external_observations.rs:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) src/tool_runtime/memory.rs:169 — src/tool_runtime/memory.rs:169-174 | src/tool_runtime/memory.rs:250-255 | src/tool_runtime/runtime_info.rs:1036-1041 — 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 `src/tool_runtime/memory.rs:169` 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) src/tool_runtime/computer_tools/input_receipts.rs:86 — src/tool_runtime/computer_tools/input_receipts.rs:86-91 | src/tool_runtime/computer_tools/input_receipts.rs:118-123 | src/tool_runtime/computer_tools/input_receipts.rs:291-296 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/webcodex-core/src/skill_store.rs:113 — crates/webcodex-core/src/skill_store.rs:113-118 | crates/webcodex-workspace/src/file_read_range.rs:556-561 | src/tool_runtime/skills.rs:2666-2671 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) crates/webcodex-workspace/src/project_overview.rs:992 — crates/webcodex-workspace/src/project_overview.rs:992-997 | crates/webcodex-workspace/src/project_overview.rs:1078-1083 | crates/webcodex-workspace/src/project_overview.rs:1120-1125 — 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 `crates/webcodex-workspace/src/project_overview.rs:992` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:43 — crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:43-48 | src/agent_wake.rs:147-152 | src/tool_runtime/coding_agent.rs:1751-1756 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) src/mcp_tests/file_import.rs:779 — src/mcp_tests/file_import.rs:779-784 | src/mcp_tests/file_import.rs:1234-1239 | src/mcp_tests/file_import.rs:1312-1317 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) src/mcp_tests/file_import.rs:265 — src/mcp_tests/file_import.rs:265-270 | src/mcp_tests/fixed_scope.rs:26-31 | src/mcp_tests/http_transport.rs:892-897 — 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.
D2 · Cognitive Complexity · JobManager · ×11
  • JobManager::start_prepared_shell_job (cognitive 86) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:69 — JobManager::start_prepared_shell_job has cognitive complexity 86 (threshold 15). Drivers by points: if/else 34 (63 pts), match/switch 5 (13 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • JobManager::start_ssh_shell_job (cognitive 59) crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs:56 — JobManager::start_ssh_shell_job has cognitive complexity 59 (threshold 15). Drivers by points: if/else 29 (43 pts), match/switch 6 (9 pts), boolean chains 4, loops 2 (3 pts) (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.
  • JobManager::start_shell_job (cognitive 52) crates/webcodex-runner/src/webcodex_runner/job_manager/local_shell.rs:6 — JobManager::start_shell_job has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (27 pts), match/switch 6 (13 pts), boolean chains 11, loops 1 (nesting depth added 13). 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.
  • JobManager::start_structured_job (cognitive 28) crates/webcodex-runner/src/webcodex_runner/job_manager/process.rs:8 — JobManager::start_structured_job has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 3 (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.
  • JobManager::replay_snapshots_since (cognitive 23) crates/webcodex-runner/src/webcodex_runner/job_manager/delivery.rs:553 — JobManager::replay_snapshots_since has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, 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.
  • JobManager::start_detached_process_job (cognitive 23) crates/webcodex-runner/src/webcodex_runner/job_manager/detached.rs:302 — JobManager::start_detached_process_job has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 6 (7 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.
  • JobManager::record_update (cognitive 23) crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:136 — JobManager::record_update has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • JobManager::stop (cognitive 20) crates/webcodex-runner/src/webcodex_runner/job_manager/shutdown.rs:249 — JobManager::stop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • JobManager::start_available_queued (cognitive 19) crates/webcodex-runner/src/webcodex_runner/job_manager/admission.rs:468 — JobManager::start_available_queued has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • JobManager::enqueue (cognitive 17) crates/webcodex-runner/src/webcodex_runner/job_manager/admission.rs:284 — JobManager::enqueue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • JobManager::recover_detached_jobs (cognitive 16) crates/webcodex-runner/src/webcodex_runner/job_manager/detached.rs:98 — JobManager::recover_detached_jobs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · webcodex_runner_registry · ×11
  • webcodex_runner_registry::reconciliation::validate_snapshot (cognitive 81) crates/webcodex-runner-registry/src/reconciliation.rs:141 — webcodex_runner_registry::reconciliation::validate_snapshot has cognitive complexity 81 (threshold 15). Drivers by points: if/else 28 (46 pts), boolean chains 26, match/switch 4 (9 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.
  • webcodex_runner_registry::validation::validate_file_request (cognitive 71) crates/webcodex-runner-registry/src/validation.rs:273 — webcodex_runner_registry::validation::validate_file_request has cognitive complexity 71 (threshold 15). Drivers by points: if/else 35 (55 pts), boolean chains 12, match/switch 3 (4 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.
  • webcodex_runner_registry::requests::resolve_disconnected_sync_requests_locked (cognitive 36) crates/webcodex-runner-registry/src/requests.rs:383 — webcodex_runner_registry::requests::resolve_disconnected_sync_requests_locked has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 1, 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.
  • webcodex_runner_registry::job_updates::validate_validation_progress (cognitive 32) crates/webcodex-runner-registry/src/job_updates.rs:440 — webcodex_runner_registry::job_updates::validate_validation_progress has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 12 (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.
  • webcodex_runner_registry::reconciliation::reconcile_inventory_locked (cognitive 30) crates/webcodex-runner-registry/src/reconciliation.rs:1017 — webcodex_runner_registry::reconciliation::reconcile_inventory_locked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 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.
  • webcodex_runner_registry::reconciliation::preflight_inventory_locked (cognitive 29) crates/webcodex-runner-registry/src/reconciliation.rs:567 — webcodex_runner_registry::reconciliation::preflight_inventory_locked has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, 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.
  • webcodex_runner_registry::validation::validate_project_summary (cognitive 28) crates/webcodex-runner-registry/src/validation.rs:669 — webcodex_runner_registry::validation::validate_project_summary has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 12 (13 pts) (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.
  • webcodex_runner_registry::runners::validate_coding_agent_registration (cognitive 24) crates/webcodex-runner-registry/src/runners.rs:41 — webcodex_runner_registry::runners::validate_coding_agent_registration has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner_registry::job_updates::validate_job_activity (cognitive 23) crates/webcodex-runner-registry/src/job_updates.rs:561 — webcodex_runner_registry::job_updates::validate_job_activity has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_runner_registry::reconciliation::validate_context (cognitive 22) crates/webcodex-runner-registry/src/reconciliation.rs:59 — webcodex_runner_registry::reconciliation::validate_context has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, 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.
  • webcodex_runner_registry::reconciliation::validate_job_inventory_inner (cognitive 16) crates/webcodex-runner-registry/src/reconciliation.rs:418 — webcodex_runner_registry::reconciliation::validate_job_inventory_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×11
  • Duplicated block (21 lines × 2) crates/webcodex-persistent-shell/src/opening.rs:14 — crates/webcodex-persistent-shell/src/opening.rs:14-34 | crates/webcodex-persistent-shell/src/opening.rs:95-115 — both copies are in the same file, so extract the 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 `crates/webcodex-persistent-shell/src/opening.rs:14` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) crates/webcodex-persistent-shell/src/unix.rs:344 — crates/webcodex-persistent-shell/src/unix.rs:344-364 | crates/webcodex-persistent-shell/src/windows.rs:309-329 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-persistent-shell/src/windows.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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 `crates/webcodex-persistent-shell/src/unix.rs:344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-persistent-shell/src/unix.rs:343` calls `sync_channel` and `crates/webcodex-persistent-shell/src/windows.rs:308` 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 (21 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:67 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:67-87 | src/tool_runtime/files/artifacts.rs:120-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (21 lines × 2) crates/webcodex-runner/src/webcodex_runner/persistent_shell/ssh.rs:144 — crates/webcodex-runner/src/webcodex_runner/persistent_shell/ssh.rs:144-164 | crates/webcodex-runner/src/webcodex_runner/persistent_shell/ssh.rs:230-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. 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 (21 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:181 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:181-201 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:339-359 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/shell/process.rs` and `crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 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 `crates/webcodex-runner/src/webcodex_runner/shell/process.rs:181` 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 (21 lines × 2) crates/webcodex-store/src/agent_wake.rs:687 — crates/webcodex-store/src/agent_wake.rs:687-707 | crates/webcodex-store/src/agent_wake.rs:1067-1087 — both copies are in the same file, so extract the 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 (21 lines × 2) crates/webcodex-store/src/goal.rs:930 — crates/webcodex-store/src/goal.rs:930-950 | crates/webcodex-store/src/goal.rs:1033-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/goal.rs:930` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) src/oauth_http/project_share.rs:62 — src/oauth_http/project_share.rs:62-82 | src/oauth_http/shared_key_bridge.rs:458-478 — before extracting anything, compare `src/oauth_http/project_share.rs` and `src/oauth_http/shared_key_bridge.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 (21 lines × 2) crates/webcodex-cli/src/webcodex_cli/project.rs:678 — crates/webcodex-cli/src/webcodex_cli/project.rs:678-698 | crates/webcodex-cli/src/webcodex_cli/project.rs:711-731 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/project.rs:678` 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 (21 lines × 2) src/oauth_http/project_share.rs:97 — src/oauth_http/project_share.rs:97-117 | src/oauth_http/shared_key_bridge.rs:482-502 — before extracting anything, compare `src/oauth_http/project_share.rs` and `src/oauth_http/shared_key_bridge.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `src/oauth_http/project_share.rs:97` 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 (21 lines × 2) crates/webcodex-cli/src/webcodex_cli/project.rs:902 — crates/webcodex-cli/src/webcodex_cli/project.rs:902-922 | crates/webcodex-cli/src/webcodex_cli/project.rs:929-949 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/project.rs:902` 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×11
  • Duplicated block (8 lines × 3) crates/webcodex-cli/src/webcodex_cli/pairing.rs:15 — crates/webcodex-cli/src/webcodex_cli/pairing.rs:15-22 | crates/webcodex-cli/src/webcodex_cli/server.rs:513-520 | crates/webcodex-runner-config/src/lib.rs:163-170 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/pairing.rs` and `crates/webcodex-runner-config/src/lib.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/pairing.rs:15` 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 first that the copies are not typed on the same thing: the declarations holding them bind `opts` to `&ServerStatusOptions` in one and `&RunnerInitOptions` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) crates/webcodex-cli/src/webcodex_cli/system.rs:452 — crates/webcodex-cli/src/webcodex_cli/system.rs:452-459 | crates/webcodex-cli/src/webcodex_cli/system.rs:479-486 | crates/webcodex-cli/src/webcodex_cli/system.rs:521-528 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:215 — crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:215-222 | crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:312-319 | crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:334-341 — 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 `crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/runtime_console_http/window_collaboration.rs:46 — src/runtime_console_http/window_collaboration.rs:46-53 | src/runtime_console_http/window_queries.rs:235-242 | src/runtime_console_http/window_queries.rs:347-354 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (8 lines × 3) src/tool_runtime/docx_document.rs:79 — src/tool_runtime/docx_document.rs:79-86 | src/tool_runtime/pdf_document.rs:73-80 | src/tool_runtime/pdf_document.rs:149-156 — before extracting anything, compare `src/tool_runtime/docx_document.rs` and `src/tool_runtime/pdf_document.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `src/tool_runtime/docx_document.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/tool_runtime/skills.rs:1707 — src/tool_runtime/skills.rs:1707-1714 | src/tool_runtime/skills.rs:1808-1815 | src/tool_runtime/skills.rs:1894-1901 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/webcodex-runner/src/webcodex_runner/output_text.rs:447 — crates/webcodex-runner/src/webcodex_runner/output_text.rs:447-454 | crates/webcodex-runner/src/webcodex_runner/shell/output.rs:40-47 | crates/webcodex-workspace/src/file_read_range.rs:280-287 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (8 lines × 3) apps/desktop/src-tauri/src/webcodex/adapter.rs:229 — apps/desktop/src-tauri/src/webcodex/adapter.rs:229-236 | apps/desktop/src-tauri/src/webcodex/adapter.rs:569-577 | apps/desktop/src-tauri/src/webcodex/adapter.rs:807-815 — 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 `apps/desktop/src-tauri/src/webcodex/adapter.rs:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) src/mcp_tests/file_import.rs:940 — src/mcp_tests/file_import.rs:940-947 | src/mcp_tests/file_import.rs:1028-1035 | src/mcp_tests/file_import.rs:1110-1117 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) src/mcp_tests/file_import.rs:1019 — src/mcp_tests/file_import.rs:1019-1026 | src/mcp_tests/file_import.rs:1101-1108 | src/mcp_tests/file_import.rs:1269-1276 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) src/mcp_tests/http_transport.rs:322 — src/mcp_tests/http_transport.rs:322-329 | src/mcp_tests/http_transport.rs:400-407 | src/mcp_tests/http_transport/client_window.rs:799-806 — 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.
D1 · Cyclomatic Complexity · webcodex_desktop · ×10
  • webcodex_desktop::webcodex::settings::acp::reconcile_document (cyclomatic 23) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:31 — webcodex_desktop::webcodex::settings::acp::reconcile_document 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.
  • webcodex_desktop::webcodex::settings::mcp::reconcile_document (cyclomatic 23) apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:26 — webcodex_desktop::webcodex::settings::mcp::reconcile_document 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.
  • webcodex_desktop::webcodex::cli::run_bounded_until (cyclomatic 22) apps/desktop/src-tauri/src/webcodex/cli.rs:401 — webcodex_desktop::webcodex::cli::run_bounded_until has cyclomatic complexity 22 (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.
  • webcodex_desktop::tray::build_menu (cyclomatic 20) apps/desktop/src-tauri/src/tray.rs:393 — webcodex_desktop::tray::build_menu 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.
  • webcodex_desktop::tray::handle_menu_event (cyclomatic 19) apps/desktop/src-tauri/src/tray.rs:547 — webcodex_desktop::tray::handle_menu_event has cyclomatic complexity 19 (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.
  • webcodex_desktop::updates::install::native::macos::launch (cyclomatic 19) apps/desktop/src-tauri/src/updates/install/native.rs:248 — webcodex_desktop::updates::install::native::macos::launch 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.
  • webcodex_desktop::state::environment::validate_legacy_runner_layout (cyclomatic 18) apps/desktop/src-tauri/src/state/environment.rs:26 — webcodex_desktop::state::environment::validate_legacy_runner_layout 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.
  • webcodex_desktop::state::operation_completion::reconcile_after_operation_failure (cyclomatic 17) apps/desktop/src-tauri/src/state/operation_completion.rs:174 — webcodex_desktop::state::operation_completion::reconcile_after_operation_failure 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.
  • webcodex_desktop::mcp_providers::validate_profile (cyclomatic 16) apps/desktop/src-tauri/src/mcp_providers.rs:490 — webcodex_desktop::mcp_providers::validate_profile 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.
  • webcodex_desktop::project_inventory::unregister_batch (cyclomatic 16) apps/desktop/src-tauri/src/project_inventory.rs:177 — webcodex_desktop::project_inventory::unregister_batch 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×10
  • Edited copy of a member (20 corresponding lines) apps/desktop/src-tauri/src/coding_agents.rs:260 — apps/desktop/src-tauri/src/coding_agents.rs:260-279 | apps/desktop/src-tauri/src/mcp_providers.rs:585-604 — 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) crates/webcodex-admin/src/commands.rs:429 — crates/webcodex-admin/src/commands.rs:429-448 | crates/webcodex-admin/src/commands.rs:450-478 — 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) crates/webcodex-environment/src/service/linux.rs:480 — crates/webcodex-environment/src/service/linux.rs:480-500 | crates/webcodex-environment/src/service/linux.rs:502-521 — 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) crates/webcodex-environment/src/unified_update/discovery.rs:118 — crates/webcodex-environment/src/unified_update/discovery.rs:118-144 | crates/webcodex-environment/src/unified_update/network.rs:22-41 — 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) crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:416 — crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:416-438 | crates/webcodex-store/src/server_instance.rs:20-39 — 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) crates/webcodex-workflow-session/src/handoff_brief.rs:981 — crates/webcodex-workflow-session/src/handoff_brief.rs:981-1002 | crates/webcodex-workflow-session/src/handoff_brief.rs:1004-1023 — 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) src/oauth_http/project_share.rs:192 — src/oauth_http/project_share.rs:192-213 | src/oauth_http/shared_key_bridge.rs:607-626 — 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) src/tool_runtime/files/artifacts.rs:966 — src/tool_runtime/files/artifacts.rs:966-985 | src/tool_runtime/files/artifacts.rs:992-1011 — 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) crates/webcodex-runner-registry/src/jobs.rs:29 — crates/webcodex-runner-registry/src/jobs.rs:29-48 | crates/webcodex-runner-registry/src/requests.rs:114-137 — 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) src/mcp_tests/plugin_tools.rs:16 — src/mcp_tests/plugin_tools.rs:16-35 | src/mcp_tests/tools.rs:177-196 — 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 · Duplicated block (20 lines × 2) · ×10
  • Duplicated block (20 lines × 2) crates/webcodex-lsp/src/navigation.rs:591 — crates/webcodex-lsp/src/navigation.rs:591-610 | crates/webcodex-lsp/src/navigation.rs:655-674 — both copies are in the same file, so extract the 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 `crates/webcodex-lsp/src/navigation.rs:591` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) crates/webcodex-persistent-shell/src/unix.rs:50 — crates/webcodex-persistent-shell/src/unix.rs:50-69 | crates/webcodex-persistent-shell/src/windows.rs:134-153 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-persistent-shell/src/windows.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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 `crates/webcodex-persistent-shell/src/unix.rs:50` 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 (20 lines × 2) crates/webcodex-runner-registry/src/requests.rs:1191 — crates/webcodex-runner-registry/src/requests.rs:1191-1210 | crates/webcodex-runner-registry/src/requests.rs:1252-1271 — both copies are in the same file, so extract the 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 (20 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:209 — crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:209-228 | crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:328-347 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) crates/webcodex-workspace/src/project_overview.rs:58 — crates/webcodex-workspace/src/project_overview.rs:58-77 | crates/webcodex-workspace/src/project_overview.rs:781-800 — both copies are in the same file, so extract the 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) src/mcp/discovery.rs:150 — src/mcp/discovery.rs:150-169 | src/mcp/discovery.rs:302-321 — both copies are in the same file, so extract the 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 `src/mcp/discovery.rs:150` 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) src/oauth_http/shared_key_bridge.rs:815 — src/oauth_http/shared_key_bridge.rs:815-834 | src/oauth_http/shared_key_bridge.rs:922-941 — both copies are in the same file, so extract the 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, `src/oauth_http/shared_key_bridge.rs:814` calls `allowed_scopes_vec` and `src/oauth_http/shared_key_bridge.rs:921` 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) crates/webcodex-computer/src/platform/macos/accessibility.rs:72 — crates/webcodex-computer/src/platform/macos/accessibility.rs:72-91 | crates/webcodex-computer/src/platform/macos/accessibility.rs:96-115 — both copies are in the same file, so extract the 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 `crates/webcodex-computer/src/platform/macos/accessibility.rs:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) plugins/examples/python-raw/plugin.py:150 — plugins/examples/python-raw/plugin.py:150-169 | plugins/project-knowledge/plugin.py:163-182 — before extracting anything, compare `plugins/examples/python-raw/plugin.py` and `plugins/project-knowledge/plugin.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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.
  • Duplicated block (20 lines × 2) scripts/e2e_project_share_roots.py:182 — scripts/e2e_project_share_roots.py:182-201 | scripts/e2e_share_oauth_restart.py:187-206 — before extracting anything, compare `scripts/e2e_project_share_roots.py` and `scripts/e2e_share_oauth_restart.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×10
  • Duplicated block (10–11 lines × 2) apps/desktop/src-tauri/src/webcodex/adapter.rs:861 — apps/desktop/src-tauri/src/webcodex/adapter.rs:861-871 | crates/webcodex-cli/src/webcodex_cli/project.rs:364-373 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/project.rs:364` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) crates/webcodex-browser/src/cdp.rs:2448 — crates/webcodex-browser/src/cdp.rs:2448-2458 | crates/webcodex-browser/src/cdp.rs:2681-2690 — both copies are in the same file, so extract the 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 `crates/webcodex-browser/src/cdp.rs:2448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) crates/webcodex-core/src/runner_operation.rs:838 — crates/webcodex-core/src/runner_operation.rs:838-847 | crates/webcodex-core/src/runner_operation.rs:1189-1199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) crates/webcodex-environment/src/tunnel_recovery.rs:42 — crates/webcodex-environment/src/tunnel_recovery.rs:42-52 | src/project_entry_openai_tunnel.rs:377-386 — 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–11 lines × 2) crates/webcodex-runner/src/webcodex_runner/computer.rs:260 — crates/webcodex-runner/src/webcodex_runner/computer.rs:260-270 | crates/webcodex-runner/src/webcodex_runner/computer.rs:360-369 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/computer.rs: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.
  • Duplicated block (10–11 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:118 — crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:118-128 | crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:179-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10–11 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:371 — crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:371-380 | crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:441-451 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:371` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10–11 lines × 2) crates/webcodex-store/src/communication.rs:933 — crates/webcodex-store/src/communication.rs:933-942 | crates/webcodex-store/src/communication.rs:1121-1131 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/communication.rs:933` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) src/oauth_http/token.rs:134 — src/oauth_http/token.rs:134-143 | src/oauth_http/token.rs:327-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/oauth_http/token.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) src/tool_runtime/coding_task/project.rs:455 — src/tool_runtime/coding_task/project.rs:455-464 | src/tool_runtime/coding_task/project.rs:586-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/coding_task/project.rs:455` 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. 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.
D1 · Cyclomatic Complexity · webcodex_runner_registry · ×9
  • webcodex_runner_registry::reconciliation::validate_snapshot (cyclomatic 68) crates/webcodex-runner-registry/src/reconciliation.rs:141 — webcodex_runner_registry::reconciliation::validate_snapshot has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner_registry::validation::validate_file_request (cyclomatic 57) crates/webcodex-runner-registry/src/validation.rs:273 — webcodex_runner_registry::validation::validate_file_request has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_runner_registry::job_updates::validate_validation_progress (cyclomatic 28) crates/webcodex-runner-registry/src/job_updates.rs:440 — webcodex_runner_registry::job_updates::validate_validation_progress has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_runner_registry::validation::validate_project_summary (cyclomatic 28) crates/webcodex-runner-registry/src/validation.rs:669 — webcodex_runner_registry::validation::validate_project_summary has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • webcodex_runner_registry::reconciliation::validate_context (cyclomatic 21) crates/webcodex-runner-registry/src/reconciliation.rs:59 — webcodex_runner_registry::reconciliation::validate_context 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.
  • webcodex_runner_registry::reconciliation::preflight_inventory_locked (cyclomatic 20) crates/webcodex-runner-registry/src/reconciliation.rs:567 — webcodex_runner_registry::reconciliation::preflight_inventory_locked 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.
  • webcodex_runner_registry::job_updates::validate_job_activity (cyclomatic 17) crates/webcodex-runner-registry/src/job_updates.rs:561 — webcodex_runner_registry::job_updates::validate_job_activity 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.
  • webcodex_runner_registry::reconciliation::reconcile_inventory_locked (cyclomatic 17) crates/webcodex-runner-registry/src/reconciliation.rs:1017 — webcodex_runner_registry::reconciliation::reconcile_inventory_locked 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.
  • webcodex_runner_registry::runners::validate_coding_agent_registration (cyclomatic 17) crates/webcodex-runner-registry/src/runners.rs:41 — webcodex_runner_registry::runners::validate_coding_agent_registration 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.
D2 · Cognitive Complexity · webcodex_lsp · ×9
  • webcodex_lsp::fake_server::run (cognitive 127) crates/webcodex-lsp/src/fake_server.rs:21 — webcodex_lsp::fake_server::run has cognitive complexity 127 (threshold 15). Drivers by points: if/else 35 (97 pts), match/switch 5 (14 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_lsp::navigation::call_hierarchy (cognitive 31) crates/webcodex-lsp/src/navigation.rs:700 — webcodex_lsp::navigation::call_hierarchy has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (5 pts), boolean chains 2, 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.
  • webcodex_lsp::fake_server::write_result (cognitive 29) crates/webcodex-lsp/src/fake_server.rs:501 — webcodex_lsp::fake_server::write_result has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 5, boolean chains 4, loops 1 (3 pts) (nesting depth added 10). 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.
  • webcodex_lsp::navigation::normalize_call_hierarchy_calls (cognitive 19) crates/webcodex-lsp/src/navigation.rs:970 — webcodex_lsp::navigation::normalize_call_hierarchy_calls has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (9 pts), if/else 4 (7 pts), loops 2 (3 pts) (nesting depth added 7). 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.
  • webcodex_lsp::fake_server::maybe_publish_diagnostics (cognitive 18) crates/webcodex-lsp/src/fake_server.rs:376 — webcodex_lsp::fake_server::maybe_publish_diagnostics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • webcodex_lsp::navigation::normalize_document_symbols (cognitive 17) crates/webcodex-lsp/src/navigation.rs:1838 — webcodex_lsp::navigation::normalize_document_symbols has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (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.
  • webcodex_lsp::navigation::normalize_diagnostic (cognitive 16) crates/webcodex-lsp/src/navigation.rs:1592 — webcodex_lsp::navigation::normalize_diagnostic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 3 (6 pts), loops 1 (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.
  • webcodex_lsp::navigation::normalize_location_or_link (cognitive 16) crates/webcodex-lsp/src/navigation.rs:1741 — webcodex_lsp::navigation::normalize_location_or_link has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 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.
  • webcodex_lsp::protocol::read_message (cognitive 16) crates/webcodex-lsp/src/protocol.rs:74 — webcodex_lsp::protocol::read_message 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.
D3 · God Classes · TooManyFields · ×9
  • TooManyFields: SessionEvent crates/webcodex-workflow-session/src/model.rs:767 — TooManyFields — 56 stored fields. The bar is 30 stored fields; this is 26 over it, 1.87× 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: ToolRuntime src/tool_runtime/runtime.rs:106 — TooManyFields — 42 stored fields beside 522 methods. The bar is 30 stored fields; this is 12 over it, 1.40× 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: Input crates/webcodex-cli/src/environment.rs:12 — TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× 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: ShowChangesStdout src/tool_runtime/git/show_changes.rs:637 — TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× 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: ShellJobInfo crates/webcodex-core/src/runner_protocol/job.rs:1425 — TooManyFields — 40 stored fields. The bar is 30 stored fields; this is 10 over it, 1.33× 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: ShellJobRecord crates/webcodex-runner-registry/src/state.rs:414 — TooManyFields — 39 stored fields beside 2 methods. The bar is 30 stored fields; this is 9 over it, 1.30× 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: ActionAuditEventInput src/action_audit_sessions.rs:106 — TooManyFields — 36 stored fields. 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: ActionEventRecord crates/webcodex-store/src/models.rs:25 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× 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: SessionRecord crates/webcodex-workflow-session/src/model.rs:136 — TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× 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 (22 corresponding lines) · ×9
  • Edited copy of a member (22 corresponding lines) src/runner_tokens_http/routes.rs:260 — src/runner_tokens_http/routes.rs:260-286 | src/users_http/tokens.rs:226-247 — 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) src/tool_runtime/git/diff_hunks.rs:174 — src/tool_runtime/git/diff_hunks.rs:174-195 | src/tool_runtime/git/diff_hunks.rs:204-228 — 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) src/tool_runtime/goal.rs:1510 — src/tool_runtime/goal.rs:1510-1531 | src/tool_runtime/goal.rs:1539-1568 — 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) apps/desktop/src-tauri/src/state/runtime_shell.rs:77 — apps/desktop/src-tauri/src/state/runtime_shell.rs:77-98 | apps/desktop/src-tauri/src/state/runtime_shell.rs:100-128 — 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) src/tool_runtime/files/mutations/preflight.rs:65 — src/tool_runtime/files/mutations/preflight.rs:65-92 | src/tool_runtime/helpers.rs:526-547 — 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) src/tool_runtime/edit_tool_telemetry.rs:216 — src/tool_runtime/edit_tool_telemetry.rs:216-237 | src/tool_runtime/edit_tool_telemetry.rs:239-263 — 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) crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:425 — crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:425-454 | crates/webcodex-runner/src/webcodex_runner/shell/execution.rs:459-480 — 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) crates/webcodex-store/src/goal.rs:1394 — crates/webcodex-store/src/goal.rs:1394-1415 | crates/webcodex-store/src/store_primitives.rs:83-104 — 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) crates/webcodex-computer/src/lib.rs:1017 — crates/webcodex-computer/src/lib.rs:1017-1039 | crates/webcodex-computer/src/lib.rs:1043-1064 — 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 (21 corresponding lines) · ×9
  • Edited copy of a member (21 corresponding lines) crates/webcodex-computer/src/platform/macos/accessibility.rs:383 — crates/webcodex-computer/src/platform/macos/accessibility.rs:383-403 | crates/webcodex-computer/src/platform/macos/accessibility.rs:459-479 — 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) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:220 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:220-249 | crates/webcodex-cli/src/webcodex_cli/connect/shared_key_oauth.rs:197-217 — 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) REDACTED:495 — REDACTED:495-515 | src/tool_runtime/search_project_texts.rs:115-137 — 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) crates/webcodex-persistent-shell/src/unix.rs:391 — crates/webcodex-persistent-shell/src/unix.rs:391-411 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:759-779 — 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) crates/webcodex-workspace/src/project_overview.rs:411 — crates/webcodex-workspace/src/project_overview.rs:411-431 | crates/webcodex-workspace/src/project_overview.rs:688-709 — 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) src/tool_runtime/edit_tool_telemetry.rs:102 — src/tool_runtime/edit_tool_telemetry.rs:102-124 | src/tool_runtime/edit_tool_telemetry.rs:126-146 — 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) crates/webcodex-runner/src/webcodex_runner/project_format.rs:126 — crates/webcodex-runner/src/webcodex_runner/project_format.rs:126-147 | crates/webcodex-runner/src/webcodex_runner/project_format.rs:149-169 — 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) src/tool_runtime/structured_execution.rs:158 — src/tool_runtime/structured_execution.rs:158-178 | src/tool_runtime/validation.rs:193-221 — 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) src/mcp_tests/plugin_check.rs:55 — src/mcp_tests/plugin_check.rs:55-75 | src/mcp_tests/ssh_resource.rs:47-67 — 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 (6 corresponding lines) · ×9
  • Edited copy of a member (6 corresponding lines) src/tool_runtime/git/shared.rs:12 — src/tool_runtime/git/shared.rs:12-17 | src/tool_runtime/git_committed.rs:128-133 — 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) crates/webcodex-environment/src/inventory.rs:52 — crates/webcodex-environment/src/inventory.rs:52-57 | crates/webcodex-environment/src/inventory/diagnostic_configuration.rs:159-166 — 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) crates/webcodex-workspace/src/project_context.rs:1115 — crates/webcodex-workspace/src/project_context.rs:1115-1120 | src/auth/project_credential.rs:98-103 — 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) src/tool_runtime/git_review.rs:322 — src/tool_runtime/git_review.rs:322-328 | src/tool_runtime/surface/discovery.rs:172-177 — 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) src/tool_runtime/agent_task.rs:136 — src/tool_runtime/agent_task.rs:136-141 | src/tool_runtime/files/inspection.rs:237-242 — 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) scripts/release_publication.py:80 — scripts/release_publication.py:80-94 | scripts/release_publication.py:98-103 — 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) scripts/release_doctor.py:90 — scripts/release_doctor.py:90-95 | scripts/release_publication.py:147-152 — 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) src/mcp_tests/agent_continuation_app.rs:106 — src/mcp_tests/agent_continuation_app.rs:106-112 | src/mcp_tests/goal_plan_app.rs:28-33 — 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) scripts/package_unified_installer.py:86 — scripts/package_unified_installer.py:86-91 | scripts/collect_unified_installer_inputs.py:47-52 — 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 (17 lines × 2) · ×9
  • Duplicated block (17 lines × 2) crates/webcodex-cli/src/webcodex_cli/pairing.rs:8 — crates/webcodex-cli/src/webcodex_cli/pairing.rs:8-24 | crates/webcodex-runner-config/src/lib.rs:156-172 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/pairing.rs` and `crates/webcodex-runner-config/src/lib.rs` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) crates/webcodex-core/src/mcp_gateway.rs:697 — crates/webcodex-core/src/mcp_gateway.rs:697-713 | crates/webcodex-core/src/plugin.rs:1503-1519 — before extracting anything, compare `crates/webcodex-core/src/mcp_gateway.rs` and `crates/webcodex-core/src/plugin.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 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 `crates/webcodex-core/src/mcp_gateway.rs:697` 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 (17 lines × 2) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:83 — crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:83-99 | crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs:111-127 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs` and `crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:203 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:203-219 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:361-377 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/shell/process.rs` and `crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 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 `crates/webcodex-runner/src/webcodex_runner/shell/process.rs:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/webcodex-workflow-session/src/store.rs:3010 — crates/webcodex-workflow-session/src/store.rs:3010-3026 | crates/webcodex-workflow-session/src/store.rs:3218-3234 — both copies are in the same file, so extract the 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 (17 lines × 2) src/oauth_http/project_share.rs:161 — src/oauth_http/project_share.rs:161-177 | src/oauth_http/shared_key_bridge.rs:573-589 — before extracting anything, compare `src/oauth_http/project_share.rs` and `src/oauth_http/shared_key_bridge.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `src/oauth_http/project_share.rs:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/tool_runtime/artifact_transfer.rs:833 — src/tool_runtime/artifact_transfer.rs:833-849 | src/tool_runtime/artifact_transfer.rs:952-968 — both copies are in the same file, so extract the 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 `src/tool_runtime/artifact_transfer.rs:833` 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 (17 lines × 2) src/mcp_tests/http_transport.rs:2089 — src/mcp_tests/http_transport.rs:2089-2105 | src/mcp_tests/http_transport.rs:2351-2367 — both copies are in the same file, so extract the 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 (17 lines × 2) scripts/release_readiness.py:281 — scripts/release_readiness.py:281-297 | scripts/release_readiness.py:329-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D5 · Coupling · Off the main sequence · ×9
  • Off the main sequence: webcodex-admin — webcodex-admin: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-computer-control — webcodex-computer-control: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-core — webcodex-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 17 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-openai-tunnel — webcodex-openai-tunnel: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-process — webcodex-process: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-code-mode — webcodex-code-mode: abstractness 0.06, instability 0.00, distance 0.94 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-runner-config — webcodex-runner-config: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: webcodex-workspace — webcodex-workspace: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: @yyjeqhc/webcodex-plugin-sdk — @yyjeqhc/webcodex-plugin-sdk: abstractness 0.29, instability 0.00, distance 0.71 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×8
  • Focus outline removed in CSS without a :focus replacement frontend/src/runtime-v2/styles-production.css:9 — `.work-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 frontend/src/runtime-v2/styles-production.css:62 — `.goal-list-filters 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 frontend/src/runtime-v2/styles-production.css:71 — `.window-collaboration textarea` 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 frontend/src/runtime-v2/styles-responsive.css:1 — `.auth-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 frontend/src/runtime-v2/styles-workbench.css:377 — `.composer textarea: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.
  • Focus outline removed in CSS without a :focus replacement frontend/src/runtime-v2/styles.css:156 — `.composer textarea` 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 frontend/src/runtime-v2/styles.css:205 — `.filter-bar 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 apps/desktop/src/styles/app.css:34 — `.main-content:focus` 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.
D1 · Cyclomatic Complexity · webcodex_workspace · ×8
  • webcodex_workspace::project_overview::validate_project_overview (cyclomatic 50) crates/webcodex-workspace/src/project_overview.rs:832 — webcodex_workspace::project_overview::validate_project_overview has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_workspace::project_overview::build_project_overview (cyclomatic 30) crates/webcodex-workspace/src/project_overview.rs:103 — webcodex_workspace::project_overview::build_project_overview 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.
  • webcodex_workspace::project_recipe::workspace_member_witnesses (cyclomatic 25) crates/webcodex-workspace/src/project_recipe.rs:535 — webcodex_workspace::project_recipe::workspace_member_witnesses 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.
  • webcodex_workspace::project_recipe::project_cargo_all_packages_provenance_files (cyclomatic 24) crates/webcodex-workspace/src/project_recipe.rs:212 — webcodex_workspace::project_recipe::project_cargo_all_packages_provenance_files 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.
  • webcodex_workspace::project_context::fallback_manifest_paths (cyclomatic 18) crates/webcodex-workspace/src/project_context.rs:935 — webcodex_workspace::project_context::fallback_manifest_paths 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.
  • webcodex_workspace::project_overview::classify_key_file (cyclomatic 18) crates/webcodex-workspace/src/project_overview.rs:465 — webcodex_workspace::project_overview::classify_key_file 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.
  • webcodex_workspace::workspace_checkpoint::status_summary (cyclomatic 17) crates/webcodex-workspace/src/workspace_checkpoint.rs:434 — webcodex_workspace::workspace_checkpoint::status_summary 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.
  • webcodex_workspace::workspace_checkpoint::collect_untracked (cyclomatic 17) crates/webcodex-workspace/src/workspace_checkpoint.rs:536 — webcodex_workspace::workspace_checkpoint::collect_untracked 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 · DesktopCore · ×8
  • DesktopCore::configure_local_setup (cyclomatic 40) apps/desktop/src-tauri/src/state/desktop_core.rs:534 — DesktopCore::configure_local_setup 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.
  • DesktopCore::configure_environment (cyclomatic 30) apps/desktop/src-tauri/src/state/environment.rs:443 — DesktopCore::configure_environment 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.
  • DesktopCore::start_quick_share (cyclomatic 21) apps/desktop/src-tauri/src/state/desktop_core.rs:1010 — DesktopCore::start_quick_share has cyclomatic complexity 21 (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.
  • DesktopCore::switch_runtime_transaction (cyclomatic 21) apps/desktop/src-tauri/src/state/runtime_shell.rs:319 — DesktopCore::switch_runtime_transaction 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.
  • DesktopCore::refresh_runtime_status (cyclomatic 19) apps/desktop/src-tauri/src/state/desktop_core.rs:164 — DesktopCore::refresh_runtime_status 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.
  • DesktopCore::apply_environment_record (cyclomatic 19) apps/desktop/src-tauri/src/state/environment.rs:1001 — DesktopCore::apply_environment_record 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.
  • DesktopCore::persistent_tunnel_profile_action (cyclomatic 18) apps/desktop/src-tauri/src/state/connections.rs:311 — DesktopCore::persistent_tunnel_profile_action 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.
  • DesktopCore::migrate_environment (cyclomatic 18) apps/desktop/src-tauri/src/state/environment.rs:757 — DesktopCore::migrate_environment 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.
D2 · Cognitive Complexity · DesktopCore · ×8
  • DesktopCore::configure_local_setup (cognitive 61) apps/desktop/src-tauri/src/state/desktop_core.rs:534 — DesktopCore::configure_local_setup has cognitive complexity 61 (threshold 15). Drivers by points: if/else 33 (44 pts), match/switch 9 (13 pts), boolean chains 4 (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.
  • DesktopCore::configure_environment (cognitive 43) apps/desktop/src-tauri/src/state/environment.rs:443 — DesktopCore::configure_environment has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 8, match/switch 3 (5 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.
  • DesktopCore::switch_runtime_transaction (cognitive 28) apps/desktop/src-tauri/src/state/runtime_shell.rs:319 — DesktopCore::switch_runtime_transaction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 5, 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.
  • DesktopCore::apply_environment_record (cognitive 27) apps/desktop/src-tauri/src/state/environment.rs:1001 — DesktopCore::apply_environment_record has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 3, match/switch 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.
  • DesktopCore::migrate_environment (cognitive 22) apps/desktop/src-tauri/src/state/environment.rs:757 — DesktopCore::migrate_environment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, loops 2 (3 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, 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.
  • DesktopCore::refresh_runtime_status (cognitive 20) apps/desktop/src-tauri/src/state/desktop_core.rs:164 — DesktopCore::refresh_runtime_status has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), match/switch 4 (6 pts), boolean chains 2 (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.
  • DesktopCore::persistent_tunnel_profile_action (cognitive 17) apps/desktop/src-tauri/src/state/connections.rs:311 — DesktopCore::persistent_tunnel_profile_action has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DesktopCore::start_quick_share (cognitive 16) apps/desktop/src-tauri/src/state/desktop_core.rs:1010 — DesktopCore::start_quick_share has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (7 pts), if/else 5, boolean chains 3, loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch 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 · ×8
  • Database::create_agent_wait (cognitive 38) crates/webcodex-store/src/agent_wait.rs:232 — Database::create_agent_wait has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 4, boolean chains 1, 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.
  • Database::post_conversation_message (cognitive 37) crates/webcodex-store/src/communication.rs:2024 — Database::post_conversation_message has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 7 (8 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Database::read_goal_stall_continuity (cognitive 35) crates/webcodex-store/src/goal_stall.rs:160 — Database::read_goal_stall_continuity has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 15 (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.
  • Database::record_goal_workflow_stalled_diagnosed (cognitive 27) crates/webcodex-store/src/goal_stall.rs:511 — Database::record_goal_workflow_stalled_diagnosed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 8, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • Database::consume_agent_wake_with_now (cognitive 20) crates/webcodex-store/src/agent_wake.rs:1196 — Database::consume_agent_wake_with_now has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 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.
  • Database::update_goal_at (cognitive 20) crates/webcodex-store/src/goal.rs:695 — Database::update_goal_at has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 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.
  • Database::get_or_create_project_references (cognitive 19) crates/webcodex-store/src/project_reference.rs:93 — Database::get_or_create_project_references has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 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.
  • Database::recover_expired_mcp_app_endpoint (cognitive 18) crates/webcodex-store/src/communication.rs:1098 — Database::recover_expired_mcp_app_endpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, 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 · webcodex_computer · ×8
  • webcodex_computer::platform::windows::accessibility::control (cognitive 36) crates/webcodex-computer/src/platform/windows/accessibility.rs:1180 — webcodex_computer::platform::windows::accessibility::control has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 2 (5 pts), loops 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_computer::platform::windows::accessibility::uia_control_role (cognitive 28) crates/webcodex-computer/src/platform/windows/accessibility.rs:223 — webcodex_computer::platform::windows::accessibility::uia_control_role has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 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.
  • webcodex_computer::platform::macos::applications::enumerate_macos_applications (cognitive 26) crates/webcodex-computer/src/platform/macos/applications.rs:278 — webcodex_computer::platform::macos::applications::enumerate_macos_applications has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (3 pts), boolean chains 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.
  • webcodex_computer::platform::macos::applications::mac_application_candidate_at_path (cognitive 22) crates/webcodex-computer/src/platform/macos/applications.rs:160 — webcodex_computer::platform::macos::applications::mac_application_candidate_at_path has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 9. 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.
  • webcodex_computer::platform::windows::accessibility::accessibility_tree_impl (cognitive 19) crates/webcodex-computer/src/platform/windows/accessibility.rs:742 — webcodex_computer::platform::windows::accessibility::accessibility_tree_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_computer::platform::windows::accessibility::element_state (cognitive 19) crates/webcodex-computer/src/platform/windows/accessibility.rs:870 — webcodex_computer::platform::windows::accessibility::element_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 6, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_computer::platform::windows::accessibility::activate_window (cognitive 19) crates/webcodex-computer/src/platform/windows/accessibility.rs:1015 — webcodex_computer::platform::windows::accessibility::activate_window has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_computer::platform::macos::accessibility::accessibility_tree_impl (cognitive 16) crates/webcodex-computer/src/platform/macos/accessibility.rs:942 — webcodex_computer::platform::macos::accessibility::accessibility_tree_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 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.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×8
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/webcodex-cli/src/webcodex_cli/login.rs:108 — crates/webcodex-cli/src/webcodex_cli/login.rs:108-125 | src/auth/pat.rs:150-168 | src/auth/pat.rs:196-208 — 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) src/tool_runtime/agent_task.rs:376 — src/tool_runtime/agent_task.rs:376-399 | src/tool_runtime/agent_task.rs:483-495 | src/tool_runtime/agent_task.rs:830-854 — 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) crates/webcodex-runner-registry/src/job_updates.rs:957 — crates/webcodex-runner-registry/src/job_updates.rs:957-969 | crates/webcodex-runner-registry/src/job_updates.rs:975-989 | crates/webcodex-runner-registry/src/job_updates.rs:1218-1231 — 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) crates/webcodex-runner/src/webcodex_runner/project_build.rs:213 — crates/webcodex-runner/src/webcodex_runner/project_build.rs:213-225 | crates/webcodex-runner/src/webcodex_runner/project_format.rs:368-380 | crates/webcodex-runner/src/webcodex_runner/validation/project.rs:197-209 — 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) crates/webcodex-core/src/runner_operation.rs:2341 — crates/webcodex-core/src/runner_operation.rs:2341-2353 | crates/webcodex-core/src/runner_operation.rs:2355-2368 | crates/webcodex-core/src/runner_operation.rs:2370-2382 — 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) crates/webcodex-core/src/authority.rs:69 — crates/webcodex-core/src/authority.rs:69-81 | crates/webcodex-core/src/plugin.rs:574-586 | crates/webcodex-store/src/store_primitives.rs:161-176 — 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) crates/webcodex-core/src/runner_protocol.rs:1887 — crates/webcodex-core/src/runner_protocol.rs:1887-1903 | crates/webcodex-core/src/ssh_resource.rs:50-62 | crates/webcodex-store/src/agent_task/invariants.rs:302-316 — 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) scripts/e2e_go_project_format_ws.py:227 — scripts/e2e_go_project_format_ws.py:227-241 | scripts/e2e_project_knowledge_ws.py:193-205 | scripts/e2e_session_continuity_ws.py:319-331 — 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 (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) apps/desktop/src-tauri/src/webcodex/adapter.rs:989 — apps/desktop/src-tauri/src/webcodex/adapter.rs:989-995 | crates/webcodex-environment/src/native.rs:1942-1948 | crates/webcodex-runner/src/webcodex_runner/config.rs:1620-1626 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) crates/webcodex-admin/src/commands.rs:432 — crates/webcodex-admin/src/commands.rs:432-438 | crates/webcodex-admin/src/commands.rs:458-464 | crates/webcodex-admin/src/commands.rs:483-489 — 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 `crates/webcodex-admin/src/commands.rs:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/webcodex-admin/src/commands.rs:808 — crates/webcodex-admin/src/commands.rs:808-814 | crates/webcodex-cli/src/webcodex_cli/pairing.rs:13-19 | crates/webcodex-runner-config/src/lib.rs:161-167 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/pairing.rs` and `crates/webcodex-runner-config/src/lib.rs` 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-admin/src/commands.rs:808` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `opts` to `&AdminOptions` in one and `&RunnerInitOptions` 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 (7 lines × 3) crates/webcodex-core/src/runner_operation.rs:1529 — crates/webcodex-core/src/runner_operation.rs:1529-1535 | crates/webcodex-core/src/runner_operation.rs:1549-1555 | crates/webcodex-core/src/runner_operation.rs:1573-1579 — 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 `crates/webcodex-core/src/runner_operation.rs:1529` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:204 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:204-210 | crates/webcodex-runner/src/webcodex_runner/shell/run.rs:95-101 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:362-368 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/shell/process.rs` and `crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 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 `crates/webcodex-runner/src/webcodex_runner/shell/process.rs:204` 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 (7 lines × 3) crates/webcodex-workflow-session/src/events.rs:1000 — crates/webcodex-workflow-session/src/events.rs:1000-1006 | crates/webcodex-workspace/src/workspace_checkpoint.rs:858-864 | src/tool_runtime/checkpoint.rs:858-864 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) src/tool_runtime/files/mutations/patch_result.rs:514 — src/tool_runtime/files/mutations/patch_result.rs:514-520 | src/tool_runtime/files/mutations/patch_result.rs:522-528 | src/tool_runtime/files/mutations/patch_result.rs:530-537 — 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 `src/tool_runtime/files/mutations/patch_result.rs:514` 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 × 3) crates/webcodex-cli/src/lib.rs:774 — crates/webcodex-cli/src/lib.rs:774-780 | crates/webcodex-cli/src/lib.rs:834-840 | crates/webcodex-cli/src/lib.rs:1135-1141 — 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 `crates/webcodex-cli/src/lib.rs:774` 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 (5 lines × 3) · ×8
  • Duplicated block (5 lines × 3) crates/webcodex-lsp/src/supervisor.rs:520 — crates/webcodex-lsp/src/supervisor.rs:520-524 | crates/webcodex-lsp/src/supervisor.rs:568-572 | crates/webcodex-lsp/src/supervisor.rs:588-592 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) src/cloudflare_ingress.rs:1215 — src/cloudflare_ingress.rs:1215-1219 | src/cloudflare_ingress.rs:1271-1275 | src/cloudflare_ingress.rs:1294-1298 — 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 `src/cloudflare_ingress.rs:1215` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 3) crates/webcodex-cli/src/webcodex_cli/tokens.rs:31 — crates/webcodex-cli/src/webcodex_cli/tokens.rs:31-35 | crates/webcodex-runner-registry/src/validation.rs:788-792 | src/auth/pat.rs:28-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) src/config.rs:580 — src/config.rs:580-584 | src/config.rs:585-589 | src/config.rs:590-594 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:132 — crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:132-136 | crates/webcodex-runner/src/webcodex_runner/detached_job/store.rs:40-44 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:167-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) src/mcp_tests/http_transport.rs:328 — src/mcp_tests/http_transport.rs:328-333 | src/mcp_tests/http_transport.rs:406-411 | src/mcp_tests/http_transport/metadata_trace.rs:27-31 — 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 `src/mcp_tests/http_transport.rs:328` 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) src/mcp_tests/computer_post_observation.rs:23 — src/mcp_tests/computer_post_observation.rs:23-27 | src/mcp_tests/oauth_scope.rs:4-8 | src/mcp_tests/oauth_scope.rs:24-28 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `scopes` to `&str` in one and `&str) -> (tempfile::TempDir` 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 (5 lines × 3) scripts/release_operator.py:65 — scripts/release_operator.py:65-69 | scripts/release_operator.py:94-98 | scripts/release_operator.py:124-128 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `scripts/release_operator.py:62` calls `add_argument` and `scripts/release_operator.py:123` 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.
D1 · Cyclomatic Complexity · JobManager · ×7
  • JobManager::start_prepared_shell_job (cyclomatic 40) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:69 — JobManager::start_prepared_shell_job 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.
  • JobManager::start_ssh_shell_job (cyclomatic 40) crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs:56 — JobManager::start_ssh_shell_job 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.
  • JobManager::start_shell_job (cyclomatic 38) crates/webcodex-runner/src/webcodex_runner/job_manager/local_shell.rs:6 — JobManager::start_shell_job has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • JobManager::start_structured_job (cyclomatic 28) crates/webcodex-runner/src/webcodex_runner/job_manager/process.rs:8 — JobManager::start_structured_job 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.
  • JobManager::record_update (cyclomatic 22) crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:136 — JobManager::record_update 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.
  • JobManager::start_detached_process_job (cyclomatic 19) crates/webcodex-runner/src/webcodex_runner/job_manager/detached.rs:302 — JobManager::start_detached_process_job 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.
  • JobManager::enqueue (cyclomatic 16) crates/webcodex-runner/src/webcodex_runner/job_manager/admission.rs:284 — JobManager::enqueue 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 · Database · ×7
  • Database::post_conversation_message (cyclomatic 31) crates/webcodex-store/src/communication.rs:2024 — Database::post_conversation_message 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.
  • Database::read_goal_stall_continuity (cyclomatic 31) crates/webcodex-store/src/goal_stall.rs:160 — Database::read_goal_stall_continuity 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.
  • Database::create_agent_wait (cyclomatic 26) crates/webcodex-store/src/agent_wait.rs:232 — Database::create_agent_wait 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.
  • Database::record_goal_workflow_stalled_diagnosed (cyclomatic 24) crates/webcodex-store/src/goal_stall.rs:511 — Database::record_goal_workflow_stalled_diagnosed 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.
  • Database::update_goal_at (cyclomatic 18) crates/webcodex-store/src/goal.rs:695 — Database::update_goal_at 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.
  • Database::consume_agent_wake_with_now (cyclomatic 16) crates/webcodex-store/src/agent_wake.rs:1196 — Database::consume_agent_wake_with_now 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.
  • Database::recover_expired_mcp_app_endpoint (cyclomatic 16) crates/webcodex-store/src/communication.rs:1098 — Database::recover_expired_mcp_app_endpoint 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.
D2 · Cognitive Complexity · CodingAgentManager · ×7
  • CodingAgentManager::run_turn (cognitive 131) crates/webcodex-runner/src/webcodex_runner/coding_agent/run.rs:98 — CodingAgentManager::run_turn has cognitive complexity 131 (threshold 15). Drivers by points: if/else 36 (98 pts), match/switch 12 (20 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CodingAgentManager::apply_pre_prompt_config_option (cognitive 45) crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:190 — CodingAgentManager::apply_pre_prompt_config_option has cognitive complexity 45 (threshold 15). Drivers by points: if/else 30 (42 pts), match/switch 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.
  • CodingAgentManager::initialize_session (cognitive 40) crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:364 — CodingAgentManager::initialize_session has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 4, match/switch 3, 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.
  • CodingAgentManager::recover (cognitive 19) crates/webcodex-runner/src/webcodex_runner/coding_agent/lifecycle.rs:70 — CodingAgentManager::recover 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.
  • CodingAgentManager::run_live_acp_probe (cognitive 17) crates/webcodex-runner/src/webcodex_runner/coding_agent/diagnose.rs:297 — CodingAgentManager::run_live_acp_probe has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 12, if/else 5. 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.
  • CodingAgentManager::handle (cognitive 17) crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:516 — CodingAgentManager::handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (8 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.
  • CodingAgentManager::start (cognitive 17) crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:639 — CodingAgentManager::start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×7
  • Edited copy of a member (29 corresponding lines) crates/webcodex-persistent-shell/src/unix.rs:148 — crates/webcodex-persistent-shell/src/unix.rs:148-176 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:330-363 — 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) crates/webcodex-persistent-shell/src/framing.rs:131 — crates/webcodex-persistent-shell/src/framing.rs:131-159 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:654-683 — 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) src/mcp/tools/invocation.rs:235 — src/mcp/tools/invocation.rs:235-263 | src/mcp/tools/invocation.rs:364-403 — 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) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1239 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1239-1267 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1873-1901 — 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) src/tool_runtime/docx_document.rs:18 — src/tool_runtime/docx_document.rs:18-49 | src/tool_runtime/pdf_document.rs:94-122 — 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) crates/webcodex-runner/src/webcodex_runner/dispatch.rs:142 — crates/webcodex-runner/src/webcodex_runner/dispatch.rs:142-170 | crates/webcodex-runner/src/webcodex_runner/persistent_shell/results.rs:119-150 — 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) src/project_entry_cloudflared.rs:528 — src/project_entry_cloudflared.rs:528-556 | src/project_entry_setup.rs:1111-1139 — 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 (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) crates/webcodex-runner/src/webcodex_runner/coding_agent/protocol.rs:84 — crates/webcodex-runner/src/webcodex_runner/coding_agent/protocol.rs:84-103 | crates/webcodex-runner/src/webcodex_runner/shutdown.rs:330-347 — 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) crates/webcodex-admin/src/output.rs:3 — crates/webcodex-admin/src/output.rs:3-26 | crates/webcodex-cli/src/webcodex_cli/http.rs:88-105 — 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) src/auth/scopes.rs:61 — src/auth/scopes.rs:61-81 | src/auth/scopes.rs:85-102 — 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) crates/webcodex-persistent-shell/src/unix.rs:178 — crates/webcodex-persistent-shell/src/unix.rs:178-195 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:365-386 — 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) crates/webcodex-computer/src/platform/windows/display.rs:72 — crates/webcodex-computer/src/platform/windows/display.rs:72-92 | crates/webcodex-computer/src/platform/windows/display.rs:154-171 — 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) src/tool_runtime/helpers.rs:785 — src/tool_runtime/helpers.rs:785-805 | src/tool_runtime/validation.rs:353-370 — 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) scripts/e2e_agent_environment_ws.py:45 — scripts/e2e_agent_environment_ws.py:45-62 | scripts/e2e_job_input_ws.py:28-46 — 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.
R4 · Test Coverage · No test reaches this file · ×7
  • No test reaches this file crates/webcodex-browser/src/cdp/widgets/common.js: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 crates/webcodex-browser/src/cdp/widgets/date.js: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 crates/webcodex-browser/src/cdp/widgets/choice.js: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 download/app.js: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 crates/webcodex-browser/src/cdp/set_value.js: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 apps/desktop/scripts/generate-icons.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 extensions/browser-bridge/popup.js: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.
D1 · Cyclomatic Complexity · webcodex_browser · ×6
  • webcodex_browser::cdp::infer_control_container_labels::visit (cyclomatic 30) crates/webcodex-browser/src/cdp.rs:3161 — webcodex_browser::cdp::infer_control_container_labels::visit 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.
  • webcodex_browser::cdp::clickable::admit_clickable_cards (cyclomatic 27) crates/webcodex-browser/src/cdp/clickable.rs:51 — webcodex_browser::cdp::clickable::admit_clickable_cards 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.
  • webcodex_browser::cdp::apply_dom_capabilities (cyclomatic 26) crates/webcodex-browser/src/cdp.rs:1999 — webcodex_browser::cdp::apply_dom_capabilities 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.
  • webcodex_browser::cdp::walk_dom_controls (cyclomatic 19) crates/webcodex-browser/src/cdp.rs:2399 — webcodex_browser::cdp::walk_dom_controls 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.
  • webcodex_browser::profiles::windows::private_path (cyclomatic 17) crates/webcodex-browser/src/profiles/windows.rs:75 — webcodex_browser::profiles::windows::private_path 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.
  • webcodex_browser::cdp::clickable::safe_content (cyclomatic 16) crates/webcodex-browser/src/cdp/clickable.rs:283 — webcodex_browser::cdp::clickable::safe_content 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 · webcodex_tool_contracts · ×6
  • webcodex_tool_contracts::schema_generation::normalize_host_schema_inner (cognitive 51) crates/webcodex-tool-contracts/src/schema_generation.rs:37 — webcodex_tool_contracts::schema_generation::normalize_host_schema_inner has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 4 (11 pts), boolean chains 3, 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.
  • webcodex_tool_contracts::tool_call::parsing::safe_argument_error (cognitive 34) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:910 — webcodex_tool_contracts::tool_call::parsing::safe_argument_error has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 3 (5 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 11). Of this number, 27 points are the body's own statements and 7 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.
  • webcodex_tool_contracts::registry::output_schemas::base_output_schema_for_tool (cognitive 29) crates/webcodex-tool-contracts/src/registry/output_schemas.rs:59 — webcodex_tool_contracts::registry::output_schemas::base_output_schema_for_tool has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29. 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.
  • webcodex_tool_contracts::request_schema::normalize_closed_object_unions (cognitive 24) crates/webcodex-tool-contracts/src/request_schema.rs:194 — webcodex_tool_contracts::request_schema::normalize_closed_object_unions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (11 pts), match/switch 1 (nesting depth added 14). 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.
  • webcodex_tool_contracts::tool_call::parsing::validate_coding_project_source_shape (cognitive 22) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:7 — webcodex_tool_contracts::tool_call::parsing::validate_coding_project_source_shape has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool (cognitive 18) crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:951 — webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (7 pts), match/switch 1 (nesting depth added 9). 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×6
  • Change coupling: protocol.rs ↔ tools.rs src/mcp_tests/protocol.rs:1 — `src/mcp_tests/protocol.rs` and `src/mcp_tests/tools.rs` change together 83% of the time (10 of the 12 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 10 shared commits counted here, the most recent 3 are `7ae5d2b4` fix(mcp): preserve CLI collaboration and explicit acknowledgements (#…; `4b0fc069` refactor(mcp): add common invocation envelope (#717); `28ba6258` perf(runtime): reduce model-facing status and discovery cost (#695) — run `git show` on any of them.
  • Change coupling: recorder_metadata.rs ↔ tool_audit.rs crates/webcodex-tool-runtime-contracts/src/recorder_metadata.rs:1 — `crates/webcodex-tool-runtime-contracts/src/recorder_metadata.rs` and `crates/webcodex-tool-runtime-contracts/src/tool_audit.rs` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 11 shared commits counted here, the most recent 3 are `105c64cd` feat(skills): add trusted skill resource execution (#491) (at that commit the file was still `crates/webcodex-tool-runtime-contracts/src/tool_call.rs`); `dbebb2fe` feat(skills): add exact-name skill loading (#490) (at that commit the file was still `crates/webcodex-tool-runtime-contracts/src/tool_call.rs`); `15382006` Unify the project artifact model surface (#481) (at that commit the file was still `crates/webcodex-tool-runtime-contracts/src/tool_call.rs`) — run `git show` on any of them.
  • Change coupling: runner_quic.rs ↔ runner_ws.rs src/runner_quic.rs:1 — `src/runner_quic.rs` and `src/runner_ws.rs` change together 71% of the time (27 of the 38 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 27 shared commits counted here, the most recent 3 are `7b35aafb` refactor(query): share search and Git decoding, reduce test fixture d…; `0946d4a9` feat(project): add bounded Go source formatting (#1180); `0bea9cff` fix(mcp): 修复资源链接返回与工具目录节点限制 (#1128) — run `git show` on any of them.
  • Change coupling: projects.rs ↔ admin_project_lifecycle.rs crates/webcodex-runner/src/webcodex_runner/projects.rs:1 — `crates/webcodex-runner/src/webcodex_runner/projects.rs` and `src/admin_project_lifecycle.rs` 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) 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 6 shared commits counted here, the most recent 3 are `2e6a1e92` Model managed worktree knowledge associations (#429); `1f7b2998` Separate project registration provenance (#268); `5748c59b` Add model-facing project unregister (#69) — run `git show` on any of them.
  • Change coupling: external_tools.rs ↔ transport.rs crates/webcodex-runner/src/webcodex_runner/external_tools.rs:1 — `crates/webcodex-runner/src/webcodex_runner/external_tools.rs` and `crates/webcodex-runner/src/webcodex_runner/transport.rs` 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 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 5 shared commits counted here, the most recent 3 are `fe09ce87` Stabilize V1 CI and clean maintenance warnings (#30); `2c25ea11` fix: enforce a global runner shutdown deadline; `f582fbd1` feat: add agent config hot reload (at that commit the files were still `src/bin/webcodex_agent/external_tools.rs` and `src/bin/webcodex_agent/transport.rs`) — run `git show` on any of them.
  • Change coupling: server.rs ↔ usage.rs crates/webcodex-cli/src/webcodex_cli/server.rs:1 — `crates/webcodex-cli/src/webcodex_cli/server.rs` and `crates/webcodex-cli/src/webcodex_cli/usage.rs` 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 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 5 shared commits counted here, the most recent 3 are `77e55176` security: require explicit opt-in for remote shared-key auth (#732); `f3238f70` Improve first-run CLI readiness guidance (#221); `de3e9211` Close Linux managed onboarding gaps (#216) — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/webcodex-admin/src/commands.rs:832 — crates/webcodex-admin/src/commands.rs:832-873 | crates/webcodex-cli/src/webcodex_cli/http.rs:16-47 | crates/webcodex-cli/src/webcodex_cli/http.rs:54-83 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:52-100 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:127-157 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/webcodex-browser/src/supervisor.rs:739 — crates/webcodex-browser/src/supervisor.rs:739-754 | crates/webcodex-browser/src/supervisor.rs:756-768 | crates/webcodex-browser/src/supervisor.rs:913-925 | crates/webcodex-browser/src/supervisor.rs:927-950 | crates/webcodex-browser/src/supervisor.rs:1028-1140 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/webcodex-computer/src/lib.rs:1570 — crates/webcodex-computer/src/lib.rs:1570-1609 | crates/webcodex-computer/src/lib.rs:1631-1667 | crates/webcodex-computer/src/lib.rs:1669-1698 | crates/webcodex-computer/src/lib.rs:1706-1743 | crates/webcodex-computer/src/lib.rs:1772-1809 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:315 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:315-411 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:540-720 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:742-999 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1011-1107 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1117-1191 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/runner_http/handlers.rs:14 — src/runner_http/handlers.rs:14-78 | src/runner_http/handlers.rs:81-147 | src/runner_http/handlers.rs:282-344 | src/runner_http/handlers.rs:351-415 | src/runner_http/handlers.rs:418-489 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/tool_runtime/job_terminal_wait.rs:248 — src/tool_runtime/job_terminal_wait.rs:248-277 | src/tool_runtime/job_terminal_wait.rs:285-316 | src/tool_runtime/job_terminal_wait.rs:324-352 | src/tool_runtime/job_terminal_wait.rs:363-400 | src/tool_runtime/job_terminal_wait.rs:408-430 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×6
  • Edited copy of a member (28 corresponding lines) src/mcp/presentation/jobs.rs:156 — src/mcp/presentation/jobs.rs:156-183 | src/mcp/presentation/jobs.rs:242-284 — 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) crates/webcodex-runner/src/webcodex_runner/persistent_shell/results.rs:9 — crates/webcodex-runner/src/webcodex_runner/persistent_shell/results.rs:9-36 | src/tool_runtime/session_shell.rs:971-1008 — 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) apps/desktop/src-tauri/src/updates/install/native.rs:68 — apps/desktop/src-tauri/src/updates/install/native.rs:68-97 | crates/webcodex-cli/src/environment/update/launcher.rs:89-116 — 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) crates/webcodex-workflow-session/src/messages.rs:665 — crates/webcodex-workflow-session/src/messages.rs:665-692 | src/tool_runtime/coding_agent.rs:2129-2157 — 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) scripts/release_publication.py:744 — scripts/release_publication.py:744-771 | scripts/release_readiness.py:449-477 — 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) src/mcp_tests/result_app.rs:1916 — src/mcp_tests/result_app.rs:1916-1943 | src/mcp_tests/result_app.rs:1971-2001 — 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 · Duplicated block (16 lines × 3) · ×6
  • Duplicated block (16 lines × 3) crates/webcodex-runner/src/webcodex_runner/plugin.rs:1341 — crates/webcodex-runner/src/webcodex_runner/plugin.rs:1341-1356 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1358-1373 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1375-1390 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 3) crates/webcodex-store/src/oauth.rs:620 — crates/webcodex-store/src/oauth.rs:620-635 | crates/webcodex-store/src/oauth.rs:698-713 | crates/webcodex-store/src/oauth.rs:1013-1028 — 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 `crates/webcodex-store/src/oauth.rs:620` 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 (16 lines × 3) crates/webcodex-store/src/oauth.rs:646 — crates/webcodex-store/src/oauth.rs:646-661 | crates/webcodex-store/src/oauth.rs:794-809 | crates/webcodex-store/src/oauth.rs:1039-1054 — 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 `crates/webcodex-store/src/oauth.rs:646` 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 (16 lines × 3) src/mcp/tools/call/specialized.rs:37 — src/mcp/tools/call/specialized.rs:37-52 | src/mcp/tools/call/specialized.rs:253-268 | src/mcp/tools/call/specialized.rs:289-304 — 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 `src/mcp/tools/call/specialized.rs:37` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 3) src/tool_runtime/goal.rs:140 — src/tool_runtime/goal.rs:140-155 | src/tool_runtime/goal.rs:161-176 | src/tool_runtime/goal.rs:182-197 — 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 `src/tool_runtime/goal.rs:140` 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 (16 lines × 3) src/tool_runtime/coding_task/observations.rs:267 — src/tool_runtime/coding_task/observations.rs:267-282 | src/tool_runtime/files/inspection.rs:1167-1182 | src/tool_runtime/files/inspection.rs:1447-1462 — 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 `src/tool_runtime/coding_task/observations.rs:267` 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) crates/webcodex-core/src/coding_agent.rs:1189 — crates/webcodex-core/src/coding_agent.rs:1189-1200 | crates/webcodex-core/src/mcp_gateway.rs:297-308 | crates/webcodex-core/src/plugin.rs:454-465 — before extracting anything, compare `crates/webcodex-core/src/mcp_gateway.rs` and `crates/webcodex-core/src/plugin.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 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 `crates/webcodex-core/src/coding_agent.rs:1189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/webcodex-store/src/memory.rs:958 — crates/webcodex-store/src/memory.rs:958-969 | crates/webcodex-store/src/memory.rs:1007-1018 | crates/webcodex-store/src/memory.rs:1221-1232 — 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 `crates/webcodex-store/src/memory.rs:958` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) crates/webcodex-workflow-session/src/continuation.rs:1581 — crates/webcodex-workflow-session/src/continuation.rs:1581-1592 | crates/webcodex-workflow-session/src/continuation.rs:1598-1609 | crates/webcodex-workflow-session/src/continuation.rs:1614-1625 — 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.
  • Duplicated block (12 lines × 3) src/project_entry.rs:997 — src/project_entry.rs:997-1008 | src/project_entry_regular_tunnel.rs:371-382 | src/project_entry_share.rs:1073-1084 — 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. 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 (12 lines × 3) src/mcp_tests/artifact_export.rs:15 — src/mcp_tests/artifact_export.rs:15-26 | src/mcp_tests/file_import.rs:302-313 | src/mcp_tests/http_transport.rs:110-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/mcp_tests/artifact_export.rs:15` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) src/mcp_tests/http_transport.rs:1268 — src/mcp_tests/http_transport.rs:1268-1279 | src/mcp_tests/http_transport.rs:1456-1468 | src/mcp_tests/http_transport.rs:1498-1509 — 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 `src/mcp_tests/http_transport.rs:1268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/mcp_tests/http_transport.rs:1266` calls `get`, `is_none` and `src/mcp_tests/http_transport.rs:1497` 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 (9–10 lines × 2) · ×6
  • Duplicated block (9–10 lines × 2) apps/desktop/src-tauri/src/coding_agents.rs:271 — apps/desktop/src-tauri/src/coding_agents.rs:271-279 | apps/desktop/src-tauri/src/mcp_providers.rs:595-604 — 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 `apps/desktop/src-tauri/src/coding_agents.rs:271` 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–10 lines × 2) crates/webcodex-runner-registry/src/reconciliation.rs:505 — crates/webcodex-runner-registry/src/reconciliation.rs:505-514 | crates/webcodex-runner-registry/src/reconciliation.rs:531-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) src/mcp/presentation/jobs.rs:168 — src/mcp/presentation/jobs.rs:168-176 | src/mcp/presentation/jobs.rs:270-279 — both copies are in the same file, so extract the 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 `src/mcp/presentation/jobs.rs:168` 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–10 lines × 2) src/tool_runtime/result_projection.rs:613 — src/tool_runtime/result_projection.rs:613-622 | src/tool_runtime/result_projection.rs:796-804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/result_projection.rs:613` 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–10 lines × 2) src/tool_runtime/session_tools.rs:449 — src/tool_runtime/session_tools.rs:449-457 | src/tool_runtime/validation_events.rs:67-76 — 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 `src/tool_runtime/session_tools.rs:449` 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 (9–10 lines × 2) scripts/release_operator.py:66 — scripts/release_operator.py:66-74 | scripts/release_operator.py:125-134 — both copies are in the same file, so extract the 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–8 lines × 2) · ×6
  • Duplicated block (7–8 lines × 2) crates/webcodex-cli/src/webcodex_cli/controller.rs:382 — crates/webcodex-cli/src/webcodex_cli/controller.rs:382-388 | crates/webcodex-cli/src/webcodex_cli/controller.rs:1844-1851 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/controller.rs:382` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) crates/webcodex-core/src/runner_operation.rs:2387 — crates/webcodex-core/src/runner_operation.rs:2387-2393 | crates/webcodex-core/src/runner_operation.rs:2401-2408 — both copies are in the same file, so extract the 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 `crates/webcodex-core/src/runner_operation.rs:2387` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) src/cloudflare_transport.rs:438 — src/cloudflare_transport.rs:438-444 | src/cloudflare_transport.rs:458-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cloudflare_transport.rs:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–8 lines × 2) src/mcp/tools.rs:957 — src/mcp/tools.rs:957-964 | src/mcp/tools.rs:1050-1056 — both copies are in the same file, so extract the 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 `src/mcp/tools.rs:957` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) src/runner_http/handlers.rs:30 — src/runner_http/handlers.rs:30-36 | src/runner_http/handlers.rs:434-441 — both copies are in the same file, so extract the 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 `src/runner_http/handlers.rs:30` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–8 lines × 2) src/tool_runtime/files/artifacts.rs:479 — src/tool_runtime/files/artifacts.rs:479-486 | src/tool_runtime/files/artifacts.rs:529-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/files/artifacts.rs:479` 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.
R11 · Import Boundaries · Boundary violation [package · ×6
  • Boundary violation [package:relative-cross-package] apps/desktop/src/main.tsx:7 — apps/desktop/src/main.tsx:7 reaches into another package with a relative path (../../../frontend/src/ui/foundation.css) — import the package by name instead.
  • Boundary violation [package:test-suite-dependency] scripts/ui-smoke/collaboration-history.mjs:5 — scripts/ui-smoke/collaboration-history.mjs:5 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/ui-smoke/mcp-workspaces.mjs:6 — scripts/ui-smoke/mcp-workspaces.mjs:6 imports src/mcp_tests/workbench_upgrade_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/ui-smoke/mcp-workspaces.mjs:7 — scripts/ui-smoke/mcp-workspaces.mjs:7 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/ui-smoke/work-result-card.mjs:5 — scripts/ui-smoke/work-result-card.mjs:5 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/ui-smoke/work-result-controls.mjs:6 — scripts/ui-smoke/work-result-controls.mjs:6 imports src/mcp_tests/work_result_app_fixture.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
D1 · Cyclomatic Complexity · CodingAgentManager · ×5
  • CodingAgentManager::run_turn (cyclomatic 66) crates/webcodex-runner/src/webcodex_runner/coding_agent/run.rs:98 — CodingAgentManager::run_turn has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CodingAgentManager::initialize_session (cyclomatic 30) crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:364 — CodingAgentManager::initialize_session 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.
  • CodingAgentManager::apply_pre_prompt_config_option (cyclomatic 23) crates/webcodex-runner/src/webcodex_runner/coding_agent/setup.rs:190 — CodingAgentManager::apply_pre_prompt_config_option 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.
  • CodingAgentManager::run_live_acp_probe (cyclomatic 19) crates/webcodex-runner/src/webcodex_runner/coding_agent/diagnose.rs:297 — CodingAgentManager::run_live_acp_probe has cyclomatic complexity 19 (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.
  • CodingAgentManager::start (cyclomatic 17) crates/webcodex-runner/src/webcodex_runner/coding_agent.rs:639 — CodingAgentManager::start 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×5
  • Repeated repair: scripts/ui-smoke/work-result-card.mjs scripts/ui-smoke/work-result-card.mjs:12 — scripts/ui-smoke/work-result-card.mjs 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 1 (its worst body is work-result-card.chrome 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 Window details/collaboration layout and clarify the Work Result card (#1304)”; “fix(work-result): follow working changes and pin review snapshots (#932)”; “fix(collaboration): durable history and clearer Work Result conversations (#937)”; “fix(ui): improve runtime observability and restore work results (#698)”. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- scripts/ui-smoke/work-result-card.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/webcodex-cli/src/webcodex_cli/connect/probe.rs crates/webcodex-cli/src/webcodex_cli/connect/probe.rs:80 — crates/webcodex-cli/src/webcodex_cli/connect/probe.rs 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 9 (its worst body is webcodex_cli::webcodex_cli::connect::probe::wait_for_connection at line 80), 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(discovery): bound Project listing and resolution suggestions (#1305)”; “Revert "fix(runtime): converge observability on runner naming" (#679)”; “fix(runtime): converge observability on runner naming (#676)”. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-cli/src/webcodex_cli/connect/probe.rs`: 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: crates/webcodex-store/src/window_collaboration.rs crates/webcodex-store/src/window_collaboration.rs:460 — crates/webcodex-store/src/window_collaboration.rs 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 7 (its worst body is Database::project_window_operator_attention at line 460), 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: preserve Window Operator continuity and Host Sidecar visibility (#1020)”; “fix(collaboration): durable history and clearer Work Result conversations (#937)”; “fix(store): keep peer sender context out of inbound transcripts (#686)”. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-store/src/window_collaboration.rs`: 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: crates/webcodex-cli/src/webcodex_cli/controller_projects.rs crates/webcodex-cli/src/webcodex_cli/controller_projects.rs:149 — crates/webcodex-cli/src/webcodex_cli/controller_projects.rs 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 11 (its worst body is ProjectClient::request at line 149), 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(controller): continuously observe runner status and unify credent… (#1150)”; “fix(cli): include project inventory in runner list (#1111)”; “fix(runtime): tighten remote Runner readiness and Work Result polling (#712)”. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-cli/src/webcodex_cli/controller_projects.rs`: 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: crates/webcodex-runner/src/webcodex_runner/runner_instructions.rs crates/webcodex-runner/src/webcodex_runner/runner_instructions.rs:31 — crates/webcodex-runner/src/webcodex_runner/runner_instructions.rs 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 11 (its worst body is webcodex_runner::webcodex_runner::runner_instructions::snapshot 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(release): close WebCodex 0.4.2 runtime and Desktop gates (#615)”; “fix(runner): harden configured instruction path opens (#535)”; “fix(instructions): isolate refresh state and preserve project guidance (#529)”. 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 17:38:35 +08:00' --until='2026-11-17 17:38:35 +08:00' --full-history --no-merges -- crates/webcodex-runner/src/webcodex_runner/runner_instructions.rs`: 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.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×5
  • Edited copy of a member (33 corresponding lines) crates/webcodex-admin/src/commands.rs:204 — crates/webcodex-admin/src/commands.rs:204-236 | crates/webcodex-admin/src/commands.rs:311-356 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) apps/desktop/src-tauri/src/webcodex/adapter.rs:665 — apps/desktop/src-tauri/src/webcodex/adapter.rs:665-697 | apps/desktop/src-tauri/src/webcodex/adapter.rs:705-738 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) crates/webcodex-workspace/src/project_recipe.rs:811 — crates/webcodex-workspace/src/project_recipe.rs:811-844 | crates/webcodex-workspace/src/project_recipe.rs:1010-1042 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) src/ssh_resource_gateway.rs:485 — src/ssh_resource_gateway.rs:485-520 | src/ssh_resource_gateway.rs:526-558 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) scripts/release_readiness.py:262 — scripts/release_readiness.py:262-297 | scripts/release_readiness.py:313-345 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) apps/desktop/src-tauri/src/diagnostics.rs:359 — apps/desktop/src-tauri/src/diagnostics.rs:359-385 | crates/webcodex-environment/src/inventory/model.rs:148-186 — 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) crates/webcodex-runner-config/src/paths.rs:111 — crates/webcodex-runner-config/src/paths.rs:111-145 | crates/webcodex-runner-config/src/paths.rs:155-181 — 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) crates/webcodex-environment/src/service/linux.rs:58 — crates/webcodex-environment/src/service/linux.rs:58-84 | crates/webcodex-environment/src/service/macos.rs:57-83 — 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) crates/webcodex-tool-contracts/src/tool_definition/documents.rs:22 — crates/webcodex-tool-contracts/src/tool_definition/documents.rs:22-48 | crates/webcodex-tool-contracts/src/tool_definition/docx.rs:21-47 — 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) src/admin_project_lifecycle.rs:222 — src/admin_project_lifecycle.rs:222-251 | src/admin_project_lifecycle.rs:258-284 — 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 (26 corresponding lines) · ×5
  • Edited copy of a member (26 corresponding lines) crates/webcodex-computer/src/platform/macos/accessibility.rs:693 — crates/webcodex-computer/src/platform/macos/accessibility.rs:693-722 | crates/webcodex-computer/src/platform/macos/accessibility.rs:787-812 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) src/tool_runtime/files/artifacts.rs:525 — src/tool_runtime/files/artifacts.rs:525-565 | src/tool_runtime/files/artifacts.rs:833-858 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/webcodex-cli/src/webcodex_cli/project.rs:380 — crates/webcodex-cli/src/webcodex_cli/project.rs:380-405 | crates/webcodex-cli/src/webcodex_cli/project.rs:412-439 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) src/tool_runtime/communication.rs:1346 — src/tool_runtime/communication.rs:1346-1371 | src/tool_runtime/communication.rs:1377-1403 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/webcodex-store/src/agent_task/invariants.rs:752 — crates/webcodex-store/src/agent_task/invariants.rs:752-783 | crates/webcodex-store/src/agent_task_attempt_reference.rs:40-65 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×5
  • Edited copy of a member (5 corresponding lines) crates/webcodex-lsp/src/fake_server.rs:489 — crates/webcodex-lsp/src/fake_server.rs:489-499 | crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:496-500 — 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.
  • Edited copy of a member (5 corresponding lines) crates/webcodex-environment/src/service/windows.rs:715 — crates/webcodex-environment/src/service/windows.rs:715-723 | src/tool_runtime/workbench_state.rs:480-484 — 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.
  • Edited copy of a member (5 corresponding lines) crates/webcodex-workflow-session/src/handoff_brief.rs:937 — crates/webcodex-workflow-session/src/handoff_brief.rs:937-943 | src/tool_runtime/git_review.rs:732-736 — 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.
  • Edited copy of a member (5 corresponding lines) scripts/e2e_project_share_roots.py:99 — scripts/e2e_project_share_roots.py:99-104 | scripts/e2e_share_oauth_restart.py:103-107 — 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.
  • Edited copy of a member (5 corresponding lines) scripts/agent_knowledge_host.py:200 — scripts/agent_knowledge_host.py:200-206 | scripts/e2e_session_continuity_ws.py:113-117 — 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) · ×5
  • Edited copy of a member (4 corresponding lines) src/admin_http.rs:36 — src/admin_http.rs:36-39 | src/upgrade_http.rs: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.
  • Edited copy of a member (4 corresponding lines) scripts/e2e_codex_bidirectional_ws.py:349 — scripts/e2e_codex_bidirectional_ws.py:349-354 | scripts/e2e_session_continuity_ws.py:77-80 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) scripts/e2e_agent_knowledge_ws.py:42 — scripts/e2e_agent_knowledge_ws.py:42-45 | scripts/e2e_agent_temporal_evidence_ws.py: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.
  • Edited copy of a member (4 corresponding lines) scripts/prepare_release_metadata.py:162 — scripts/prepare_release_metadata.py:162-165 | scripts/verify_public_release.py:116-119 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) scripts/e2e_project_share_roots.py:47 — scripts/e2e_project_share_roots.py:47-50 | scripts/e2e_share_oauth_restart.py:50-53 — 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 (26 lines × 2) · ×5
  • Duplicated block (26 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:74 — crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:74-99 | crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:79-104 — 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 `crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:74` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (26 lines × 2) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:846 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:846-871 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:915-940 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/skill_store.rs:846` 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 (26 lines × 2) REDACTED:1061 — REDACTED:1061-1086 | src/tool_runtime/search_project_texts.rs:660-685 — before extracting anything, compare `REDACTED` and `src/tool_runtime/search_project_texts.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 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. 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 (26 lines × 2) src/tool_runtime/search_project_texts.rs:731 — src/tool_runtime/search_project_texts.rs:731-756 | src/tool_runtime/search_project_texts.rs:795-820 — both copies are in the same file, so extract the 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 (26 lines × 2) scripts/e2e_linux_socket_activation.py:242 — scripts/e2e_linux_socket_activation.py:242-267 | scripts/e2e_linux_socket_activation.py:320-345 — both copies are in the same file, so extract the 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 (24 lines × 2) · ×5
  • Duplicated block (24 lines × 2) crates/webcodex-cli/src/lib.rs:605 — crates/webcodex-cli/src/lib.rs:605-628 | crates/webcodex-cli/src/lib.rs:642-665 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/lib.rs:605` 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 (24 lines × 2) crates/webcodex-persistent-shell/src/unix.rs:77 — crates/webcodex-persistent-shell/src/unix.rs:77-100 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:228-251 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-persistent-shell/src/unix.rs: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-persistent-shell/src/unix.rs:101` calls `clear_expected_token` and `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:252` 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 (24 lines × 2) crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:222 — crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:222-245 | crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:357-380 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/transport/polling.rs:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) crates/webcodex-validation/src/adapters/rust.rs:231 — crates/webcodex-validation/src/adapters/rust.rs:231-254 | crates/webcodex-validation/src/adapters/rust.rs:288-311 — both copies are in the same file, so extract the 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 `crates/webcodex-validation/src/adapters/rust.rs:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-validation/src/adapters/rust.rs:312` calls `unwrap_or`, `push`, `Literal` and `crates/webcodex-validation/src/adapters/rust.rs:255` 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 (24 lines × 2) crates/webcodex-store/src/agent_task/invariants.rs:176 — crates/webcodex-store/src/agent_task/invariants.rs:176-199 | crates/webcodex-store/src/agent_task/invariants.rs:206-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-store/src/agent_task/invariants.rs:176` 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 (23 lines × 2) · ×5
  • Duplicated block (23 lines × 2) crates/webcodex-store/src/agent_task/invariants.rs:753 — crates/webcodex-store/src/agent_task/invariants.rs:753-775 | crates/webcodex-store/src/agent_task_attempt_reference.rs:41-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (23 lines × 2) crates/webcodex-persistent-shell/src/unix.rs:320 — crates/webcodex-persistent-shell/src/unix.rs:320-342 | crates/webcodex-persistent-shell/src/windows.rs:286-308 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-persistent-shell/src/windows.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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 (23 lines × 2) crates/webcodex-store/src/oauth.rs:586 — crates/webcodex-store/src/oauth.rs:586-608 | crates/webcodex-store/src/oauth.rs:966-988 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/oauth.rs:586` 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 (23 lines × 2) plugins/examples/python-raw/plugin.py:89 — plugins/examples/python-raw/plugin.py:89-111 | plugins/project-knowledge/plugin.py:89-111 — before extracting anything, compare `plugins/examples/python-raw/plugin.py` and `plugins/project-knowledge/plugin.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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.
  • Duplicated block (23 lines × 2) src/mcp_tests/plugin_check.rs:83 — src/mcp_tests/plugin_check.rs:83-105 | src/mcp_tests/plugin_tools.rs:43-65 — before extracting anything, compare `src/mcp_tests/plugin_check.rs` and `src/mcp_tests/plugin_tools.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×5
  • Duplicated block (14–15 lines × 2) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:403 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:403-417 | crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:468-481 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:403` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:363 — crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:363-377 | crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:431-444 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit.rs:363` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) crates/webcodex-workflow-session/src/store.rs:3146 — crates/webcodex-workflow-session/src/store.rs:3146-3159 | crates/webcodex-workflow-session/src/store.rs:3467-3481 — both copies are in the same file, so extract the 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 `crates/webcodex-workflow-session/src/store.rs:3146` 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–15 lines × 2) src/project_entry.rs:518 — src/project_entry.rs:518-531 | src/project_entry.rs:562-576 — both copies are in the same file, so extract the 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 `src/project_entry.rs:518` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) src/tool_runtime/files/mutations/preflight.rs:130 — src/tool_runtime/files/mutations/preflight.rs:130-144 | src/tool_runtime/files/mutations/text_edits.rs:367-380 — 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 `src/tool_runtime/files/mutations/preflight.rs:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) crates/webcodex-workflow-session/src/store.rs:2838 — crates/webcodex-workflow-session/src/store.rs:2838-2848 | crates/webcodex-workflow-session/src/store.rs:3075-3085 | crates/webcodex-workflow-session/src/store.rs:3342-3352 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn close_session( &mut` in one and `super) fn replace_message( &mut` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-workflow-session/src/store.rs:3086` calls `validate_message_text` and `crates/webcodex-workflow-session/src/store.rs:2849` 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 (11 lines × 3) crates/webcodex-workflow-session/src/store.rs:3006 — crates/webcodex-workflow-session/src/store.rs:3006-3016 | crates/webcodex-workflow-session/src/store.rs:3214-3224 | crates/webcodex-workflow-session/src/store.rs:3275-3285 — 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.
  • Duplicated block (11 lines × 3) src/runner_tokens_http/routes.rs:218 — src/runner_tokens_http/routes.rs:218-228 | src/users_http/tokens.rs:116-126 | src/users_http/tokens.rs:193-203 — before extracting anything, compare `src/runner_tokens_http/routes.rs` and `src/users_http/tokens.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_tokens_http/routes.rs:218` 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 × 3) src/tool_runtime/changes.rs:982 — src/tool_runtime/changes.rs:982-992 | src/tool_runtime/changes.rs:1053-1063 | src/tool_runtime/changes.rs:1115-1125 — 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 `src/tool_runtime/changes.rs:982` 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 × 3) crates/webcodex-persistent-shell/src/unix.rs:55 — crates/webcodex-persistent-shell/src/unix.rs:55-65 | crates/webcodex-persistent-shell/src/windows.rs:139-149 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:206-216 — before extracting anything, compare `crates/webcodex-persistent-shell/src/unix.rs` and `crates/webcodex-persistent-shell/src/windows.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 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 `crates/webcodex-persistent-shell/src/unix.rs:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×5
  • Duplicated block (9 lines × 4) crates/webcodex-runner-registry/src/validation.rs:452 — crates/webcodex-runner-registry/src/validation.rs:452-460 | crates/webcodex-runner-registry/src/validation.rs:469-477 | crates/webcodex-runner-registry/src/validation.rs:492-500 | crates/webcodex-runner-registry/src/validation.rs:509-517 — 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 `crates/webcodex-runner-registry/src/validation.rs:452` 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 × 4) crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:97 — crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:97-105 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:133-141 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:259-267 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:293-301 — 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 `crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs: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 (9 lines × 4) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:607 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:607-615 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:627-635 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:656-664 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:686-694 — 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 `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:607` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) src/mcp_tests/file_import.rs:835 — src/mcp_tests/file_import.rs:835-843 | src/mcp_tests/file_import.rs:1052-1060 | src/mcp_tests/file_import.rs:1134-1142 | src/mcp_tests/file_import.rs:1226-1234 — 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.
  • Duplicated block (9 lines × 4) scripts/release_operator.py:183 — scripts/release_operator.py:183-191 | scripts/release_operator.py:200-208 | scripts/release_operator.py:294-302 | scripts/release_operator.py:309-317 — 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 `scripts/release_operator.py:183` 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×5
  • Sync-over-async blocking crates/webcodex-cli/src/webcodex_cli/controller_tui.rs:744 — `run` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking scripts/ui-smoke/server.mjs:33 — `fs.readFileSync` 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 scripts/ui-smoke/server.mjs:43 — `fs.existsSync` 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 scripts/ui-smoke/server.mjs:44 — `fs.readFileSync` 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 scripts/ui-smoke/web-page-consistency.mjs:28 — `fs.writeFileSync` in `scenario` 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.
AC3 · Page structure · Page without a main landmark · ×4
  • Page without a main landmark apps/desktop/public/computer-activity.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark extensions/browser-bridge/popup.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/mcp_spreadsheet_app.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D1 · Cyclomatic Complexity · webcodex_lsp · ×4
  • webcodex_lsp::fake_server::run (cyclomatic 74) crates/webcodex-lsp/src/fake_server.rs:21 — webcodex_lsp::fake_server::run has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webcodex_lsp::fake_server::write_result (cyclomatic 65) crates/webcodex-lsp/src/fake_server.rs:501 — webcodex_lsp::fake_server::write_result has cyclomatic complexity 65 (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.
  • webcodex_lsp::fake_server::maybe_publish_diagnostics (cyclomatic 22) crates/webcodex-lsp/src/fake_server.rs:376 — webcodex_lsp::fake_server::maybe_publish_diagnostics 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.
  • webcodex_lsp::navigation::call_hierarchy (cyclomatic 20) crates/webcodex-lsp/src/navigation.rs:700 — webcodex_lsp::navigation::call_hierarchy has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: webcodex_lsp::navigation::symbol_kind_name (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · webcodex_tool_runtime_contracts · ×4
  • webcodex_tool_runtime_contracts::tool_audit::execution_identity::canonical_cargo_validation_target (cyclomatic 31) crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:62 — webcodex_tool_runtime_contracts::tool_audit::execution_identity::canonical_cargo_validation_target has cyclomatic complexity 31 (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.
  • webcodex_tool_runtime_contracts::tool_audit::result::canonical_execution_audit_result_for_tool (cyclomatic 30) crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:43 — webcodex_tool_runtime_contracts::tool_audit::result::canonical_execution_audit_result_for_tool 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.
  • webcodex_tool_runtime_contracts::tool_audit::result::computer_observation_result_audit (cyclomatic 22) crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:347 — webcodex_tool_runtime_contracts::tool_audit::result::computer_observation_result_audit has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • webcodex_tool_runtime_contracts::tool_audit::request::typed_agent_task_request_audit (cyclomatic 21) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:537 — webcodex_tool_runtime_contracts::tool_audit::request::typed_agent_task_request_audit has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · webcodex_tool_contracts · ×4
  • webcodex_tool_contracts::registry::output_schemas::base_output_schema_for_tool (cyclomatic 30) crates/webcodex-tool-contracts/src/registry/output_schemas.rs:59 — webcodex_tool_contracts::registry::output_schemas::base_output_schema_for_tool 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.
  • webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool (cyclomatic 30) crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:951 — webcodex_tool_contracts::registry::output_schemas::jobs::output_schema_for_tool has cyclomatic complexity 30 (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.
  • webcodex_tool_contracts::schema_generation::normalize_host_schema_inner (cyclomatic 25) crates/webcodex-tool-contracts/src/schema_generation.rs:37 — webcodex_tool_contracts::schema_generation::normalize_host_schema_inner 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.
  • webcodex_tool_contracts::tool_call::parsing::safe_argument_error (cyclomatic 24) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:910 — webcodex_tool_contracts::tool_call::parsing::safe_argument_error has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 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. This is NOT this file's highest cyclomatic complexity: ToolCall::tool_name (cyclomatic 194) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · webcodex_openai_tunnel · ×4
  • webcodex_openai_tunnel::run_transitions::check_intents (cyclomatic 26) crates/webcodex-openai-tunnel/src/run_transitions.rs:140 — webcodex_openai_tunnel::run_transitions::check_intents 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.
  • webcodex_openai_tunnel::bin::webcodex-tunnel::main::execute (cyclomatic 25) crates/webcodex-openai-tunnel/src/bin/webcodex-tunnel/main.rs:21 — webcodex_openai_tunnel::bin::webcodex-tunnel::main::execute 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.
  • webcodex_openai_tunnel::run_fence::check_archives (cyclomatic 20) crates/webcodex-openai-tunnel/src/run_fence.rs:164 — webcodex_openai_tunnel::run_fence::check_archives 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.
  • webcodex_openai_tunnel::run_fence::read (cyclomatic 17) crates/webcodex-openai-tunnel/src/run_fence.rs:227 — webcodex_openai_tunnel::run_fence::read 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.
D2 · Cognitive Complexity · webcodex_tool_runtime_contracts · ×4
  • webcodex_tool_runtime_contracts::tool_audit::result::canonical_execution_audit_result_for_tool (cognitive 47) crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:43 — webcodex_tool_runtime_contracts::tool_audit::result::canonical_execution_audit_result_for_tool has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (36 pts), loops 5 (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.
  • webcodex_tool_runtime_contracts::tool_audit::execution_identity::canonical_cargo_validation_target (cognitive 45) crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:62 — webcodex_tool_runtime_contracts::tool_audit::execution_identity::canonical_cargo_validation_target has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 5 (11 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 22). 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.
  • webcodex_tool_runtime_contracts::tool_audit::result::computer_observation_result_audit (cognitive 36) crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:347 — webcodex_tool_runtime_contracts::tool_audit::result::computer_observation_result_audit has cognitive complexity 36 (threshold 15). Drivers by points: loops 10 (21 pts), if/else 11 (14 pts), boolean chains 1 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • webcodex_tool_runtime_contracts::tool_audit::request::typed_agent_task_request_audit (cognitive 24) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:537 — webcodex_tool_runtime_contracts::tool_audit::request::typed_agent_task_request_audit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · webcodex_openai_tunnel · ×4
  • webcodex_openai_tunnel::run_transitions::check_intents (cognitive 34) crates/webcodex-openai-tunnel/src/run_transitions.rs:140 — webcodex_openai_tunnel::run_transitions::check_intents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 9, 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.
  • webcodex_openai_tunnel::bin::webcodex-tunnel::main::execute (cognitive 31) crates/webcodex-openai-tunnel/src/bin/webcodex-tunnel/main.rs:21 — webcodex_openai_tunnel::bin::webcodex-tunnel::main::execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 4 (5 pts), boolean chains 1, 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.
  • webcodex_openai_tunnel::command::request_headers (cognitive 26) crates/webcodex-openai-tunnel/src/command.rs:6 — webcodex_openai_tunnel::command::request_headers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 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.
  • webcodex_openai_tunnel::run_fence::check_archives (cognitive 24) crates/webcodex-openai-tunnel/src/run_fence.rs:164 — webcodex_openai_tunnel::run_fence::check_archives has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, 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.
D35 · Change Coupling · Change-coupling hub · ×4
  • Change-coupling hub: fake_server.rs → navigation.rs, supervisor.rs, tests.rs crates/webcodex-lsp/src/fake_server.rs — `crates/webcodex-lsp/src/fake_server.rs` changes together with 3 other files — `crates/webcodex-lsp/src/navigation.rs`, `crates/webcodex-lsp/src/supervisor.rs`, `crates/webcodex-lsp/src/tests.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: lib.rs → projects.rs, requests.rs, main.rs, registration.rs, runner_quic.rs, runner_ws.rs crates/webcodex-runner-config/src/lib.rs — `crates/webcodex-runner-config/src/lib.rs` changes together with 6 other files — `crates/webcodex-runner-registry/src/projects.rs`, `crates/webcodex-runner-registry/src/requests.rs`, `crates/webcodex-runner/src/main.rs`, `crates/webcodex-runner/src/main_tests/registration.rs`, `src/runner_quic.rs`, `src/runner_ws.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
  • Change-coupling hub: main.rs → runner_protocol.rs, projects.rs, validation.rs, runner_quic.rs, runner_ws.rs crates/webcodex-runner/src/main.rs — `crates/webcodex-runner/src/main.rs` changes together with 5 other files — `crates/webcodex-core/src/runner_protocol.rs`, `crates/webcodex-runner-registry/src/projects.rs`, `crates/webcodex-runner-registry/src/validation.rs`, `src/runner_quic.rs`, `src/runner_ws.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
  • Change-coupling hub: registration.rs → requests.rs, runner_quic.rs, runner_ws.rs crates/webcodex-runner/src/main_tests/registration.rs — `crates/webcodex-runner/src/main_tests/registration.rs` changes together with 3 other files — `crates/webcodex-runner-registry/src/requests.rs`, `src/runner_quic.rs`, `src/runner_ws.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×4
  • Edited copy of a member (40 corresponding lines) crates/webcodex-cli/src/lib.rs:1247 — crates/webcodex-cli/src/lib.rs:1247-1291 | crates/webcodex-cli/src/lib.rs:1293-1332 — 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.
  • Edited copy of a member (40 corresponding lines) crates/webcodex-cli/src/webcodex_cli/system.rs:475 — crates/webcodex-cli/src/webcodex_cli/system.rs:475-514 | crates/webcodex-cli/src/webcodex_cli/system.rs:517-556 — 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.
  • Edited copy of a member (40 corresponding lines) src/mcp/resources.rs:185 — src/mcp/resources.rs:185-224 | src/mcp/resources.rs:342-381 — 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.
  • Edited copy of a member (40 corresponding lines) scripts/e2e_project_share_roots.py:166 — scripts/e2e_project_share_roots.py:166-206 | scripts/e2e_share_oauth_restart.py:172-211 — 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 (32 corresponding lines) · ×4
  • Edited copy of a member (32 corresponding lines) crates/webcodex-validation/src/adapters/go.rs:84 — crates/webcodex-validation/src/adapters/go.rs:84-127 | crates/webcodex-validation/src/adapters/go.rs:163-194 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/webcodex-runner/src/webcodex_runner/project_build.rs:231 — crates/webcodex-runner/src/webcodex_runner/project_build.rs:231-262 | crates/webcodex-runner/src/webcodex_runner/validation/project.rs:215-254 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/webcodex-tool-contracts/src/registry/output_schemas/browser.rs:4 — crates/webcodex-tool-contracts/src/registry/output_schemas/browser.rs:4-38 | crates/webcodex-tool-contracts/src/registry/output_schemas/computer.rs:30-61 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) src/plugin_gateway.rs:532 — src/plugin_gateway.rs:532-563 | src/plugin_gateway.rs:569-603 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×4
  • Edited copy of a member (34 corresponding lines) crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs:175 — crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs:175-208 | crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs:233-268 — 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.
  • Edited copy of a member (34 corresponding lines) src/tool_runtime/goal.rs:1391 — src/tool_runtime/goal.rs:1391-1427 | src/tool_runtime/goal.rs:1469-1502 — 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.
  • Edited copy of a member (34 corresponding lines) scripts/release_publication.py:687 — scripts/release_publication.py:687-720 | scripts/release_readiness.py:370-408 — 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.
  • Edited copy of a member (34 corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport_tests/polling_recovery.rs:1248 — crates/webcodex-runner/src/webcodex_runner/transport_tests/polling_recovery.rs:1248-1284 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:638-671 — 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 (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:134 — crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:134-157 | src/tool_runtime/projects.rs:1474-1500 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:182 — crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:182-205 | crates/webcodex-tool-runtime-contracts/src/tool_audit/execution_identity.rs:234-264 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/webcodex-store/src/model_reference.rs:176 — crates/webcodex-store/src/model_reference.rs:176-206 | crates/webcodex-store/src/project_reference.rs:173-196 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) src/tool_runtime/files/mutations/preflight.rs:123 — src/tool_runtime/files/mutations/preflight.rs:123-149 | src/tool_runtime/files/mutations/text_edits.rs:361-384 — 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 (25 corresponding lines) · ×4
  • Edited copy of a member (25 corresponding lines) crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:327 — crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:327-357 | crates/webcodex-runner/src/webcodex_runner/projects/registration.rs:507-531 — 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) apps/desktop/src-tauri/src/webcodex/adapter.rs:980 — apps/desktop/src-tauri/src/webcodex/adapter.rs:980-1004 | src/project_entry_regular_tunnel.rs:281-306 — 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) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:303 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:303-327 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:335-359 — 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) src/mcp_gateway.rs:591 — src/mcp_gateway.rs:591-615 | src/mcp_gateway.rs:617-650 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 16+ corresponding lines) apps/desktop/src-tauri/src/diagnostics.rs:105 — apps/desktop/src-tauri/src/diagnostics.rs:105-121 | apps/desktop/src-tauri/src/webcodex/settings.rs:122-137 | crates/webcodex-environment/src/upgrade.rs:798-816 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) src/mcp_gateway.rs:42 — src/mcp_gateway.rs:42-57 | src/plugin_gateway.rs:57-77 | src/ssh_resource_gateway.rs:76-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/webcodex-core/src/lsp_bridge.rs:734 — crates/webcodex-core/src/lsp_bridge.rs:734-749 | crates/webcodex-lsp/src/navigation.rs:1121-1141 | crates/webcodex-lsp/src/navigation.rs:1680-1700 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/webcodex-browser/src/supervisor.rs:792 — crates/webcodex-browser/src/supervisor.rs:792-807 | crates/webcodex-browser/src/supervisor.rs:815-830 | crates/webcodex-browser/src/supervisor.rs:838-853 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/webcodex-core/src/runner_operation.rs:170 — crates/webcodex-core/src/runner_operation.rs:170-183 | crates/webcodex-core/src/runner_operation.rs:185-198 | crates/webcodex-core/src/runner_operation.rs:200-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/webcodex-core/src/runner_operation.rs:2384 — crates/webcodex-core/src/runner_operation.rs:2384-2397 | crates/webcodex-core/src/runner_operation.rs:2399-2414 | crates/webcodex-core/src/runner_operation.rs:2416-2431 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/webcodex-environment/src/service/linux.rs:523 — crates/webcodex-environment/src/service/linux.rs:523-538 | crates/webcodex-environment/src/service/macos.rs:385-398 | crates/webcodex-environment/src/service/macos.rs:400-413 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/webcodex-store/src/agent_task/models.rs:105 — crates/webcodex-store/src/agent_task/models.rs:105-118 | crates/webcodex-store/src/agent_wake.rs:67-82 | crates/webcodex-store/src/agent_wake.rs:97-111 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:147 — crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:147-161 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:616-631 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs` and `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:147` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15–16 lines × 2) crates/webcodex-computer/src/platform/macos/accessibility.rs:957 — crates/webcodex-computer/src/platform/macos/accessibility.rs:957-971 | crates/webcodex-computer/src/platform/windows/accessibility.rs:754-769 — `crates/webcodex-computer/src/platform/macos/accessibility.rs` and `crates/webcodex-computer/src/platform/windows/accessibility.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 64 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-computer/src/platform/macos/accessibility.rs:957` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-computer/src/platform/macos/accessibility.rs:972` calls `ensure_remaining` and `crates/webcodex-computer/src/platform/windows/accessibility.rs:770` 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 (15–16 lines × 2) src/tool_runtime/coding_task/project.rs:422 — src/tool_runtime/coding_task/project.rs:422-436 | src/tool_runtime/coding_task/project.rs:437-452 — both copies are in the same file, so extract the 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.
  • Duplicated block (15–16 lines × 2) src/tool_runtime/runtime_info.rs:608 — src/tool_runtime/runtime_info.rs:608-623 | src/tool_runtime/runtime_info.rs:932-946 — both copies are in the same file, so extract the 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 `src/tool_runtime/runtime_info.rs:608` 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, `src/tool_runtime/runtime_info.rs:606` calls `to_string`, `into_value` and `src/tool_runtime/runtime_info.rs:932` 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 lines × 3) · ×4
  • Duplicated block (15 lines × 3) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:903 — crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:903-917 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1131-1145 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1295-1309 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) src/mcp_tests/plugin_check.rs:61 — src/mcp_tests/plugin_check.rs:61-75 | src/mcp_tests/plugin_tools.rs:21-35 | src/mcp_tests/tools.rs:182-196 — before extracting anything, compare `src/mcp_tests/plugin_check.rs` and `src/mcp_tests/plugin_tools.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 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 `src/mcp_tests/plugin_check.rs:61` 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 (15 lines × 3) src/mcp_tests/http_transport.rs:1212 — src/mcp_tests/http_transport.rs:1212-1226 | src/mcp_tests/http_transport.rs:1323-1337 | src/mcp_tests/http_transport.rs:1416-1430 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) src/mcp_tests/file_import.rs:987 — src/mcp_tests/file_import.rs:987-1001 | src/mcp_tests/file_import.rs:1162-1176 | src/mcp_tests/file_import.rs:1248-1262 — 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 `src/mcp_tests/file_import.rs:987` 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 (12–14 lines × 2) · ×4
  • Duplicated block (12–14 lines × 2) crates/webcodex-cli/src/webcodex_cli/system.rs:189 — crates/webcodex-cli/src/webcodex_cli/system.rs:189-202 | src/project_entry_windows.rs:142-153 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/system.rs` and `src/project_entry_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/system.rs:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) crates/webcodex-store/src/agent_wake.rs:2115 — crates/webcodex-store/src/agent_wake.rs:2115-2128 | crates/webcodex-store/src/agent_wake.rs:2182-2193 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/agent_wake.rs:2115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) crates/webcodex-store/src/oauth.rs:540 — crates/webcodex-store/src/oauth.rs:540-553 | crates/webcodex-store/src/oauth.rs:920-931 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/oauth.rs:540` 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–14 lines × 2) src/mcp_tests/http_transport.rs:1249 — src/mcp_tests/http_transport.rs:1249-1260 | src/mcp_tests/http_transport.rs:1342-1355 — both copies are in the same file, so extract the 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 `src/mcp_tests/http_transport.rs:1249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×4
  • Duplicated block (13–14 lines × 2) crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:99 — crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:99-112 | crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:161-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13–14 lines × 2) src/tool_runtime/code_mode.rs:406 — src/tool_runtime/code_mode.rs:406-418 | src/tool_runtime/code_mode.rs:422-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/code_mode.rs:422` 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–14 lines × 2) src/tool_runtime/job_terminal_wait.rs:259 — src/tool_runtime/job_terminal_wait.rs:259-272 | src/tool_runtime/job_terminal_wait.rs:297-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/job_terminal_wait.rs:259` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13–14 lines × 2) src/mcp_tests/artifact_export.rs:177 — src/mcp_tests/artifact_export.rs:177-189 | src/mcp_tests/artifact_export.rs:260-273 — both copies are in the same file, so extract the 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 `src/mcp_tests/artifact_export.rs:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/mcp_tests/artifact_export.rs:257` calls `complete_mcp_export_metadata`, `clone` and `src/mcp_tests/artifact_export.rs:176` 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 (11–13 lines × 2) · ×4
  • Duplicated block (11–13 lines × 2) crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:538 — crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:538-548 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:595-607 — both copies are in the same file, so extract the 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 `crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:538` 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–13 lines × 2) src/mcp.rs:872 — src/mcp.rs:872-882 | src/runtime_http.rs:159-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/mcp.rs:872` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11–13 lines × 2) src/project_entry_cloudflared.rs:622 — src/project_entry_cloudflared.rs:622-632 | src/project_entry_setup.rs:1164-1176 — before extracting anything, compare `src/project_entry_cloudflared.rs` and `src/project_entry_setup.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `src/project_entry_cloudflared.rs:622` 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–13 lines × 2) src/runner_tokens_http/routes.rs:71 — src/runner_tokens_http/routes.rs:71-81 | src/runner_tokens_http/routes.rs:166-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×4
  • Duplicated block (8–9 lines × 2) crates/webcodex-environment/src/upgrade.rs:2025 — crates/webcodex-environment/src/upgrade.rs:2025-2032 | crates/webcodex-environment/src/upgrade.rs:2168-2176 — both copies are in the same file, so extract the 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.
  • Duplicated block (8–9 lines × 2) crates/webcodex-validation/src/adapters/rust.rs:212 — crates/webcodex-validation/src/adapters/rust.rs:212-220 | crates/webcodex-validation/src/adapters/rust.rs:264-271 — both copies are in the same file, so extract the 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 `crates/webcodex-validation/src/adapters/rust.rs:212` 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, `crates/webcodex-validation/src/adapters/rust.rs:263` calls `validate_filter`, `validate_arg` and `crates/webcodex-validation/src/adapters/rust.rs:212` 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 (8–9 lines × 2) src/tool_runtime/context_projection.rs:185 — src/tool_runtime/context_projection.rs:185-193 | src/tool_runtime/session_context.rs:482-489 — 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 `src/tool_runtime/context_projection.rs:185` 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–9 lines × 2) src/tool_runtime/context_projection.rs:186 — src/tool_runtime/context_projection.rs:186-193 | src/tool_runtime/permissions/mod.rs:67-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_runtime/permissions/mod.rs:67` 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 (6–7 lines × 2) · ×4
  • Duplicated block (6–7 lines × 2) crates/webcodex-tool-contracts/src/registry/output_schemas/sessions.rs:33 — crates/webcodex-tool-contracts/src/registry/output_schemas/sessions.rs:33-39 | crates/webcodex-tool-contracts/src/registry/output_schemas/sessions.rs:87-92 — both copies are in the same file, so extract the 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 `crates/webcodex-tool-contracts/src/registry/output_schemas/sessions.rs:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–7 lines × 2) src/config.rs:9 — src/config.rs:9-14 | src/console_web.rs:262-268 — 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 `src/config.rs:9` 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–7 lines × 2) scripts/release_operator.py:63 — scripts/release_operator.py:63-68 | scripts/release_operator.py:91-97 — both copies are in the same file, so extract the 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 `scripts/release_operator.py:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6–7 lines × 2) scripts/release_plan.py:358 — scripts/release_plan.py:358-364 | scripts/release_plan.py:416-421 — both copies are in the same file, so extract the 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 `scripts/release_plan.py:358` 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.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×4
  • Duplicated block (6 lines × 2 locations) apps/desktop/src/features/extensions/CodingAgentEditor.tsx:44 — apps/desktop/src/features/extensions/CodingAgentEditor.tsx:44 · apps/desktop/src/features/extensions/McpProviderEditor.tsx:20 — 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 (6 lines × 2 locations) scripts/ui-smoke/admin-preferences.mjs:105 — scripts/ui-smoke/admin-preferences.mjs:105 · scripts/ui-smoke/web-soft-surfaces.mjs:44 — 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 (6 lines × 2 locations) scripts/ui-smoke/sidebar-geometry.mjs:7 — scripts/ui-smoke/sidebar-geometry.mjs:7 · scripts/ui-smoke/web-soft-surfaces.mjs:7 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (6 lines × 2 locations) scripts/ui-smoke/smoke.mjs:520 — scripts/ui-smoke/smoke.mjs:520 · scripts/ui-smoke/smoke.mjs:578 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D1 · Cyclomatic Complexity · LspSupervisor · ×3
  • LspSupervisor::request_with_timeout_and_encoding_inner (cyclomatic 31) crates/webcodex-lsp/src/supervisor.rs:736 — LspSupervisor::request_with_timeout_and_encoding_inner 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.
  • LspSupervisor::get_or_start (cyclomatic 20) crates/webcodex-lsp/src/supervisor.rs:991 — LspSupervisor::get_or_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.
  • LspSupervisor::document_diagnostics (cyclomatic 17) crates/webcodex-lsp/src/supervisor.rs:538 — LspSupervisor::document_diagnostics has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: LspError::fmt (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · webcodex_computer · ×3
  • webcodex_computer::platform::windows::accessibility::uia_control_role (cyclomatic 28) crates/webcodex-computer/src/platform/windows/accessibility.rs:223 — webcodex_computer::platform::windows::accessibility::uia_control_role has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_computer::platform::macos::applications::mac_application_candidate_at_path (cyclomatic 23) crates/webcodex-computer/src/platform/macos/applications.rs:160 — webcodex_computer::platform::macos::applications::mac_application_candidate_at_path has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webcodex_computer::platform::windows::accessibility::control (cyclomatic 17) crates/webcodex-computer/src/platform/windows/accessibility.rs:1180 — webcodex_computer::platform::windows::accessibility::control 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 · UpdateManager · ×3
  • UpdateManager::status_view_for_target (cyclomatic 25) crates/webcodex-environment/src/unified_update/view.rs:181 — UpdateManager::status_view_for_target 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.
  • UpdateManager::run_locked (cyclomatic 19) crates/webcodex-environment/src/unified_update/download.rs:467 — UpdateManager::run_locked 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.
  • UpdateManager::install_locked (cyclomatic 19) crates/webcodex-environment/src/unified_update/install.rs:105 — UpdateManager::install_locked 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 · SessionStore · ×3
  • SessionStore::ensure_coding_session_with_git_baseline (cyclomatic 24) crates/webcodex-workflow-session/src/store.rs:561 — SessionStore::ensure_coding_session_with_git_baseline 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.
  • SessionStore::record_validation_job_terminal (cyclomatic 24) crates/webcodex-workflow-session/src/store.rs:1853 — SessionStore::record_validation_job_terminal 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.
  • SessionStore::resolve_ack_ref (cyclomatic 16) crates/webcodex-workflow-session/src/messages.rs:211 — SessionStore::resolve_ack_ref 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.
D2 · Cognitive Complexity · TunnelClient · ×3
  • TunnelClient::poller (cognitive 93) crates/webcodex-openai-tunnel/src/poller.rs:12 — TunnelClient::poller has cognitive complexity 93 (threshold 15). Drivers by points: if/else 17 (57 pts), match/switch 4 (18 pts), loops 6 (15 pts), boolean chains 3 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TunnelClient::forward (cognitive 35) crates/webcodex-openai-tunnel/src/mcp_http.rs:35 — TunnelClient::forward has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 4 (10 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.
  • TunnelClient::sse (cognitive 27) crates/webcodex-openai-tunnel/src/mcp_http.rs:199 — TunnelClient::sse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 1 (5 pts), 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 · AppState · ×3
  • AppState::local_update_status (cognitive 84) apps/desktop/src-tauri/src/state/updates/view.rs:250 — AppState::local_update_status has cognitive complexity 84 (threshold 15). Drivers by points: if/else 23 (47 pts), match/switch 6 (23 pts), loops 2 (8 pts), boolean chains 6 (nesting depth added 47). 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.
  • AppState::cloudflare_connection (cognitive 21) apps/desktop/src-tauri/src/state/cloudflare_connections.rs:98 — AppState::cloudflare_connection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • AppState::diagnostics (cognitive 17) apps/desktop/src-tauri/src/state/diagnostics.rs:25 — AppState::diagnostics has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 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 · SessionStore · ×3
  • SessionStore::ensure_coding_session_with_git_baseline (cognitive 36) crates/webcodex-workflow-session/src/store.rs:561 — SessionStore::ensure_coding_session_with_git_baseline has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 6, 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.
  • SessionStore::resolve_ack_ref (cognitive 20) crates/webcodex-workflow-session/src/messages.rs:211 — SessionStore::resolve_ack_ref has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 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.
  • SessionStore::record_validation_job_terminal (cognitive 18) crates/webcodex-workflow-session/src/store.rs:1853 — SessionStore::record_validation_job_terminal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 5, 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 · UpdateManager · ×3
  • UpdateManager::status_view_for_target (cognitive 34) crates/webcodex-environment/src/unified_update/view.rs:181 — UpdateManager::status_view_for_target has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 5, loops 1 (3 pts), match/switch 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.
  • UpdateManager::run_locked (cognitive 22) crates/webcodex-environment/src/unified_update/download.rs:467 — UpdateManager::run_locked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, 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.
  • UpdateManager::install_locked (cognitive 19) crates/webcodex-environment/src/unified_update/install.rs:105 — UpdateManager::install_locked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, match/switch 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 · SessionStoreInner · ×3
  • SessionStoreInner::complete_message (cognitive 32) crates/webcodex-workflow-session/src/store.rs:3338 — SessionStoreInner::complete_message has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 2 (5 pts), boolean chains 4 (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.
  • SessionStoreInner::compact_hot_sessions (cognitive 24) crates/webcodex-workflow-session/src/store/residency.rs:60 — SessionStoreInner::compact_hot_sessions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SessionStoreInner::post_message (cognitive 16) crates/webcodex-workflow-session/src/store.rs:2832 — SessionStoreInner::post_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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 · ControllerRuntime · ×3
  • ControllerRuntime::reap_and_recover (cognitive 30) crates/webcodex-cli/src/webcodex_cli/controller.rs:1242 — ControllerRuntime::reap_and_recover has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ControllerRuntime::poll_wsl2_start (cognitive 25) crates/webcodex-cli/src/webcodex_cli/controller_wsl2_nat_startup.rs:214 — ControllerRuntime::poll_wsl2_start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ControllerRuntime::poll_runner_observation (cognitive 22) crates/webcodex-cli/src/webcodex_cli/controller_runner_observation.rs:139 — ControllerRuntime::poll_runner_observation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 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 · webcodex_process · ×3
  • webcodex_process::windows::resume_process_threads (cognitive 20) crates/webcodex-process/src/windows.rs:331 — webcodex_process::windows::resume_process_threads has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 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.
  • webcodex_process::program::resolve_program_in_path_with_pathext (cognitive 18) crates/webcodex-process/src/program.rs:64 — webcodex_process::program::resolve_program_in_path_with_pathext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 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.
  • webcodex_process::unix::group_has_live_members (cognitive 16) crates/webcodex-process/src/unix.rs:304 — webcodex_process::unix::group_has_live_members has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFunctions · ×3
  • TooManyFunctions: webcodex::tool_runtime::files::search src/tool_runtime/files/search.rs:172 — TooManyFunctions — 41 free functions. The bar is 30 free functions; this is 11 over it, 1.37× 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.
  • TooManyFunctions: webcodex_tool_contracts::tool_policy crates/webcodex-tool-contracts/src/tool_policy.rs:186 — TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× 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.
  • TooManyFunctions: webcodex::auth::middleware src/auth/middleware.rs:20 — TooManyFunctions — 33 free functions. The bar is 30 free functions; 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.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×3
  • Edited copy of a member (63 corresponding lines) apps/desktop/src-tauri/src/ssh_resources.rs:330 — apps/desktop/src-tauri/src/ssh_resources.rs:330-410 | apps/desktop/src-tauri/src/workspace.rs:168-230 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (63 corresponding lines) crates/webcodex-environment/src/storage.rs:381 — crates/webcodex-environment/src/storage.rs:381-456 | src/upgrade_maintenance_store.rs:67-129 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (63 corresponding lines) scripts/release_publication.py:807 — scripts/release_publication.py:807-869 | scripts/release_readiness.py:505-597 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×3
  • Edited copy of a member (49 corresponding lines) crates/webcodex-validation/src/adapters/rust.rs:208 — crates/webcodex-validation/src/adapters/rust.rs:208-256 | crates/webcodex-validation/src/adapters/rust.rs:258-316 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) crates/webcodex-cli/src/lib.rs:1385 — crates/webcodex-cli/src/lib.rs:1385-1433 | crates/webcodex-cli/src/lib.rs:1774-1825 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) crates/webcodex-runner-registry/src/requests.rs:1373 — crates/webcodex-runner-registry/src/requests.rs:1373-1421 | crates/webcodex-runner-registry/src/requests.rs:1644-1696 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×3
  • Edited copy of a member (43 corresponding lines) crates/webcodex-cli/src/webcodex_cli/plugin.rs:558 — crates/webcodex-cli/src/webcodex_cli/plugin.rs:558-611 | crates/webcodex-cli/src/webcodex_cli/plugin.rs:613-655 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) src/runner_tokens_http/routes.rs:294 — src/runner_tokens_http/routes.rs:294-343 | src/users_http/tokens.rs:255-297 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) apps/desktop/src-tauri/src/webcodex/adapter.rs:424 — apps/desktop/src-tauri/src/webcodex/adapter.rs:424-466 | apps/desktop/src-tauri/src/webcodex/adapter.rs:475-526 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) crates/webcodex-admin/src/commands.rs:384 — crates/webcodex-admin/src/commands.rs:384-427 | crates/webcodex-admin/src/commands.rs:480-516 — 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.
  • Edited copy of a member (37 corresponding lines) src/mcp/tools/invocation.rs:283 — src/mcp/tools/invocation.rs:283-322 | src/mcp/tools/invocation.rs:326-362 — 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.
  • Edited copy of a member (37 corresponding lines) crates/webcodex-core/src/lsp_bridge.rs:580 — crates/webcodex-core/src/lsp_bridge.rs:580-616 | crates/webcodex-core/src/validation_bridge.rs:460-497 — 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 (42 corresponding lines) · ×3
  • Edited copy of a member (42 corresponding lines) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1292 — crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:1292-1335 | crates/webcodex-runner/src/webcodex_runner/plugin.rs:1907-1948 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (42 corresponding lines) src/oauth_http/html.rs:91 — src/oauth_http/html.rs:91-132 | src/oauth_http/html.rs:142-191 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (42 corresponding lines) crates/webcodex-store/src/agent_task/invariants.rs:687 — crates/webcodex-store/src/agent_task/invariants.rs:687-733 | crates/webcodex-store/src/agent_wake.rs:2525-2566 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 20+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 20+ corresponding lines) src/mcp/tools.rs:561 — src/mcp/tools.rs:561-584 | src/mcp/tools.rs:659-682 | src/mcp/tools.rs:734-753 — 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.
  • Edited copies of one member (3 members, 20+ corresponding lines) src/tool_runtime/goal.rs:136 — src/tool_runtime/goal.rs:136-155 | src/tool_runtime/goal.rs:157-176 | src/tool_runtime/goal.rs:178-197 — 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.
  • Edited copies of one member (3 members, 20+ corresponding lines) src/tool_runtime/resource_references.rs:248 — src/tool_runtime/resource_references.rs:248-267 | src/tool_runtime/workbench_execution.rs:49-71 | src/tool_runtime/workbench_state.rs:428-451 — 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, 11+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 11+ corresponding lines) src/admin_http.rs:261 — src/admin_http.rs:261-271 | src/admin_http.rs:274-284 | src/admin_http.rs:291-301 | src/admin_http.rs:317-327 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) src/tool_runtime/memory.rs:165 — src/tool_runtime/memory.rs:165-176 | src/tool_runtime/memory.rs:233-243 | src/tool_runtime/memory.rs:245-257 | src/tool_runtime/skills.rs:2426-2439 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) crates/webcodex-core/src/authority.rs:55 — crates/webcodex-core/src/authority.rs:55-67 | src/auth/project_credential.rs:196-206 | src/auth/project_credential.rs:208-218 | src/auth/project_credential.rs:220-231 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:789 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:789-800 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:114-125 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:270-281 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) src/plugin_gateway.rs:989 — src/plugin_gateway.rs:989-1000 | src/plugin_gateway.rs:1002-1013 | src/plugin_gateway.rs:1017-1028 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/webcodex-core/src/project_build.rs:171 — crates/webcodex-core/src/project_build.rs:171-183 | crates/webcodex-core/src/project_validation.rs:192-204 | crates/webcodex-store/src/artifact_handoff.rs:954-965 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/webcodex-store/src/window_collaboration.rs:353 — crates/webcodex-store/src/window_collaboration.rs:353-376 | crates/webcodex-store/src/window_collaboration.rs:384-398 | crates/webcodex-store/src/window_collaboration.rs:406-425 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/webcodex-store/src/agent_wake.rs:2901 — crates/webcodex-store/src/agent_wake.rs:2901-2915 | crates/webcodex-store/src/communication.rs:3210-3226 | crates/webcodex-store/src/store_primitives.rs:137-155 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) REDACTED:910 — REDACTED:910-925 | REDACTED:931-945 | REDACTED:947-964 — 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 · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) crates/webcodex-cli/src/webcodex_cli/token_commands.rs:83 — crates/webcodex-cli/src/webcodex_cli/token_commands.rs:83-93 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:142-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/token_commands.rs:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) crates/webcodex-environment/src/process/unix.rs:99 — crates/webcodex-environment/src/process/unix.rs:99-110 | crates/webcodex-environment/src/process/windows.rs:80-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-environment/src/process/unix.rs:99` 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–12 lines × 2) src/users_http/tokens.rs:119 — src/users_http/tokens.rs:119-130 | src/users_http/tokens.rs:196-206 — both copies are in the same file, so extract the 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 `src/users_http/tokens.rs:119` 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. 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 (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) apps/desktop/src-tauri/src/state/persistence.rs:181 — apps/desktop/src-tauri/src/state/persistence.rs:181-190 | crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:326-335 | crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:547-556 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2159-2168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:336` calls `now`, `from_millis` and `crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2169` 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 (10 lines × 4) crates/webcodex-runner-registry/src/projects.rs:202 — crates/webcodex-runner-registry/src/projects.rs:202-211 | crates/webcodex-runner-registry/src/projects.rs:258-267 | crates/webcodex-runner-registry/src/runners.rs:720-729 | crates/webcodex-runner-registry/src/runners.rs:799-808 — 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. 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, `crates/webcodex-runner-registry/src/runners.rs:809` calls `Some` and `crates/webcodex-runner-registry/src/runners.rs:730` 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 (10 lines × 4) crates/webcodex-store/src/artifact_handoff.rs:629 — crates/webcodex-store/src/artifact_handoff.rs:629-638 | crates/webcodex-store/src/artifact_handoff.rs:747-756 | crates/webcodex-store/src/artifact_handoff.rs:803-812 | crates/webcodex-store/src/artifact_handoff.rs:871-880 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-store/src/artifact_handoff.rs:627` calls `validate_idempotency_key`, `validate_request_hash` and `crates/webcodex-store/src/artifact_handoff.rs:746` 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 (7–9 lines × 2) · ×3
  • Duplicated block (7–9 lines × 2) apps/desktop/src-tauri/src/diagnostics.rs:623 — apps/desktop/src-tauri/src/diagnostics.rs:623-631 | crates/webcodex-cli/src/webcodex_cli/login.rs:168-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–9 lines × 2) crates/webcodex-environment/src/privilege.rs:52 — crates/webcodex-environment/src/privilege.rs:52-58 | crates/webcodex-environment/src/privilege.rs:135-143 — both copies are in the same file, so extract the 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 `crates/webcodex-environment/src/privilege.rs:52` 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–9 lines × 2) crates/webcodex-environment/src/tunnel.rs:1748 — crates/webcodex-environment/src/tunnel.rs:1748-1756 | crates/webcodex-environment/src/tunnel.rs:1841-1847 — both copies are in the same file, so extract the 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 `crates/webcodex-environment/src/tunnel.rs:1748` 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) crates/webcodex-runner-registry/src/job_updates.rs:1222 — crates/webcodex-runner-registry/src/job_updates.rs:1222-1229 | crates/webcodex-runner-registry/src/job_updates.rs:1943-1950 | crates/webcodex-runner-registry/src/job_updates.rs:1991-1998 | crates/webcodex-runner-registry/src/job_updates.rs:2038-2045 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner-registry/src/job_updates.rs:2037` calls `is_err` and `crates/webcodex-runner-registry/src/job_updates.rs:1990` 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 × 4) src/oauth_http/token.rs:222 — src/oauth_http/token.rs:222-229 | src/oauth_http/token.rs:239-246 | src/oauth_http/token.rs:352-359 | src/oauth_http/token.rs:369-376 — 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.
  • Duplicated block (8 lines × 4) src/mcp.rs:1032 — src/mcp.rs:1032-1040 | src/mcp.rs:1227-1234 | src/mcp.rs:1255-1262 | src/mcp.rs:1297-1304 — 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 `src/mcp.rs:1032` 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 (5–6 lines × 2) · ×3
  • Duplicated block (5–6 lines × 2) crates/webcodex-lsp/src/supervisor.rs:569 — crates/webcodex-lsp/src/supervisor.rs:569-573 | crates/webcodex-lsp/src/supervisor.rs:589-594 — both copies are in the same file, so extract the 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 `crates/webcodex-lsp/src/supervisor.rs:589` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5–6 lines × 2) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:334 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:334-339 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:414-418 — both copies are in the same file, so extract the 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.
  • Duplicated block (5–6 lines × 2) src/tool_runtime/files/mutations/patch_result.rs:146 — src/tool_runtime/files/mutations/patch_result.rs:146-151 | src/tool_runtime/files/mutations/patch_result.rs:491-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×3
  • Duplicated block (8 lines × 2 locations) apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:38 — apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:38 · apps/desktop/src/features/extensions/McpProvidersPanel.tsx:22 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 2 locations) scripts/ui-smoke/collaboration-history.mjs:30 — scripts/ui-smoke/collaboration-history.mjs:30 · scripts/ui-smoke/work-result-card.mjs:40 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 2 locations) scripts/ui-smoke/projects-runtime.mjs:26 — scripts/ui-smoke/projects-runtime.mjs:26 · scripts/ui-smoke/runtime-overview.mjs:19 — 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 (7 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (7 matched lines × 2 locations) apps/desktop/src/features/connection/ConnectionEditor.tsx:12 — apps/desktop/src/features/connection/ConnectionEditor.tsx:12 · apps/desktop/src/features/connection/TunnelConfigDiagnostics.tsx:9 — the two spans are one implementation copied and then locally edited — 56 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.
  • Duplicated block with local edits (7 matched lines × 2 locations) apps/desktop/src/features/projects/AddDevice.tsx:108 — apps/desktop/src/features/projects/AddDevice.tsx:108 · apps/desktop/src/features/settings/ConfigurationDataPanel.tsx:120 — the two spans are one implementation copied and then locally edited — 68 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.
  • Duplicated block with local edits (7 matched lines × 2 locations) scripts/ui-smoke/desktop-soft-surfaces.mjs:93 — scripts/ui-smoke/desktop-soft-surfaces.mjs:93 · scripts/ui-smoke/web-soft-surfaces.mjs:75 — the two spans are one implementation copied and then locally edited — 52 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×3
  • Duplicated block (7 lines × 2 locations) apps/desktop/src/hooks/useAppearance.ts:44 — apps/desktop/src/hooks/useAppearance.ts:44 · apps/desktop/src/hooks/useAppearance.ts:55 — 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 (7 lines × 2 locations) scripts/ui-smoke/mcp-workspaces.mjs:450 — scripts/ui-smoke/mcp-workspaces.mjs:450 · scripts/ui-smoke/mcp-workspaces.mjs:489 — 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 (7 lines × 2 locations) scripts/ui-smoke/smoke.mjs:360 — scripts/ui-smoke/smoke.mjs:360 · scripts/ui-smoke/smoke.mjs:649 — 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 (7 lines × 3 locations) · ×3
  • Duplicated block (7 lines × 3 locations) apps/desktop/src/i18n/presentation.ts:226 — apps/desktop/src/i18n/presentation.ts:226 · apps/desktop/src/i18n/presentation.ts:234 · apps/desktop/src/i18n/presentation.ts:242 — all 3 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 (7 lines × 3 locations) scripts/ui-smoke/agents-workbench.mjs:6 — scripts/ui-smoke/agents-workbench.mjs:6 · scripts/ui-smoke/runtime-overview.mjs:7 · scripts/ui-smoke/work-header.mjs:7 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
  • Duplicated block (7 lines × 3 locations) scripts/ui-smoke/desktop-clarity-layout.mjs:54 — scripts/ui-smoke/desktop-clarity-layout.mjs:54 · scripts/ui-smoke/desktop-page-fixtures.mjs:16 · scripts/ui-smoke/desktop-soft-surfaces.mjs:172 — the 3 copies are spread across 3 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 (6 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (6 matched lines × 2 locations) scripts/ui-smoke/sidebar-geometry.mjs:122 — scripts/ui-smoke/sidebar-geometry.mjs:122 · scripts/ui-smoke/web-detail-consistency.mjs:101 — the two spans are one implementation copied and then locally edited — 97 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.
  • Duplicated block with local edits (6 matched lines × 2 locations) scripts/ui-smoke/tab-alignment.mjs:110 — scripts/ui-smoke/tab-alignment.mjs:110 · scripts/ui-smoke/window-workspace.mjs:20 — the two spans are one implementation copied and then locally edited — 61 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.
  • Duplicated block with local edits (6 matched lines × 2 locations) scripts/ui-smoke/window-collaboration.mjs:38 — scripts/ui-smoke/window-collaboration.mjs:38 · scripts/ui-smoke/work-result-card.mjs:194 — the two spans are one implementation copied and then locally edited — 71 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 (5 lines × 2 locations) · ×3
  • Duplicated block (5 lines × 2 locations) apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:15 — apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:15 · apps/desktop/src/features/settings/DiagnosticsPanel.tsx:27 — 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.
  • Duplicated block (5 lines × 2 locations) apps/desktop/src/features/settings/LocalServicesPanel.tsx:11 — apps/desktop/src/features/settings/LocalServicesPanel.tsx:11 · apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (5 lines × 2 locations) apps/desktop/src/i18n/instructions.ts:24 — apps/desktop/src/i18n/instructions.ts:24 · apps/desktop/src/i18n/service-scope.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.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×2
  • Modal dialog does not manage focus frontend/src/ui/AccentPalette.tsx:44 — 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 frontend/src/ui/ProjectPicker.tsx:97 — 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.
D1 · Cyclomatic Complexity · AppState · ×2
  • AppState::local_update_status (cyclomatic 38) apps/desktop/src-tauri/src/state/updates/view.rs:250 — AppState::local_update_status has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AppState::cloudflare_connection (cyclomatic 18) apps/desktop/src-tauri/src/state/cloudflare_connections.rs:98 — AppState::cloudflare_connection 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 · JobStartPlan · ×2
  • JobStartPlan::admission_requirements (cyclomatic 34) crates/webcodex-runner-registry/src/job_updates/start.rs:580 — JobStartPlan::admission_requirements has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • JobStartPlan::new (cyclomatic 26) crates/webcodex-runner-registry/src/job_updates/start.rs:177 — JobStartPlan::new 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 · webcodex_code_mode · ×2
  • webcodex_code_mode::runtime::execute_with_termination_mode_inner (cyclomatic 31) crates/webcodex-code-mode/src/runtime.rs:290 — webcodex_code_mode::runtime::execute_with_termination_mode_inner 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.
  • webcodex_code_mode::runtime::run_runtime (cyclomatic 18) crates/webcodex-code-mode/src/runtime.rs:740 — webcodex_code_mode::runtime::run_runtime 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 · TunnelClient · ×2
  • TunnelClient::poller (cyclomatic 31) crates/webcodex-openai-tunnel/src/poller.rs:12 — TunnelClient::poller 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.
  • TunnelClient::forward (cyclomatic 17) crates/webcodex-openai-tunnel/src/mcp_http.rs:35 — TunnelClient::forward 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 · ProviderConnection · ×2
  • ProviderConnection::request (cyclomatic 26) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:943 — ProviderConnection::request 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.
  • ProviderConnection::request (cyclomatic 22) crates/webcodex-runner/src/webcodex_runner/plugin.rs:1652 — ProviderConnection::request 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 · BrowserSupervisor · ×2
  • BrowserSupervisor::batch (cyclomatic 23) crates/webcodex-browser/src/supervisor.rs:1023 — BrowserSupervisor::batch 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.
  • BrowserSupervisor::snapshot_query (cyclomatic 16) crates/webcodex-browser/src/supervisor.rs:382 — BrowserSupervisor::snapshot_query 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.
D2 · Cognitive Complexity · webcodex_code_mode · ×2
  • webcodex_code_mode::runtime::execute_with_termination_mode_inner (cognitive 61) crates/webcodex-code-mode/src/runtime.rs:290 — webcodex_code_mode::runtime::execute_with_termination_mode_inner has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (43 pts), match/switch 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webcodex_code_mode::runtime::run_runtime (cognitive 24) crates/webcodex-code-mode/src/runtime.rs:740 — webcodex_code_mode::runtime::run_runtime has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 3 (4 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 · LspSupervisor · ×2
  • LspSupervisor::request_with_timeout_and_encoding_inner (cognitive 46) crates/webcodex-lsp/src/supervisor.rs:736 — LspSupervisor::request_with_timeout_and_encoding_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 10, match/switch 3 (7 pts), loops 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.
  • LspSupervisor::get_or_start (cognitive 44) crates/webcodex-lsp/src/supervisor.rs:991 — LspSupervisor::get_or_start has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WindowActivityRegistry · ×2
  • WindowActivityRegistry::finish (cognitive 45) src/tool_runtime/window_activity.rs:572 — WindowActivityRegistry::finish has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 1 (3 pts), boolean chains 2 (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.
  • WindowActivityRegistry::start_with_identity (cognitive 23) src/tool_runtime/window_activity.rs:314 — WindowActivityRegistry::start_with_identity has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CdpBackend · ×2
  • CdpBackend::wait_for_stable (cognitive 40) crates/webcodex-browser/src/cdp.rs:1611 — CdpBackend::wait_for_stable has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CdpBackend::snapshot (cognitive 30) crates/webcodex-browser/src/cdp.rs:1007 — CdpBackend::snapshot has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (5 pts), boolean chains 2 (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 · SkillStore · ×2
  • SkillStore::install (cognitive 37) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:801 — SkillStore::install has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 8 (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.
  • SkillStore::gc_expired_replays_locked_at (cognitive 19) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1422 — SkillStore::gc_expired_replays_locked_at has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 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 · RegisteredStream · ×2
  • RegisteredStream::finish (cognitive 33) crates/webcodex-runner/src/webcodex_runner/transport/stream.rs:102 — RegisteredStream::finish has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 18). 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.
  • RegisteredStream::receive (cognitive 22) crates/webcodex-runner/src/webcodex_runner/transport/stream.rs:36 — RegisteredStream::receive has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 3 (8 pts), loops 1 (2 pts) (nesting depth added 13). 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 · JobStartPlan · ×2
  • JobStartPlan::admission_requirements (cognitive 31) crates/webcodex-runner-registry/src/job_updates/start.rs:580 — JobStartPlan::admission_requirements has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 4 (5 pts), match/switch 4 (5 pts), loops 3 (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.
  • JobStartPlan::new (cognitive 27) crates/webcodex-runner-registry/src/job_updates/start.rs:177 — JobStartPlan::new has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, match/switch 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 · ProviderConnection · ×2
  • ProviderConnection::request (cognitive 30) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:943 — ProviderConnection::request has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (4 pts), loops 2 (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.
  • ProviderConnection::request (cognitive 24) crates/webcodex-runner/src/webcodex_runner/plugin.rs:1652 — ProviderConnection::request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 4 (7 pts), loops 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 · BrowserSupervisor · ×2
  • BrowserSupervisor::batch (cognitive 27) crates/webcodex-browser/src/supervisor.rs:1023 — BrowserSupervisor::batch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 2, match/switch 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.
  • BrowserSupervisor::snapshot_query (cognitive 18) crates/webcodex-browser/src/supervisor.rs:382 — BrowserSupervisor::snapshot_query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 1, 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 · webcodex_validation · ×2
  • webcodex_validation::recipe::resolve_validation_recipe_with_policies_and_exclusions (cognitive 23) crates/webcodex-validation/src/recipe.rs:522 — webcodex_validation::recipe::resolve_validation_recipe_with_policies_and_exclusions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, match/switch 2 (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.
  • webcodex_validation::adapters::rust::cargo_test_plan (cognitive 16) crates/webcodex-validation/src/adapters/rust.rs:258 — webcodex_validation::adapters::rust::cargo_test_plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 2 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentContinuationController · ×2
  • AgentContinuationController::verify_mcp_app_registration_target (cognitive 22) src/agent_wake.rs:1358 — AgentContinuationController::verify_mcp_app_registration_target has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, 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.
  • AgentContinuationController::recover_expired_mcp_app_endpoint (cognitive 17) src/agent_wake.rs:514 — AgentContinuationController::recover_expired_mcp_app_endpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 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 · ControlExecution · ×2
  • ControlExecution::validate (cognitive 21) src/tool_runtime/control_sidecar.rs:466 — ControlExecution::validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 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.
  • ControlExecution::decorate_result (cognitive 16) src/tool_runtime/control_sidecar.rs:688 — ControlExecution::decorate_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (63 shared lines) · ×2
  • Near-duplicate member pair (63 shared lines) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:171 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:171-304 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:338-466 — These two members are variants of one another: 63 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.
  • Near-duplicate member pair (63 shared lines) crates/webcodex-computer/src/platform/macos/accessibility.rs:948 — crates/webcodex-computer/src/platform/macos/accessibility.rs:948-1060 | crates/webcodex-computer/src/platform/windows/accessibility.rs:748-867 — These two members are variants of one another: 63 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 · Near-duplicate member pair (55 shared lines) · ×2
  • Near-duplicate member pair (55 shared lines) crates/webcodex-store/src/goal.rs:314 — crates/webcodex-store/src/goal.rs:314-396 | crates/webcodex-store/src/goal.rs:416-515 — These two members are variants of one another: 55 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.
  • Near-duplicate member pair (55 shared lines) crates/webcodex-store/src/goal.rs:900 — crates/webcodex-store/src/goal.rs:900-975 | crates/webcodex-store/src/goal.rs:1003-1085 — These two members are variants of one another: 55 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 · Edited copy of a member (90 corresponding lines) · ×2
  • Edited copy of a member (90 corresponding lines) src/tool_runtime/result_projection.rs:601 — src/tool_runtime/result_projection.rs:601-690 | src/tool_runtime/result_projection.rs:787-879 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (90 corresponding lines) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:100 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:100-189 | crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:194-292 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (57 corresponding lines) · ×2
  • Edited copy of a member (57 corresponding lines) crates/webcodex-persistent-shell/src/opening.rs:6 — crates/webcodex-persistent-shell/src/opening.rs:6-71 | crates/webcodex-persistent-shell/src/opening.rs:89-145 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (57 corresponding lines) src/mcp_gateway.rs:531 — src/mcp_gateway.rs:531-587 | src/plugin_gateway.rs:928-985 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (48 corresponding lines) · ×2
  • Edited copy of a member (48 corresponding lines) src/tool_runtime/docx_document.rs:107 — src/tool_runtime/docx_document.rs:107-157 | src/tool_runtime/pdf_document.rs:177-224 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (48 corresponding lines) crates/webcodex-environment/src/storage.rs:471 — crates/webcodex-environment/src/storage.rs:471-518 | src/upgrade_maintenance_store.rs:15-64 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×2
  • Edited copy of a member (39 corresponding lines) crates/webcodex-runner/src/webcodex_runner/exit_diagnostics.rs:372 — crates/webcodex-runner/src/webcodex_runner/exit_diagnostics.rs:372-426 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2108-2146 — 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.
  • Edited copy of a member (39 corresponding lines) crates/webcodex-runner/src/webcodex_runner/config.rs:1733 — crates/webcodex-runner/src/webcodex_runner/config.rs:1733-1773 | crates/webcodex-runner/src/webcodex_runner/config.rs:1828-1866 — 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 (47 corresponding lines) · ×2
  • Edited copy of a member (47 corresponding lines) crates/webcodex-persistent-shell/src/unix.rs:76 — crates/webcodex-persistent-shell/src/unix.rs:76-122 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:227-286 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) src/mcp/discovery.rs:131 — src/mcp/discovery.rs:131-177 | src/mcp/discovery.rs:279-329 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×2
  • Edited copy of a member (45 corresponding lines) src/oauth_http/project_share.rs:220 — src/oauth_http/project_share.rs:220-274 | src/oauth_http/shared_key_bridge.rs:635-679 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (45 corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:267 — crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:267-311 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:317-372 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) crates/webcodex-computer/src/lib.rs:1194 — crates/webcodex-computer/src/lib.rs:1194-1234 | crates/webcodex-computer/src/lib.rs:1248-1289 — 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.
  • Edited copy of a member (41 corresponding lines) crates/webcodex-workflow-session/src/messages.rs:697 — crates/webcodex-workflow-session/src/messages.rs:697-737 | src/tool_runtime/coding_agent.rs:2164-2214 — 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 (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) crates/webcodex-core/src/mcp_gateway.rs:674 — crates/webcodex-core/src/mcp_gateway.rs:674-713 | crates/webcodex-core/src/plugin.rs:1489-1519 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/mcp_tests/cli/collaboration.rs:11 — src/mcp_tests/cli/collaboration.rs:11-41 | src/mcp_tests/cli/peer_clients.rs:37-81 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) src/admin_project_lifecycle.rs:133 — src/admin_project_lifecycle.rs:133-167 | src/admin_project_lifecycle.rs:173-215 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport_tests/initial_project_scan.rs:278 — crates/webcodex-runner/src/webcodex_runner/transport_tests/initial_project_scan.rs:278-312 | crates/webcodex-runner/src/webcodex_runner/transport_tests/initial_project_scan.rs:689-723 — 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 (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) crates/webcodex-cli/src/webcodex_cli/ops.rs:1219 — crates/webcodex-cli/src/webcodex_cli/ops.rs:1219-1241 | crates/webcodex-cli/src/webcodex_cli/ops.rs:1425-1449 — 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) apps/desktop/src-tauri/src/state/workspace_settings.rs:33 — apps/desktop/src-tauri/src/state/workspace_settings.rs:33-55 | apps/desktop/src-tauri/src/state/workspace_settings.rs:60-83 — 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 copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/webcodex-store/src/oauth.rs:1117 — crates/webcodex-store/src/oauth.rs:1117-1137 | crates/webcodex-store/src/oauth.rs:1139-1156 | crates/webcodex-store/src/oauth.rs:1158-1176 — 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.
  • Edited copies of one member (3 members, 18+ corresponding lines) scripts/release_plan.py:77 — scripts/release_plan.py:77-96 | scripts/release_publication.py:567-584 | scripts/release_readiness.py:69-88 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/webcodex-runner-registry/src/job_updates/start.rs:861 — crates/webcodex-runner-registry/src/job_updates/start.rs:861-888 | crates/webcodex-runner-registry/src/validation.rs:594-628 | src/tool_runtime/process.rs:319-342 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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, 24+ corresponding lines) crates/webcodex-store/src/communication.rs:1635 — crates/webcodex-store/src/communication.rs:1635-1658 | crates/webcodex-store/src/communication.rs:1672-1695 | crates/webcodex-store/src/communication.rs:1708-1733 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/webcodex-workflow-session/src/incarnation.rs:13 — crates/webcodex-workflow-session/src/incarnation.rs:13-24 | src/agent_wake.rs:146-157 | src/project_entry_setup.rs:785-795 — 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.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/webcodex-core/src/mcp_gateway.rs:647 — crates/webcodex-core/src/mcp_gateway.rs:647-657 | src/tool_runtime/computer_tools/snapshot_receipts.rs:173-183 | src/tool_runtime/files/artifacts.rs:42-52 — 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 (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) src/mcp/presentation.rs:76 — src/mcp/presentation.rs:76-87 | src/mcp/tools.rs:956-968 | src/mcp/tools.rs:1049-1058 — 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) src/tool_runtime/agent_task.rs:183 — src/tool_runtime/agent_task.rs:183-192 | src/tool_runtime/code_mode.rs:160-172 | src/tool_runtime/session_context.rs:544-553 — 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 · Edited copies of one member (3 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/webcodex-runner/src/webcodex_runner/output.rs:69 — crates/webcodex-runner/src/webcodex_runner/output.rs:69-77 | crates/webcodex-runner/src/webcodex_runner/output.rs:80-88 | crates/webcodex-runner/src/webcodex_runner/projects.rs:56-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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, 9+ corresponding lines) crates/webcodex-runner-registry/src/runners.rs:1528 — crates/webcodex-runner-registry/src/runners.rs:1528-1536 | crates/webcodex-runner-registry/src/runners.rs:1542-1552 | crates/webcodex-runner-registry/src/runners.rs:1619-1627 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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, 19+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 19+ corresponding lines) crates/webcodex-store/src/agent_attention.rs:277 — crates/webcodex-store/src/agent_attention.rs:277-295 | crates/webcodex-store/src/agent_task/invariants.rs:334-353 | crates/webcodex-store/src/communication.rs:2800-2821 | crates/webcodex-store/src/goal.rs:1316-1336 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 19+ corresponding lines) src/mcp_tests/cli/peer_clients.rs:5 — src/mcp_tests/cli/peer_clients.rs:5-28 | src/mcp_tests/file_import.rs:261-279 | src/mcp_tests/fixed_scope.rs:22-40 | src/mcp_tests/http_transport.rs:888-906 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 8+ corresponding lines) src/tool_runtime/startup_brief.rs:519 — src/tool_runtime/startup_brief.rs:519-529 | src/tool_runtime/startup_brief.rs:548-555 | src/tool_runtime/startup_brief.rs:557-567 — 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.
  • Edited copies of one member (3 members, 8+ corresponding lines) src/admin_project_lifecycle.rs:960 — src/admin_project_lifecycle.rs:960-967 | src/tool_request_trace.rs:125-133 | src/tool_runtime/work_result.rs:636-644 — 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 (4 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 7+ corresponding lines) crates/webcodex-lsp/src/fake_server.rs:795 — crates/webcodex-lsp/src/fake_server.rs:795-802 | crates/webcodex-lsp/src/fake_server.rs:882-889 | crates/webcodex-runner/src/webcodex_runner/fake_mcp_gateway.rs:502-508 | crates/webcodex-runner/src/webcodex_runner/fake_plugin.rs:395-401 — 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.
  • Edited copies of one member (4 members, 7+ corresponding lines) src/tool_runtime/process.rs:350 — src/tool_runtime/process.rs:350-356 | src/tool_runtime/project_build.rs:41-48 | src/tool_runtime/script.rs:30-37 | src/tool_runtime/shell.rs:739-746 — 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 · Duplicated block (42 lines × 2) · ×2
  • Duplicated block (42 lines × 2) crates/webcodex-computer/src/platform/macos/accessibility.rs:1004 — crates/webcodex-computer/src/platform/macos/accessibility.rs:1004-1045 | crates/webcodex-computer/src/platform/windows/accessibility.rs:812-853 — `crates/webcodex-computer/src/platform/macos/accessibility.rs` and `crates/webcodex-computer/src/platform/windows/accessibility.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 64 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-computer/src/platform/macos/accessibility.rs:1004` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-computer/src/platform/macos/accessibility.rs:1046` calls `ensure_remaining` and `crates/webcodex-computer/src/platform/windows/accessibility.rs:854` 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 (42 lines × 2) crates/webcodex-store/src/agent_continuation_reference.rs:70 — crates/webcodex-store/src/agent_continuation_reference.rs:70-111 | crates/webcodex-store/src/agent_task_attempt_reference.rs:110-151 — 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 `crates/webcodex-store/src/agent_continuation_reference.rs:70` 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. 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 (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) crates/webcodex-runner-registry/src/requests.rs:754 — crates/webcodex-runner-registry/src/requests.rs:754-787 | crates/webcodex-runner-registry/src/requests.rs:1029-1062 — both copies are in the same file, so extract the 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 (34 lines × 2) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:292 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:292-325 | crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:488-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:658 — crates/webcodex-tool-contracts/src/tool_call/parsing.rs:658-690 | crates/webcodex-tool-contracts/src/tool_call/parsing.rs:819-851 — both copies are in the same file, so extract the 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 (33 lines × 2) src/tool_runtime/coding_agent.rs:806 — src/tool_runtime/coding_agent.rs:806-838 | src/tool_runtime/coding_agent.rs:1049-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `run_id` to `&str` in one and `String` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/tool_runtime/coding_agent.rs:804` calls `unwrap_or`, `min` and `src/tool_runtime/coding_agent.rs:1048` 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 (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) src/runner_tokens_http/routes.rs:196 — src/runner_tokens_http/routes.rs:196-224 | src/users_http/tokens.rs:171-199 — before extracting anything, compare `src/runner_tokens_http/routes.rs` and `src/users_http/tokens.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_tokens_http/routes.rs:196` 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 (29 lines × 2) src/tool_runtime/agent_wait.rs:115 — src/tool_runtime/agent_wait.rs:115-143 | src/tool_runtime/communication.rs:700-728 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×2
  • Duplicated block (28 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:76 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:76-103 | crates/webcodex-cli/src/webcodex_cli/connect/shared_key_oauth.rs:56-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (28 lines × 2) src/agent_wake.rs:620 — src/agent_wake.rs:620-647 | src/agent_wake.rs:972-999 — both copies are in the same file, so extract the 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 `src/agent_wake.rs:620` 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 (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:169 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:169-193 | crates/webcodex-cli/src/webcodex_cli/connect/shared_key_oauth.rs:226-250 — 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 `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:169` 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 (25 lines × 2) crates/webcodex-store/src/goal.rs:354 — crates/webcodex-store/src/goal.rs:354-378 | crates/webcodex-store/src/goal.rs:465-489 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/goal.rs:354` 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.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×2
  • Duplicated block (24–25 lines × 2) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:731 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:731-755 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:757-780 — both copies are in the same file, so extract the 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 `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:731` 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 (24–25 lines × 2) scripts/release_publication.py:697 — scripts/release_publication.py:697-720 | scripts/release_readiness.py:384-408 — 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 `scripts/release_publication.py:697` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) crates/webcodex-store/src/agent_wake.rs:525 — crates/webcodex-store/src/agent_wake.rs:525-542 | crates/webcodex-store/src/agent_wake.rs:757-775 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/agent_wake.rs:757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18–19 lines × 2) crates/webcodex-store/src/agent_wake.rs:816 — crates/webcodex-store/src/agent_wake.rs:816-834 | crates/webcodex-store/src/agent_wake.rs:979-996 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/agent_wake.rs:816` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×2
  • Duplicated block (16–19 lines × 2) src/mcp_gateway.rs:729 — src/mcp_gateway.rs:729-747 | src/plugin_gateway.rs:1320-1335 — before extracting anything, compare `src/mcp_gateway.rs` and `src/plugin_gateway.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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 `src/mcp_gateway.rs:729` 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 (16–19 lines × 2) src/tool_request_trace/store.rs:282 — src/tool_request_trace/store.rs:282-297 | src/tool_request_trace/store.rs:367-385 — both copies are in the same file, so extract the 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 `src/tool_request_trace/store.rs:282` 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, `src/tool_request_trace/store.rs:391` calls `Err` and `src/tool_request_trace/store.rs:302` 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 (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) crates/webcodex-persistent-shell/src/lifecycle.rs:61 — crates/webcodex-persistent-shell/src/lifecycle.rs:61-78 | crates/webcodex-persistent-shell/src/lifecycle.rs:84-101 | crates/webcodex-persistent-shell/src/lifecycle.rs:106-123 — 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 `crates/webcodex-persistent-shell/src/lifecycle.rs:61` 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, `crates/webcodex-persistent-shell/src/lifecycle.rs:60` calls `filter` and `crates/webcodex-persistent-shell/src/lifecycle.rs:105` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 3) crates/webcodex-cli/src/webcodex_cli/ops.rs:244 — crates/webcodex-cli/src/webcodex_cli/ops.rs:244-261 | crates/webcodex-cli/src/webcodex_cli/ops.rs:267-284 | crates/webcodex-cli/src/webcodex_cli/ops.rs:294-311 — 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 `crates/webcodex-cli/src/webcodex_cli/ops.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-cli/src/webcodex_cli/ops.rs:286` calls `smoke_preflight_target_ready`, `find_project`, `Some` and `crates/webcodex-cli/src/webcodex_cli/ops.rs:312` 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 (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) crates/webcodex-store/src/artifact_handoff.rs:758 — crates/webcodex-store/src/artifact_handoff.rs:758-774 | crates/webcodex-store/src/artifact_handoff.rs:814-831 — both copies are in the same file, so extract the 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 (17–18 lines × 2) scripts/agent_loop_benchmark.py:681 — scripts/agent_loop_benchmark.py:681-698 | scripts/agent_loop_benchmark.py:707-723 — both copies are in the same file, so extract the 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 `scripts/agent_loop_benchmark.py:681` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×2
  • Duplicated block (17 lines × 4) crates/webcodex-computer/src/lib.rs:1642 — crates/webcodex-computer/src/lib.rs:1642-1658 | crates/webcodex-computer/src/lib.rs:1680-1696 | crates/webcodex-computer/src/lib.rs:1717-1733 | crates/webcodex-computer/src/lib.rs:1784-1800 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-computer/src/lib.rs:1783` calls `validate_input_text` and `crates/webcodex-computer/src/lib.rs:1641` 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 (17 lines × 4) crates/webcodex-runner/src/main_tests/apply_patch.rs:34 — crates/webcodex-runner/src/main_tests/apply_patch.rs:34-50 | crates/webcodex-runner/src/main_tests/apply_text_edits.rs:42-58 | crates/webcodex-runner/src/main_tests/file_read.rs:26-42 | crates/webcodex-runner/src/webcodex_runner/transport_tests/runtime_shutdown.rs:619-635 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/main_tests/apply_patch.rs:34` 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×2
  • Duplicated block (15–17 lines × 2) src/tool_runtime/coding_agent.rs:572 — src/tool_runtime/coding_agent.rs:572-586 | src/tool_runtime/coding_agent.rs:1285-1301 — both copies are in the same file, so extract the 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 `src/tool_runtime/coding_agent.rs:572` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–17 lines × 2) src/tool_runtime/startup_brief.rs:1159 — src/tool_runtime/startup_brief.rs:1159-1175 | src/tool_runtime/startup_brief.rs:1259-1273 — both copies are in the same file, so extract the 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 `src/tool_runtime/startup_brief.rs:1159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) crates/webcodex-runner-registry/src/requests.rs:943 — crates/webcodex-runner-registry/src/requests.rs:943-956 | crates/webcodex-runner-registry/src/requests.rs:1085-1098 | crates/webcodex-runner-registry/src/requests.rs:1157-1170 — 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 `crates/webcodex-runner-registry/src/requests.rs:943` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) crates/webcodex-store/src/agent_wake.rs:526 — crates/webcodex-store/src/agent_wake.rs:526-539 | crates/webcodex-store/src/agent_wake.rs:759-772 | crates/webcodex-store/src/agent_wake.rs:936-949 — 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 `crates/webcodex-store/src/agent_wake.rs:526` 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 (12–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) apps/desktop/src-tauri/src/state/persistence.rs:176 — apps/desktop/src-tauri/src/state/persistence.rs:176-188 | crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:543-554 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2155-2166 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (12–13 lines × 3) crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:73 — crates/webcodex-cli/src/webcodex_cli/connect/disconnect.rs:73-84 | crates/webcodex-cli/src/webcodex_cli/connect/mod.rs:78-89 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:523-535 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/connect/mod.rs` and `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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 (9–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) crates/webcodex-environment/src/cloudflare_tunnel.rs:253 — crates/webcodex-environment/src/cloudflare_tunnel.rs:253-263 | crates/webcodex-environment/src/cloudflare_tunnel.rs:295-303 — both copies are in the same file, so extract the 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 `crates/webcodex-environment/src/cloudflare_tunnel.rs:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9–11 lines × 2) src/tool_request_trace/payload.rs:32 — src/tool_request_trace/payload.rs:32-40 | src/tool_request_trace/reader.rs:12-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/tool_request_trace/payload.rs:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 5) · ×2
  • Duplicated block (10 lines × 5) crates/webcodex-admin/src/commands.rs:844 — crates/webcodex-admin/src/commands.rs:844-853 | crates/webcodex-cli/src/webcodex_cli/http.rs:26-35 | crates/webcodex-cli/src/webcodex_cli/http.rs:63-72 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:78-87 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:137-146 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (10 lines × 5) crates/webcodex-runner-registry/src/requests.rs:744 — crates/webcodex-runner-registry/src/requests.rs:744-753 | crates/webcodex-runner-registry/src/requests.rs:838-847 | crates/webcodex-runner-registry/src/requests.rs:1185-1194 | crates/webcodex-runner-registry/src/requests.rs:1246-1255 | crates/webcodex-runner-registry/src/requests.rs:1298-1307 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner-registry/src/requests.rs:744` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-runner-registry/src/requests.rs:1195` calls `assert_runner_access` and `crates/webcodex-runner-registry/src/requests.rs:848` 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 (8–10 lines × 3) · ×2
  • Duplicated block (8–10 lines × 3) crates/webcodex-browser/src/supervisor.rs:742 — crates/webcodex-browser/src/supervisor.rs:742-751 | crates/webcodex-browser/src/supervisor.rs:758-765 | crates/webcodex-browser/src/supervisor.rs:929-938 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8–10 lines × 3) crates/webcodex-computer/src/platform/windows/accessibility.rs:885 — crates/webcodex-computer/src/platform/windows/accessibility.rs:885-892 | crates/webcodex-computer/src/platform/windows/accessibility.rs:1200-1209 | crates/webcodex-computer/src/platform/windows/input.rs:593-602 — 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 `crates/webcodex-computer/src/platform/windows/accessibility.rs:885` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) crates/webcodex-store/src/window_collaboration.rs:367 — crates/webcodex-store/src/window_collaboration.rs:367-376 | crates/webcodex-store/src/window_collaboration.rs:390-398 | crates/webcodex-store/src/window_collaboration.rs:417-425 — 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 `crates/webcodex-store/src/window_collaboration.rs:367` 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–10 lines × 3) src/mcp_tests/file_import.rs:836 — src/mcp_tests/file_import.rs:836-845 | src/mcp_tests/file_import.rs:1135-1143 | src/mcp_tests/file_import.rs:1227-1236 — 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 `src/mcp_tests/file_import.rs:836` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) crates/webcodex-environment/src/migration.rs:519 — crates/webcodex-environment/src/migration.rs:519-526 | crates/webcodex-environment/src/native.rs:1502-1511 — 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 `crates/webcodex-environment/src/migration.rs:519` 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–10 lines × 2) src/runner_http/handlers.rs:32 — src/runner_http/handlers.rs:32-41 | src/runner_http/handlers.rs:97-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_http/handlers.rs:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:316 — crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:316-323 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:541-548 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:743-750 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1012-1019 | crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:1118-1125 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-tool-runtime-contracts/src/tool_audit/request.rs:316` 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 × 5) src/mcp_tests/file_import.rs:834 — src/mcp_tests/file_import.rs:834-841 | src/mcp_tests/file_import.rs:963-970 | src/mcp_tests/file_import.rs:1051-1058 | src/mcp_tests/file_import.rs:1133-1140 | src/mcp_tests/file_import.rs:1225-1232 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/mcp_tests/file_import.rs:971` calls `set_import_test_resolved_ips`, `Some`, `parse` and `src/mcp_tests/file_import.rs:843` 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 (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) crates/webcodex-browser/src/supervisor.rs:742 — crates/webcodex-browser/src/supervisor.rs:742-748 | crates/webcodex-browser/src/supervisor.rs:758-764 | crates/webcodex-browser/src/supervisor.rs:915-921 | crates/webcodex-browser/src/supervisor.rs:929-937 | crates/webcodex-browser/src/supervisor.rs:1036-1042 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-browser/src/supervisor.rs:741` calls `validate_navigation_url` and `crates/webcodex-browser/src/supervisor.rs:914` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 5) src/tool_runtime/job_terminal_wait.rs:249 — src/tool_runtime/job_terminal_wait.rs:249-255 | src/tool_runtime/job_terminal_wait.rs:286-292 | src/tool_runtime/job_terminal_wait.rs:325-331 | src/tool_runtime/job_terminal_wait.rs:374-380 | src/tool_runtime/job_terminal_wait.rs:409-415 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) apps/desktop/src-tauri/src/state/path_inventory.rs:48 — apps/desktop/src-tauri/src/state/path_inventory.rs:48-54 | apps/desktop/src-tauri/src/state/path_inventory.rs:65-71 | apps/desktop/src-tauri/src/state/path_inventory.rs:80-86 | apps/desktop/src-tauri/src/state/path_inventory.rs:101-107 — 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.
  • Duplicated block (7 lines × 4) crates/webcodex-browser/src/supervisor.rs:527 — crates/webcodex-browser/src/supervisor.rs:527-533 | crates/webcodex-browser/src/supervisor.rs:539-545 | crates/webcodex-browser/src/supervisor.rs:567-573 | crates/webcodex-browser/src/supervisor.rs:603-609 — 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×2
  • Duplicated block (6–7 lines × 3) crates/webcodex-cli/src/webcodex_cli/system.rs:414 — crates/webcodex-cli/src/webcodex_cli/system.rs:414-419 | crates/webcodex-cli/src/webcodex_cli/system.rs:455-461 | crates/webcodex-cli/src/webcodex_cli/system.rs:482-488 — 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 `crates/webcodex-cli/src/webcodex_cli/system.rs:414` 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–7 lines × 3) integrations/codex/external_observation_hook.py:106 — integrations/codex/external_observation_hook.py:106-111 | integrations/codex/read_handoff.py:182-188 | integrations/codex/session_recovery.py:124-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `integrations/codex/read_handoff.py:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) src/tool_runtime/process.rs:585 — src/tool_runtime/process.rs:585-597 | src/tool_runtime/process.rs:914-926 | src/tool_runtime/script.rs:115-127 — before extracting anything, compare `src/tool_runtime/process.rs` and `src/tool_runtime/script.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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 (13 lines × 3) src/mcp.rs:1227 — src/mcp.rs:1227-1239 | src/mcp.rs:1255-1267 | src/mcp.rs:1297-1309 — 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 `src/mcp.rs:1227` 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) src/mcp_tests/file_import.rs:1022 — src/mcp_tests/file_import.rs:1022-1026 | src/mcp_tests/file_import.rs:1104-1108 | src/mcp_tests/file_import.rs:1197-1201 | src/mcp_tests/file_import.rs:1272-1276 — 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 `src/mcp_tests/file_import.rs:1022` 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 × 4) src/mcp_tests/file_import.rs:939 — src/mcp_tests/file_import.rs:939-944 | src/mcp_tests/file_import.rs:1027-1032 | src/mcp_tests/file_import.rs:1109-1114 | src/mcp_tests/file_import.rs:1202-1206 — 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 `src/mcp_tests/file_import.rs:939` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: NativeEnvironment (LCOM4 10) crates/webcodex-environment/src/native.rs:22 — NativeEnvironment'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: ToolDefinition (LCOM4 5) crates/webcodex-tool-contracts/src/tool_definition.rs:1018 — ToolDefinition'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.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×2
  • Duplicated block (9 lines × 2 locations) scripts/ui-smoke/desktop-page-fixtures.mjs:15 — scripts/ui-smoke/desktop-page-fixtures.mjs:15 · scripts/ui-smoke/desktop-soft-surfaces.mjs:171 — 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 (9 lines × 2 locations) scripts/ui-smoke/runtime-overview.mjs:7 — scripts/ui-smoke/runtime-overview.mjs:7 · scripts/ui-smoke/work-header.mjs:7 — 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 with local edits (8 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (8 matched lines × 2 locations) apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:22 — apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:22 · apps/desktop/src/features/extensions/useExtensionsState.ts:41 — the two spans are one implementation copied and then locally edited — 91 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.
  • Duplicated block with local edits (8 matched lines × 2 locations) scripts/ui-smoke/desktop-long-activity.mjs:9 — scripts/ui-smoke/desktop-long-activity.mjs:9 · scripts/ui-smoke/localized-layout.mjs:4 — the two spans are one implementation copied and then locally edited — 92 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.
AC4 · Keyboard semantics · Anchor without href · ×1
  • Anchor without href download/index.html:29 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
D1 · Cyclomatic Complexity · FirstRun.FirstRun (cyclomatic 165) · ×1
  • FirstRun.FirstRun (cyclomatic 165) apps/desktop/src/features/onboarding/FirstRun.tsx:47 — FirstRun.FirstRun has cyclomatic complexity 165 (threshold 15). Of this number, 119 points are the body's own statements and 46 belong to 6 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 · UpdateWorkflow.UpdateWorkflow (cyclomatic 124) · ×1
  • UpdateWorkflow.UpdateWorkflow (cyclomatic 124) apps/desktop/src/features/settings/UpdateWorkflow.tsx:34 — UpdateWorkflow.UpdateWorkflow has cyclomatic complexity 124 (threshold 15). Of this number, 115 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiagnosticsPanel.DiagnosticsContents (cyclomatic 107) · ×1
  • DiagnosticsPanel.DiagnosticsContents (cyclomatic 107) apps/desktop/src/features/settings/DiagnosticsPanel.tsx:23 — DiagnosticsPanel.DiagnosticsContents has cyclomatic complexity 107 (threshold 15). Of this number, 57 points are the body's own statements and 50 belong to 15 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 · SettingsPanel.SettingsView (cyclomatic 93) · ×1
  • SettingsPanel.SettingsView (cyclomatic 93) apps/desktop/src/features/settings/SettingsPanel.tsx:57 — SettingsPanel.SettingsView has cyclomatic complexity 93 (threshold 15). Of this number, 43 points are the body's own statements and 50 belong to 15 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 · RunnerCapacityPanel.RunnerCapacitySettings (cyclomatic 86) · ×1
  • RunnerCapacityPanel.RunnerCapacitySettings (cyclomatic 86) apps/desktop/src/features/settings/RunnerCapacityPanel.tsx:21 — RunnerCapacityPanel.RunnerCapacitySettings has cyclomatic complexity 86 (threshold 15). Of this number, 42 points are the body's own statements and 44 belong to 10 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 · ActivityPanel.ActivityPanel (cyclomatic 79) · ×1
  • ActivityPanel.ActivityPanel (cyclomatic 79) apps/desktop/src/features/activity/ActivityPanel.tsx:56 — ActivityPanel.ActivityPanel has cyclomatic complexity 79 (threshold 15). Of this number, 45 points are the body's own statements and 34 belong to 12 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 · RuntimePanel.RuntimePanelContent (cyclomatic 76) · ×1
  • RuntimePanel.RuntimePanelContent (cyclomatic 76) apps/desktop/src/features/settings/RuntimePanel.tsx:18 — RuntimePanel.RuntimePanelContent has cyclomatic complexity 76 (threshold 15). Of this number, 39 points are the body's own statements and 37 belong to 10 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 · WorkspaceContext.WorkspaceProvider (cyclomatic 72) · ×1
  • WorkspaceContext.WorkspaceProvider (cyclomatic 72) apps/desktop/src/features/workspace/WorkspaceContext.tsx:70 — WorkspaceContext.WorkspaceProvider has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 13 of the 72 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 136, 182, 117, …). 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 · Dr.parseDefaultProperties (cyclomatic 71) · ×1
  • Dr.parseDefaultProperties (cyclomatic 71) REDACTED:1463 — Dr.parseDefaultProperties has cyclomatic complexity 71 (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 · vi.render (cyclomatic 71) · ×1
  • vi.render (cyclomatic 71) src/mcp_pdf_app.html:690 — vi.render has cyclomatic complexity 71 (threshold 15). Of this number, 49 points are the body's own statements and 22 belong to 8 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 · REDACTED.validContinuity (cyclomatic 70) · ×1
  • REDACTED.validContinuity (cyclomatic 70) REDACTED:159 — REDACTED.validContinuity has cyclomatic complexity 70 (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 · useDesktopWorkspace.useDesktopWorkspace (cyclomatic 65) · ×1
  • useDesktopWorkspace.useDesktopWorkspace (cyclomatic 65) apps/desktop/src/hooks/useDesktopWorkspace.ts:12 — useDesktopWorkspace.useDesktopWorkspace has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 7 of the 65 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 109, 59, 209, …). 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 · fill-batch.reconcileFill (cyclomatic 65) · ×1
  • fill-batch.reconcileFill (cyclomatic 65) plugins/campus-application/src/fill-batch.ts:157 — fill-batch.reconcileFill has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · REDACTED.validPlan (cyclomatic 65) · ×1
  • REDACTED.validPlan (cyclomatic 65) REDACTED:236 — REDACTED.validPlan has cyclomatic complexity 65 (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 · ConnectionPanel.ConnectionPanel (cyclomatic 61) · ×1
  • ConnectionPanel.ConnectionPanel (cyclomatic 61) apps/desktop/src/features/connection/ConnectionPanel.tsx:18 — ConnectionPanel.ConnectionPanel has cyclomatic complexity 61 (threshold 15). Of this number, 41 points are the body's own statements and 20 belong to 7 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 · REDACTED.renderGitReview (cyclomatic 61) · ×1
  • REDACTED.renderGitReview (cyclomatic 61) REDACTED:559 — REDACTED.renderGitReview has cyclomatic complexity 61 (threshold 15). Of this number, 19 points are the body's own statements and 42 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 · CloudflareConnectionCard.CloudflareConnectionCard (cyclomatic 60) · ×1
  • CloudflareConnectionCard.CloudflareConnectionCard (cyclomatic 60) apps/desktop/src/features/connection/CloudflareConnectionCard.tsx:61 — CloudflareConnectionCard.CloudflareConnectionCard has cyclomatic complexity 60 (threshold 15). Of this number, 42 points are the body's own statements and 18 belong to 3 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 · AboutPanel.AboutPanelContent (cyclomatic 59) · ×1
  • AboutPanel.AboutPanelContent (cyclomatic 59) apps/desktop/src/features/settings/AboutPanel.tsx:18 — AboutPanel.AboutPanelContent has cyclomatic complexity 59 (threshold 15). Of this number, 38 points are the body's own statements and 21 belong to 9 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 · ConnectionEditor.ConnectionEditor (cyclomatic 59) · ×1
  • ConnectionEditor.ConnectionEditor (cyclomatic 59) apps/desktop/src/features/connection/ConnectionEditor.tsx:10 — ConnectionEditor.ConnectionEditor has cyclomatic complexity 59 (threshold 15). Of this number, 44 points are the body's own statements and 15 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 · RunnerFileAccess.RunnerFileAccess (cyclomatic 57) · ×1
  • RunnerFileAccess.RunnerFileAccess (cyclomatic 57) apps/desktop/src/features/settings/RunnerFileAccess.tsx:35 — RunnerFileAccess.RunnerFileAccess has cyclomatic complexity 57 (threshold 15). Of this number, 25 points are the body's own statements and 32 belong to 6 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 · ReadinessBanner.ReadinessBanner (cyclomatic 56) · ×1
  • ReadinessBanner.ReadinessBanner (cyclomatic 56) apps/desktop/src/features/dashboard/ReadinessBanner.tsx:8 — ReadinessBanner.ReadinessBanner has cyclomatic complexity 56 (threshold 15). Of this number, 49 points are the body's own statements and 7 belong to 3 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 · ConnectionCard.ConnectionCard (cyclomatic 56) · ×1
  • ConnectionCard.ConnectionCard (cyclomatic 56) apps/desktop/src/features/connection/ConnectionCard.tsx:34 — ConnectionCard.ConnectionCard has cyclomatic complexity 56 (threshold 15). Of this number, 48 points are the body's own statements and 8 belong to 3 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 · native-config.inspectNativeConfig (cyclomatic 56) · ×1
  • native-config.inspectNativeConfig (cyclomatic 56) plugins/agent-browser/src/native-config.ts:41 — native-config.inspectNativeConfig has cyclomatic complexity 56 (threshold 15). Of this number, 52 points are the body's own statements and 4 belong to 4 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 · REDACTED.loadWorkbench (cyclomatic 56) · ×1
  • REDACTED.loadWorkbench (cyclomatic 56) REDACTED:520 — REDACTED.loadWorkbench has cyclomatic complexity 56 (threshold 15). Of this number, 54 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 · RuntimeSurface · ×1
  • RuntimeSurface::admit (cyclomatic 55) src/mcp/tools/call/surface.rs:14 — RuntimeSurface::admit has cyclomatic complexity 55 (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 · ParsedCall · ×1
  • ParsedCall::prepare (cyclomatic 53) src/mcp/tools/call.rs:204 — ParsedCall::prepare 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 · ShellJobValidationMetadata · ×1
  • ShellJobValidationMetadata::is_valid (cyclomatic 49) crates/webcodex-core/src/runner_protocol/job.rs:941 — ShellJobValidationMetadata::is_valid has cyclomatic complexity 49 (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 · l.beginGroup (cyclomatic 49) · ×1
  • l.beginGroup (cyclomatic 49) src/mcp_pdf_app.html:690 — l.beginGroup has cyclomatic complexity 49 (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 · REDACTED.projectionSemanticFailure (cyclomatic 48) · ×1
  • REDACTED.projectionSemanticFailure (cyclomatic 48) REDACTED:494 — REDACTED.projectionSemanticFailure 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 · REDACTED.renderValidationSummary (cyclomatic 47) · ×1
  • REDACTED.renderValidationSummary (cyclomatic 47) REDACTED:221 — REDACTED.renderValidationSummary has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 15 of the 47 points are its own statements and the rest belongs to one function literal inside it that branches (line 235). 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 · REDACTED.workCard (cyclomatic 47) · ×1
  • REDACTED.workCard (cyclomatic 47) REDACTED:616 — REDACTED.workCard has cyclomatic complexity 47 (threshold 15). Of this number, 37 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedInstructionsPanel.ManagedInstructionsPanel (cyclomatic 46) · ×1
  • ManagedInstructionsPanel.ManagedInstructionsPanel (cyclomatic 46) apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:11 — ManagedInstructionsPanel.ManagedInstructionsPanel has cyclomatic complexity 46 (threshold 15). Of this number, 21 points are the body's own statements and 25 belong to 5 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 · REDACTED.updateControls (cyclomatic 46) · ×1
  • REDACTED.updateControls (cyclomatic 46) REDACTED:364 — REDACTED.updateControls has cyclomatic complexity 46 (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 · plugin.analyzeNodes (cyclomatic 44) · ×1
  • plugin.analyzeNodes (cyclomatic 44) plugins/campus-application/src/plugin.ts:221 — plugin.analyzeNodes has cyclomatic complexity 44 (threshold 15). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComputerPermissions.ComputerPermissions (cyclomatic 43) · ×1
  • ComputerPermissions.ComputerPermissions (cyclomatic 43) apps/desktop/src/features/settings/ComputerPermissions.tsx:14 — ComputerPermissions.ComputerPermissions has cyclomatic complexity 43 (threshold 15). Of this number, 22 points are the body's own statements and 21 belong to 8 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 · Knowledge.refresh (cyclomatic 42) · ×1
  • Knowledge.refresh (cyclomatic 42) plugins/project-knowledge/knowledge.py:505 — Knowledge.refresh 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 · l.showText (cyclomatic 42) · ×1
  • l.showText (cyclomatic 42) src/mcp_pdf_app.html:690 — l.showText 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 · REDACTED.renderPresentation (cyclomatic 42) · ×1
  • REDACTED.renderPresentation (cyclomatic 42) REDACTED:775 — REDACTED.renderPresentation has cyclomatic complexity 42 (threshold 15). Of this number, 40 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 · RuntimeResponse · ×1
  • RuntimeResponse::finish (cyclomatic 41) src/mcp/tools/call/response.rs:17 — RuntimeResponse::finish 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 · ProjectsPanel.ProjectsPanel (cyclomatic 41) · ×1
  • ProjectsPanel.ProjectsPanel (cyclomatic 41) apps/desktop/src/features/projects/ProjectsPanel.tsx:16 — ProjectsPanel.ProjectsPanel 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. This shape REPEATS in the file: one other method here (ProjectsPanel.ProjectsPanel::unregisterSelected) 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 · control (cyclomatic 40) · ×1
  • control (cyclomatic 40) extensions/browser-bridge/worker.js:153 — control 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 · ConnectionRuntimes · ×1
  • ConnectionRuntimes::monitor (cyclomatic 39) apps/desktop/src-tauri/src/connections.rs:320 — ConnectionRuntimes::monitor has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminProjectLifecycleService · ×1
  • AdminProjectLifecycleService::mutate_authorized_core (cyclomatic 39) src/admin_project_lifecycle.rs:286 — AdminProjectLifecycleService::mutate_authorized_core has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · REDACTED.renderWorkbench (cyclomatic 39) · ×1
  • REDACTED.renderWorkbench (cyclomatic 39) REDACTED:563 — REDACTED.renderWorkbench has cyclomatic complexity 39 (threshold 15). Of this number, 38 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 · PendingDispatchFence · ×1
  • PendingDispatchFence::synchronous_rejection (cyclomatic 38) crates/webcodex-runner-registry/src/dispatch_fence.rs:111 — PendingDispatchFence::synchronous_rejection has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · REDACTED.renderToolResult (cyclomatic 38) · ×1
  • REDACTED.renderToolResult (cyclomatic 38) REDACTED:68 — REDACTED.renderToolResult 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, 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 · mcp_spreadsheet_app.html.load (cyclomatic 38) · ×1
  • mcp_spreadsheet_app.html.load (cyclomatic 38) src/mcp_spreadsheet_app.html:753 — mcp_spreadsheet_app.html.load has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · REDACTED.renderExecutors (cyclomatic 38) · ×1
  • REDACTED.renderExecutors (cyclomatic 38) REDACTED:699 — REDACTED.renderExecutors has cyclomatic complexity 38 (threshold 15). Of this number, 28 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AuthMiddleware · ×1
  • AuthMiddleware::handle (cyclomatic 37) src/auth/middleware.rs:284 — AuthMiddleware::handle 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 · CodingAgentsPanel.CodingAgentsPanel (cyclomatic 37) · ×1
  • CodingAgentsPanel.CodingAgentsPanel (cyclomatic 37) apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:13 — CodingAgentsPanel.CodingAgentsPanel has cyclomatic complexity 37 (threshold 15). Of this number, 16 points are the body's own statements and 21 belong to 9 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 · App.DesktopApp (cyclomatic 37) · ×1
  • App.DesktopApp (cyclomatic 37) apps/desktop/src/App.tsx:34 — App.DesktopApp 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, 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 · REDACTED.renderGitChanges (cyclomatic 36) · ×1
  • REDACTED.renderGitChanges (cyclomatic 36) REDACTED:466 — REDACTED.renderGitChanges has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 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 · ProjectRows.ProjectRow (cyclomatic 34) · ×1
  • ProjectRows.ProjectRow (cyclomatic 34) apps/desktop/src/features/projects/ProjectRows.tsx:24 — ProjectRows.ProjectRow has cyclomatic complexity 34 (threshold 15). Of this number, 24 points are the body's own statements and 10 belong to 5 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 · RuntimeConsolePanel.RuntimeConsolePanel (cyclomatic 34) · ×1
  • RuntimeConsolePanel.RuntimeConsolePanel (cyclomatic 34) apps/desktop/src/features/console/RuntimeConsolePanel.tsx:13 — RuntimeConsolePanel.RuntimeConsolePanel has cyclomatic complexity 34 (threshold 15). Of this number, 24 points are the body's own statements and 10 belong to 4 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 · execute (cyclomatic 34) · ×1
  • execute (cyclomatic 34) plugins/agent-environment/src/bridge.mjs:39 — execute has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to 13 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 · install.fetchToFile (cyclomatic 33) · ×1
  • install.fetchToFile (cyclomatic 33) REDACTED:463 — install.fetchToFile has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 551, 506, 486, …). 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 · fill-batch.operation (cyclomatic 33) · ×1
  • fill-batch.operation (cyclomatic 33) plugins/campus-application/src/fill-batch.ts:76 — fill-batch.operation has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PersistedSessionRecord · ×1
  • PersistedSessionRecord::into_record (cyclomatic 32) crates/webcodex-workflow-session/src/persistence.rs:222 — PersistedSessionRecord::into_record 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 · Adapter.handle (cyclomatic 32) · ×1
  • Adapter.handle (cyclomatic 32) integrations/model_gateway/adapter.py:62 — Adapter.handle 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 · NativeBackend.run (cyclomatic 32) · ×1
  • NativeBackend.run (cyclomatic 32) plugins/agent-browser/src/backend.ts:132 — NativeBackend.run 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 · form-cache.deriveMappings (cyclomatic 32) · ×1
  • form-cache.deriveMappings (cyclomatic 32) plugins/campus-application/src/form-cache.ts:414 — form-cache.deriveMappings has cyclomatic complexity 32 (threshold 15). Of this number, 29 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 · REDACTED.loadDirectory (cyclomatic 32) · ×1
  • REDACTED.loadDirectory (cyclomatic 32) REDACTED:834 — REDACTED.loadDirectory 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 · PluginToolCall · ×1
  • PluginToolCall::validate (cyclomatic 31) crates/webcodex-tool-contracts/src/tool_call/input_types.rs:74 — PluginToolCall::validate 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 · plugin.handle_frame (cyclomatic 31) · ×1
  • plugin.handle_frame (cyclomatic 31) plugins/project-knowledge/plugin.py:88 — plugin.handle_frame 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 · RunnerDevices.RunnerDevices (cyclomatic 31) · ×1
  • RunnerDevices.RunnerDevices (cyclomatic 31) apps/desktop/src/features/projects/RunnerDevices.tsx:8 — RunnerDevices.RunnerDevices has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 23, 12, 17). 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 · AddDevice.DeviceInvitationDialog (cyclomatic 31) · ×1
  • AddDevice.DeviceInvitationDialog (cyclomatic 31) apps/desktop/src/features/projects/AddDevice.tsx:33 — AddDevice.DeviceInvitationDialog has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (create, copy, validCode, …). 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 · Rt.#a (cyclomatic 31) · ×1
  • Rt.#a (cyclomatic 31) src/mcp_pdf_app.html:700 — Rt.#a 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.renderGoalPreview (cyclomatic 31) · ×1
  • REDACTED.renderGoalPreview (cyclomatic 31) REDACTED:928 — REDACTED.renderGoalPreview has cyclomatic complexity 31 (threshold 15). Of this number, 27 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · WindowActivityDetail.WindowActivityDetail (cyclomatic 30) · ×1
  • WindowActivityDetail.WindowActivityDetail (cyclomatic 30) apps/desktop/src/features/activity/WindowActivityDetail.tsx:12 — WindowActivityDetail.WindowActivityDetail has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 5 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 · WorkflowSessionDetail.WorkflowSessionDetail (cyclomatic 30) · ×1
  • WorkflowSessionDetail.WorkflowSessionDetail (cyclomatic 30) apps/desktop/src/features/activity/WorkflowSessionDetail.tsx:33 — WorkflowSessionDetail.WorkflowSessionDetail has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 belong to 5 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 · Ve._bindResetFormAction (cyclomatic 30) · ×1
  • Ve._bindResetFormAction (cyclomatic 30) src/mcp_pdf_app.html:690 — Ve._bindResetFormAction has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 690). 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.saveGoal (cyclomatic 30) · ×1
  • REDACTED.saveGoal (cyclomatic 30) REDACTED:798 — REDACTED.saveGoal 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 · State · ×1
  • State::receive (cyclomatic 29) crates/webcodex-browser/src/bridge.rs:191 — State::receive 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 · Config · ×1
  • Config::parse (cyclomatic 29) crates/webcodex-openai-tunnel/src/bin/webcodex-tunnel/config.rs:70 — Config::parse has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SkillStore · ×1
  • SkillStore::install (cyclomatic 29) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:801 — SkillStore::install 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 · OAuth2Verifier · ×1
  • OAuth2Verifier::verify_for_ingress_sync (cyclomatic 29) src/auth/tokens.rs:223 — OAuth2Verifier::verify_for_ingress_sync 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 · CodingAgentEditor.CodingAgentEditor (cyclomatic 29) · ×1
  • CodingAgentEditor.CodingAgentEditor (cyclomatic 29) apps/desktop/src/features/extensions/CodingAgentEditor.tsx:17 — CodingAgentEditor.CodingAgentEditor has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (submit, a function literal at line 52, chooseExecutable, …). 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 · REDACTED.renderValidationRun (cyclomatic 29) · ×1
  • REDACTED.renderValidationRun (cyclomatic 29) REDACTED:162 — REDACTED.renderValidationRun has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 179). 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 · REDACTED.loadList (cyclomatic 29) · ×1
  • REDACTED.loadList (cyclomatic 29) REDACTED:868 — REDACTED.loadList has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ToolCall · ×1
  • ToolCall::from_tool_name_with_normalization (cyclomatic 28) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:256 — ToolCall::from_tool_name_with_normalization 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. This is NOT this file's highest cyclomatic complexity: ToolCall::tool_name (cyclomatic 194) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · REDACTED.recoverExpiredEndpoint (cyclomatic 28) · ×1
  • REDACTED.recoverExpiredEndpoint (cyclomatic 28) REDACTED:787 — REDACTED.recoverExpiredEndpoint 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 · REDACTED.reconcile (cyclomatic 28) · ×1
  • REDACTED.reconcile (cyclomatic 28) REDACTED:390 — REDACTED.reconcile 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 · Be.create (cyclomatic 28) · ×1
  • Be.create (cyclomatic 28) src/mcp_pdf_app.html:690 — Be.create has cyclomatic complexity 28 (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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · RetainedJobReceipt · ×1
  • RetainedJobReceipt::validate (cyclomatic 27) crates/webcodex-core/src/runner_job_receipt.rs:36 — RetainedJobReceipt::validate has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ExtensionPathsEditor.ExtensionPathsEditor (cyclomatic 27) · ×1
  • ExtensionPathsEditor.ExtensionPathsEditor (cyclomatic 27) apps/desktop/src/features/extensions/ExtensionPathsEditor.tsx:14 — ExtensionPathsEditor.ExtensionPathsEditor has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (browse, a function literal at line 54, a function literal at line 48, …). 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 · McpProvidersPanel.McpProvidersPanel (cyclomatic 27) · ×1
  • McpProvidersPanel.McpProvidersPanel (cyclomatic 27) apps/desktop/src/features/extensions/McpProvidersPanel.tsx:10 — McpProvidersPanel.McpProvidersPanel has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 3 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 · RuntimePanel.BinaryFacts (cyclomatic 27) · ×1
  • RuntimePanel.BinaryFacts (cyclomatic 27) apps/desktop/src/features/settings/RuntimePanel.tsx:144 — RuntimePanel.BinaryFacts has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 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 · location-values.resolveChoicePath (cyclomatic 27) · ×1
  • location-values.resolveChoicePath (cyclomatic 27) plugins/campus-application/src/location-values.ts:9 — location-values.resolveChoicePath has cyclomatic complexity 27 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · REDACTED.reconcile (cyclomatic 27) · ×1
  • REDACTED.reconcile (cyclomatic 27) REDACTED:837 — REDACTED.reconcile 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 · REDACTED.prepareAndDispatch (cyclomatic 27) · ×1
  • REDACTED.prepareAndDispatch (cyclomatic 27) REDACTED:326 — REDACTED.prepareAndDispatch has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · l.updateMode (cyclomatic 27) · ×1
  • l.updateMode (cyclomatic 27) src/mcp_pdf_app.html:647 — l.updateMode has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.loadProjects (cyclomatic 27) · ×1
  • REDACTED.loadProjects (cyclomatic 27) REDACTED:424 — REDACTED.loadProjects has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · REDACTED.loadOverview (cyclomatic 27) · ×1
  • REDACTED.loadOverview (cyclomatic 27) REDACTED:462 — REDACTED.loadOverview 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 · (anonymous) (cyclomatic 27) · ×1
  • (anonymous) (cyclomatic 27) extensions/browser-bridge/worker.js:79 — (anonymous) has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 83, 93, 94, …). 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 · PreparedRuntimeCall · ×1
  • PreparedRuntimeCall::prepare (cyclomatic 26) src/mcp/tools/call.rs:489 — PreparedRuntimeCall::prepare 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 · ExtensionsPanel.ExtensionsPanel (cyclomatic 26) · ×1
  • ExtensionsPanel.ExtensionsPanel (cyclomatic 26) apps/desktop/src/features/extensions/ExtensionsPanel.tsx:20 — ExtensionsPanel.ExtensionsPanel has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 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 · useRuntimeUpdates.useRuntimeUpdates.refreshLocal (cyclomatic 26) · ×1
  • useRuntimeUpdates.useRuntimeUpdates.refreshLocal (cyclomatic 26) apps/desktop/src/hooks/useRuntimeUpdates.ts:35 — useRuntimeUpdates.useRuntimeUpdates.refreshLocal has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body's own statements and 12 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 · l.setGState (cyclomatic 26) · ×1
  • l.setGState (cyclomatic 26) src/mcp_pdf_app.html:690 — l.setGState has cyclomatic complexity 26 (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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · Mi.render (cyclomatic 26) · ×1
  • Mi.render (cyclomatic 26) src/mcp_pdf_app.html:691 — Mi.render has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 691, o, a function literal at line 691, …). 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.preview (cyclomatic 26) · ×1
  • REDACTED.preview (cyclomatic 26) REDACTED:908 — REDACTED.preview has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PreparedInvocation · ×1
  • PreparedInvocation::prepare (cyclomatic 25) src/tool_runtime/kernel/recording.rs:34 — PreparedInvocation::prepare 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 · BrowserRuntimeStatus.BrowserRuntimeStatus (cyclomatic 25) · ×1
  • BrowserRuntimeStatus.BrowserRuntimeStatus (cyclomatic 25) apps/desktop/src/features/dashboard/BrowserRuntimeStatus.tsx:21 — BrowserRuntimeStatus.BrowserRuntimeStatus has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 35, 29, 43, …). 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 · AddLocalProject.AddLocalProject (cyclomatic 25) · ×1
  • AddLocalProject.AddLocalProject (cyclomatic 25) apps/desktop/src/features/projects/AddLocalProject.tsx:9 — AddLocalProject.AddLocalProject has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 belong to 4 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 · LocalServicesPanel.LocalServiceControls (cyclomatic 25) · ×1
  • LocalServicesPanel.LocalServiceControls (cyclomatic 25) apps/desktop/src/features/settings/LocalServicesPanel.tsx:17 — LocalServicesPanel.LocalServiceControls has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 36, act, a function literal at line 36). 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 · worker.chrome.runtime.onMessage.addListener() (cyclomatic 25) · ×1
  • worker.chrome.runtime.onMessage.addListener() (cyclomatic 25) extensions/browser-bridge/worker.js:79 — worker.chrome.runtime.onMessage.addListener() has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 83, 93). 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 · install.noProxyMatches (cyclomatic 25) · ×1
  • install.noProxyMatches (cyclomatic 25) REDACTED:178 — install.noProxyMatches 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 · ShellJobValidationStep · ×1
  • ShellJobValidationStep::is_canonical_with_project_workspace (cyclomatic 24) crates/webcodex-core/src/runner_protocol/job.rs:218 — ShellJobValidationStep::is_canonical_with_project_workspace has cyclomatic complexity 24 (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 · PersistentShellManager · ×1
  • PersistentShellManager::exec (cyclomatic 24) crates/webcodex-persistent-shell/src/execution.rs:6 — PersistentShellManager::exec 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 · SessionStoreInner · ×1
  • SessionStoreInner::complete_message (cyclomatic 24) crates/webcodex-workflow-session/src/store.rs:3338 — SessionStoreInner::complete_message 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 · session_recovery.validate_registry (cyclomatic 24) · ×1
  • session_recovery.validate_registry (cyclomatic 24) integrations/codex/session_recovery.py:42 — session_recovery.validate_registry 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 · install.extractTarGz (cyclomatic 24) · ×1
  • install.extractTarGz (cyclomatic 24) REDACTED:646 — install.extractTarGz 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 · upload-source.resolveUploadLocation (cyclomatic 24) · ×1
  • upload-source.resolveUploadLocation (cyclomatic 24) plugins/campus-application/src/upload-source.ts:10 — upload-source.resolveUploadLocation 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 · REDACTED.validActivity (cyclomatic 24) · ×1
  • REDACTED.validActivity (cyclomatic 24) REDACTED:144 — REDACTED.validActivity has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · l.paintChar (cyclomatic 24) · ×1
  • l.paintChar (cyclomatic 24) src/mcp_pdf_app.html:690 — l.paintChar has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l.isVisible (cyclomatic 24) · ×1
  • l.isVisible (cyclomatic 24) src/mcp_pdf_app.html:690 — l.isVisible 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · ProjectTextEditInput · ×1
  • ProjectTextEditInput::validate (cyclomatic 23) crates/webcodex-tool-contracts/src/tool_inputs.rs:171 — ProjectTextEditInput::validate 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 · Budget · ×1
  • Budget::copy (cyclomatic 23) src/tool_request_trace/diagnostics.rs:59 — Budget::copy 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 · read_handoff.read_handoff (cyclomatic 23) · ×1
  • read_handoff.read_handoff (cyclomatic 23) integrations/codex/read_handoff.py:163 — read_handoff.read_handoff has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Knowledge.rebuild (cyclomatic 23) · ×1
  • Knowledge.rebuild (cyclomatic 23) plugins/project-knowledge/knowledge.py:374 — Knowledge.rebuild 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 · presentation.desktopErrorPresentation (cyclomatic 23) · ×1
  • presentation.desktopErrorPresentation (cyclomatic 23) apps/desktop/src/i18n/presentation.ts:164 — presentation.desktopErrorPresentation has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · McpProviderEditor.McpProviderEditor (cyclomatic 23) · ×1
  • McpProviderEditor.McpProviderEditor (cyclomatic 23) apps/desktop/src/features/extensions/McpProviderEditor.tsx:10 — McpProviderEditor.McpProviderEditor has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (submit, a function literal at line 28, a function literal at line 49, …). 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 · install.startNetworkRequest (cyclomatic 23) · ×1
  • install.startNetworkRequest (cyclomatic 23) REDACTED:291 — install.startNetworkRequest has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 belong to 2 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 · config.loadConfig (cyclomatic 23) · ×1
  • config.loadConfig (cyclomatic 23) plugins/agent-browser/src/config.ts:24 — config.loadConfig 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 · form-cache.matchSectionField (cyclomatic 23) · ×1
  • form-cache.matchSectionField (cyclomatic 23) plugins/campus-application/src/form-cache.ts:103 — form-cache.matchSectionField 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 · context.parsePorcelainStatus (cyclomatic 23) · ×1
  • context.parsePorcelainStatus (cyclomatic 23) plugins/repo-context/src/context.ts:187 — context.parsePorcelainStatus 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 · Dr.parseDrawingWrapper (cyclomatic 23) · ×1
  • Dr.parseDrawingWrapper (cyclomatic 23) REDACTED:1463 — Dr.parseDrawingWrapper has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: Ir.renderElement (cyclomatic 60) 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 · us.setAttributes (cyclomatic 23) · ×1
  • us.setAttributes (cyclomatic 23) src/mcp_pdf_app.html:646 — us.setAttributes has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · Re.toDateObject (cyclomatic 23) · ×1
  • Re.toDateObject (cyclomatic 23) src/mcp_pdf_app.html:647 — Re.toDateObject 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l._createMaskCanvas (cyclomatic 23) · ×1
  • l._createMaskCanvas (cyclomatic 23) src/mcp_pdf_app.html:690 — l._createMaskCanvas 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l._createContainer (cyclomatic 23) · ×1
  • l._createContainer (cyclomatic 23) src/mcp_pdf_app.html:690 — l._createContainer 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l.#l (cyclomatic 23) · ×1
  • l.#l (cyclomatic 23) src/mcp_pdf_app.html:692 — l.#l has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 2 function literals inside it that branch. 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.validWorkbench (cyclomatic 23) · ×1
  • REDACTED.validWorkbench (cyclomatic 23) REDACTED:508 — REDACTED.validWorkbench 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 · REDACTED.useSelectedContext (cyclomatic 23) · ×1
  • REDACTED.useSelectedContext (cyclomatic 23) REDACTED:1013 — REDACTED.useSelectedContext has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1017, 1033). 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 · webcodex_admin · ×1
  • webcodex_admin::commands::build_admin_request (cyclomatic 22) crates/webcodex-admin/src/commands.rs:569 — webcodex_admin::commands::build_admin_request has cyclomatic complexity 22 (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 · WindowActivityRegistry · ×1
  • WindowActivityRegistry::finish (cyclomatic 22) src/tool_runtime/window_activity.rs:572 — WindowActivityRegistry::finish 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 · Adapter.request (cyclomatic 22) · ×1
  • Adapter.request (cyclomatic 22) integrations/model_gateway/adapter.py:163 — Adapter.request 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 · ConfigurationDataPanel.ConfigurationDataPanel · ×1
  • ConfigurationDataPanel.ConfigurationDataPanel::renderEntry (cyclomatic 22) apps/desktop/src/features/settings/ConfigurationDataPanel.tsx:86 — ConfigurationDataPanel.ConfigurationDataPanel::renderEntry has cyclomatic complexity 22 (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 · desktop-window-behavior.installDesktopWindowBehavior (cyclomatic 22) · ×1
  • desktop-window-behavior.installDesktopWindowBehavior (cyclomatic 22) apps/desktop/src/lib/desktop-window-behavior.ts:8 — desktop-window-behavior.installDesktopWindowBehavior has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function items inside it that branch (onKeyDown, onContextMenu). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · REDACTED.bindSemanticFailure (cyclomatic 22) · ×1
  • REDACTED.bindSemanticFailure (cyclomatic 22) REDACTED:238 — REDACTED.bindSemanticFailure 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 · REDACTED.acceptToolInput (cyclomatic 22) · ×1
  • REDACTED.acceptToolInput (cyclomatic 22) REDACTED:887 — REDACTED.acceptToolInput has cyclomatic complexity 22 (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 · chooseMonth (cyclomatic 22) · ×1
  • chooseMonth (cyclomatic 22) crates/webcodex-browser/src/cdp/widgets/date.js:147 — chooseMonth has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 172, a function literal at line 153, a function literal at line 158, …). 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 · ProjectValidationRequest · ×1
  • ProjectValidationRequest::validate (cyclomatic 21) crates/webcodex-core/src/project_validation.rs:116 — ProjectValidationRequest::validate has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Adapter.event (cyclomatic 21) · ×1
  • Adapter.event (cyclomatic 21) integrations/model_gateway/adapter.py:237 — Adapter.event 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 · ProjectsPanel.ProjectsPanel · ×1
  • ProjectsPanel.ProjectsPanel::unregisterSelected (cyclomatic 21) apps/desktop/src/features/projects/ProjectsPanel.tsx:152 — ProjectsPanel.ProjectsPanel::unregisterSelected has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ProjectsPanel.ProjectsPanel) 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 · CloudflareConnectionCard.OAuthHandoff (cyclomatic 21) · ×1
  • CloudflareConnectionCard.OAuthHandoff (cyclomatic 21) apps/desktop/src/features/connection/CloudflareConnectionCard.tsx:20 — CloudflareConnectionCard.OAuthHandoff has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 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 · wrapper.captureProtectedNpmEnvironment (cyclomatic 21) · ×1
  • wrapper.captureProtectedNpmEnvironment (cyclomatic 21) npm/webcodex/bin/wrapper.js:76 — wrapper.captureProtectedNpmEnvironment 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 · fill-batch.createFillBatch (cyclomatic 21) · ×1
  • fill-batch.createFillBatch (cyclomatic 21) plugins/campus-application/src/fill-batch.ts:128 — fill-batch.createFillBatch 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 · l.executeOperatorList (cyclomatic 21) · ×1
  • l.executeOperatorList (cyclomatic 21) src/mcp_pdf_app.html:690 — l.executeOperatorList has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.renderReferences (cyclomatic 21) · ×1
  • REDACTED.renderReferences (cyclomatic 21) REDACTED:945 — REDACTED.renderReferences 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 · ShellJobStructuredExecutionMetadata · ×1
  • ShellJobStructuredExecutionMetadata::is_valid (cyclomatic 20) crates/webcodex-core/src/runner_protocol/job.rs:1151 — ShellJobStructuredExecutionMetadata::is_valid has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · RunnerConfigOperationResponse · ×1
  • RunnerConfigOperationResponse::validate (cyclomatic 20) crates/webcodex-core/src/runner_protocol.rs:1370 — RunnerConfigOperationResponse::validate 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 · PostRecordResponse · ×1
  • PostRecordResponse::finish (cyclomatic 20) src/tool_runtime/kernel/postprocess.rs:39 — PostRecordResponse::finish 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 · BrowserController.snapshot (cyclomatic 20) · ×1
  • BrowserController.snapshot (cyclomatic 20) plugins/agent-browser/src/browser.ts:175 — BrowserController.snapshot has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · resume.resolveResumeValue (cyclomatic 20) · ×1
  • resume.resolveResumeValue (cyclomatic 20) plugins/campus-application/src/resume.ts:467 — resume.resolveResumeValue 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 · plugin.supportFor (cyclomatic 20) · ×1
  • plugin.supportFor (cyclomatic 20) plugins/campus-application/src/plugin.ts:165 — plugin.supportFor has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · domain.resolveAuthorizedTarget (cyclomatic 20) · ×1
  • domain.resolveAuthorizedTarget (cyclomatic 20) plugins/safe-delete/domain.ts:181 — domain.resolveAuthorizedTarget 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 · REDACTED.toolResultShape (cyclomatic 20) · ×1
  • REDACTED.toolResultShape (cyclomatic 20) REDACTED:214 — REDACTED.toolResultShape 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 · REDACTED.poll (cyclomatic 20) · ×1
  • REDACTED.poll (cyclomatic 20) REDACTED:465 — REDACTED.poll has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · us.render (cyclomatic 20) · ×1
  • us.render (cyclomatic 20) src/mcp_pdf_app.html:646 — us.render has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · It.#f (cyclomatic 20) · ×1
  • It.#f (cyclomatic 20) src/mcp_pdf_app.html:647 — It.#f has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l.disable (cyclomatic 20) · ×1
  • l.disable (cyclomatic 20) src/mcp_pdf_app.html:700 — l.disable has cyclomatic complexity 20 (threshold 15). Of this number, 14 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.appendJobDetails (cyclomatic 20) · ×1
  • REDACTED.appendJobDetails (cyclomatic 20) REDACTED:669 — REDACTED.appendJobDetails 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 · REDACTED.applyLaunch (cyclomatic 20) · ×1
  • REDACTED.applyLaunch (cyclomatic 20) REDACTED:1052 — REDACTED.applyLaunch 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 · command (cyclomatic 20) · ×1
  • command (cyclomatic 20) extensions/browser-bridge/worker.js:226 — command has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ProjectInstructionsSnapshot · ×1
  • ProjectInstructionsSnapshot::retain_unavailable_scopes (cyclomatic 19) crates/webcodex-core/src/project_instructions.rs:278 — ProjectInstructionsSnapshot::retain_unavailable_scopes 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 · Receipts · ×1
  • Receipts::open_inner (cyclomatic 19) crates/webcodex-openai-tunnel/src/run_receipts.rs:46 — Receipts::open_inner 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 · Knowledge.search (cyclomatic 19) · ×1
  • Knowledge.search (cyclomatic 19) plugins/project-knowledge/knowledge.py:695 — Knowledge.search 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 · PowerShellInstallGuidance.PowerShellGuidanceControls (cyclomatic 19) · ×1
  • PowerShellInstallGuidance.PowerShellGuidanceControls (cyclomatic 19) apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:16 — PowerShellInstallGuidance.PowerShellGuidanceControls has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (recheck, openGuide). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · TunnelConfigDiagnostics.TunnelConfigDiagnostics (cyclomatic 19) · ×1
  • TunnelConfigDiagnostics.TunnelConfigDiagnostics (cyclomatic 19) apps/desktop/src/features/connection/TunnelConfigDiagnostics.tsx:8 — TunnelConfigDiagnostics.TunnelConfigDiagnostics has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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 · choice-controls.planChoiceGroup (cyclomatic 19) · ×1
  • choice-controls.planChoiceGroup (cyclomatic 19) plugins/campus-application/src/choice-controls.ts:18 — choice-controls.planChoiceGroup has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 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 · domain.moveToFreedesktopTrash (cyclomatic 19) · ×1
  • domain.moveToFreedesktopTrash (cyclomatic 19) plugins/safe-delete/domain.ts:394 — domain.moveToFreedesktopTrash has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · us.setupStorage (cyclomatic 19) · ×1
  • us.setupStorage (cyclomatic 19) src/mcp_pdf_app.html:646 — us.setupStorage has cyclomatic complexity 19 (threshold 15). Of this number, 17 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · ps.#P (cyclomatic 19) · ×1
  • ps.#P (cyclomatic 19) src/mcp_pdf_app.html:647 — ps.#P 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · ApplyFileChangeInput · ×1
  • ApplyFileChangeInput::deserialize (cyclomatic 18) crates/webcodex-tool-contracts/src/tool_inputs.rs:331 — ApplyFileChangeInput::deserialize 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 · CanonicalOrchestrationHost · ×1
  • CanonicalOrchestrationHost::invoke_tool (cyclomatic 18) src/tool_runtime/orchestration_host.rs:756 — CanonicalOrchestrationHost::invoke_tool 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 · common.optionsIn (cyclomatic 18) · ×1
  • common.optionsIn (cyclomatic 18) crates/webcodex-browser/src/cdp/widgets/common.js:198 — common.optionsIn has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 201). 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 · wrapper.runNative (cyclomatic 18) · ×1
  • wrapper.runNative (cyclomatic 18) npm/webcodex/bin/wrapper.js:186 — wrapper.runNative has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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 · l.#z (cyclomatic 18) · ×1
  • l.#z (cyclomatic 18) src/mcp_pdf_app.html:690 — l.#z has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l.editorDivPaste (cyclomatic 18) · ×1
  • l.editorDivPaste (cyclomatic 18) src/mcp_pdf_app.html:693 — l.editorDivPaste 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: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.addGitFile (cyclomatic 18) · ×1
  • REDACTED.addGitFile (cyclomatic 18) REDACTED:269 — REDACTED.addGitFile 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 · REDACTED.jobState (cyclomatic 18) · ×1
  • REDACTED.jobState (cyclomatic 18) REDACTED:631 — REDACTED.jobState 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 · REDACTED.openGoal (cyclomatic 18) · ×1
  • REDACTED.openGoal (cyclomatic 18) REDACTED:788 — REDACTED.openGoal 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 · CdpBackend · ×1
  • CdpBackend::wait_for_stable (cyclomatic 17) crates/webcodex-browser/src/cdp.rs:1611 — CdpBackend::wait_for_stable 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 · ControllerRuntime · ×1
  • ControllerRuntime::reap_and_recover (cyclomatic 17) crates/webcodex-cli/src/webcodex_cli/controller.rs:1242 — ControllerRuntime::reap_and_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 · ProjectBuildRequest · ×1
  • ProjectBuildRequest::validate (cyclomatic 17) crates/webcodex-core/src/project_build.rs:101 — ProjectBuildRequest::validate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · webcodex_persistent_shell · ×1
  • webcodex_persistent_shell::unix::readers::spawn_control_reader (cyclomatic 17) crates/webcodex-persistent-shell/src/unix/readers.rs:70 — webcodex_persistent_shell::unix::readers::spawn_control_reader 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 · RemoteShellTransport · ×1
  • RemoteShellTransport::wait_for_completion (cyclomatic 17) crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:222 — RemoteShellTransport::wait_for_completion 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 · RegisteredStream · ×1
  • RegisteredStream::finish (cyclomatic 17) crates/webcodex-runner/src/webcodex_runner/transport/stream.rs:102 — RegisteredStream::finish 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 · CloudflareControl · ×1
  • CloudflareControl::provision_oauth (cyclomatic 17) src/cloudflare_ingress.rs:883 — CloudflareControl::provision_oauth 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 · experience_proposals.validate_candidate (cyclomatic 17) · ×1
  • experience_proposals.validate_candidate (cyclomatic 17) integrations/codex/experience_proposals.py:142 — experience_proposals.validate_candidate 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 · Knowledge.source (cyclomatic 17) · ×1
  • Knowledge.source (cyclomatic 17) plugins/project-knowledge/knowledge.py:288 — Knowledge.source 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 · RunnerCapabilityAuthorization.AuthorizationFlow · ×1
  • RunnerCapabilityAuthorization.AuthorizationFlow::authorize (cyclomatic 17) apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:43 — RunnerCapabilityAuthorization.AuthorizationFlow::authorize 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 (RunnerCapabilityAuthorization.AuthorizationFlow) 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 · RunnerCapabilityAuthorization.AuthorizationFlow (cyclomatic 17) · ×1
  • RunnerCapabilityAuthorization.AuthorizationFlow (cyclomatic 17) apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:22 — RunnerCapabilityAuthorization.AuthorizationFlow has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (RunnerCapabilityAuthorization.AuthorizationFlow::authorize) 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 · SshResourcesPanel.SshResourcesPanel · ×1
  • SshResourcesPanel.SshResourcesPanel::observe (cyclomatic 17) apps/desktop/src/features/extensions/SshResourcesPanel.tsx:44 — SshResourcesPanel.SshResourcesPanel::observe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SshResourcesPanel.SshResourcesPanel) 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 · SshResourcesPanel.SshResourcesPanel (cyclomatic 17) · ×1
  • SshResourcesPanel.SshResourcesPanel (cyclomatic 17) apps/desktop/src/features/extensions/SshResourcesPanel.tsx:23 — SshResourcesPanel.SshResourcesPanel has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SshResourcesPanel.SshResourcesPanel::observe) 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 · set_value.default (cyclomatic 17) · ×1
  • set_value.default (cyclomatic 17) crates/webcodex-browser/src/cdp/set_value.js:1 — set_value.default 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 · common.linkedRoots (cyclomatic 17) · ×1
  • common.linkedRoots (cyclomatic 17) crates/webcodex-browser/src/cdp/widgets/common.js:129 — common.linkedRoots has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement 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.
D1 · Cyclomatic Complexity · context.parseCargoMetadata (cyclomatic 17) · ×1
  • context.parseCargoMetadata (cyclomatic 17) plugins/repo-context/src/context.ts:307 — context.parseCargoMetadata has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · REDACTED.validWaitProjection (cyclomatic 17) · ×1
  • REDACTED.validWaitProjection (cyclomatic 17) REDACTED:419 — REDACTED.validWaitProjection 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 · REDACTED.bind (cyclomatic 17) · ×1
  • REDACTED.bind (cyclomatic 17) REDACTED:623 — REDACTED.bind 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 · REDACTED.maybeStartBinding (cyclomatic 17) · ×1
  • REDACTED.maybeStartBinding (cyclomatic 17) REDACTED:942 — REDACTED.maybeStartBinding 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 · Mn.recordCharacterBBox (cyclomatic 17) · ×1
  • Mn.recordCharacterBBox (cyclomatic 17) src/mcp_pdf_app.html:647 — Mn.recordCharacterBBox has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l.render (cyclomatic 17) · ×1
  • l.render (cyclomatic 17) src/mcp_pdf_app.html:692 — l.render has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.validationRunState (cyclomatic 17) · ×1
  • REDACTED.validationRunState (cyclomatic 17) REDACTED:102 — REDACTED.validationRunState 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 · REDACTED.loadSessions (cyclomatic 17) · ×1
  • REDACTED.loadSessions (cyclomatic 17) REDACTED:441 — REDACTED.loadSessions 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 · REDACTED.renderAvailability (cyclomatic 17) · ×1
  • REDACTED.renderAvailability (cyclomatic 17) REDACTED:597 — REDACTED.renderAvailability 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 · REDACTED.openTodo (cyclomatic 17) · ×1
  • REDACTED.openTodo (cyclomatic 17) REDACTED:678 — REDACTED.openTodo 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, 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 · REDACTED.addReferenceNow (cyclomatic 17) · ×1
  • REDACTED.addReferenceNow (cyclomatic 17) REDACTED:996 — REDACTED.addReferenceNow 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 · REDACTED.syncContext (cyclomatic 17) · ×1
  • REDACTED.syncContext (cyclomatic 17) REDACTED:1037 — REDACTED.syncContext 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 · REDACTED.acceptResult (cyclomatic 17) · ×1
  • REDACTED.acceptResult (cyclomatic 17) REDACTED:1063 — REDACTED.acceptResult 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 · (anonymous) (cyclomatic 17) · ×1
  • (anonymous) (cyclomatic 17) crates/webcodex-browser/src/cdp/set_value.js:1 — (anonymous) 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 · TrayProjection · ×1
  • TrayProjection::from_snapshot (cyclomatic 16) apps/desktop/src-tauri/src/tray.rs:97 — TrayProjection::from_snapshot 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 · RunnerSkillRequest · ×1
  • RunnerSkillRequest::validate (cyclomatic 16) crates/webcodex-core/src/runner_skill.rs:262 — RunnerSkillRequest::validate 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 · UnifiedInstallerManifest · ×1
  • UnifiedInstallerManifest::parse_value (cyclomatic 16) crates/webcodex-environment/src/unified_update.rs:451 — UnifiedInstallerManifest::parse_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 · RunFence · ×1
  • RunFence::acquire_restartable (cyclomatic 16) crates/webcodex-openai-tunnel/src/run_fence.rs:321 — RunFence::acquire_restartable 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 · ShellProcess · ×1
  • ShellProcess::wait_for_completion (cyclomatic 16) crates/webcodex-persistent-shell/src/unix.rs:71 — ShellProcess::wait_for_completion 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 · InputChannel · ×1
  • InputChannel::with_writer (cyclomatic 16) crates/webcodex-runner/src/webcodex_runner/job_manager/input.rs:31 — InputChannel::with_writer 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 · ControlExecution · ×1
  • ControlExecution::validate (cyclomatic 16) src/tool_runtime/control_sidecar.rs:466 — ControlExecution::validate 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 · SessionShellRegistry · ×1
  • SessionShellRegistry::apply_result (cyclomatic 16) src/tool_runtime/session_shell.rs:205 — SessionShellRegistry::apply_result 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 · platform_security._windows_private_acl (cyclomatic 16) · ×1
  • platform_security._windows_private_acl (cyclomatic 16) integrations/codex/platform_security.py:202 — platform_security._windows_private_acl 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 · read_handoff._valid_goal_detail (cyclomatic 16) · ×1
  • read_handoff._valid_goal_detail (cyclomatic 16) integrations/codex/read_handoff.py:66 — read_handoff._valid_goal_detail 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 · QuickShareSetup.QuickShareSetup (cyclomatic 16) · ×1
  • QuickShareSetup.QuickShareSetup (cyclomatic 16) apps/desktop/src/features/onboarding/QuickShareSetup.tsx:10 — QuickShareSetup.QuickShareSetup has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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 · wrapper.resolveWindowsNpmCli (cyclomatic 16) · ×1
  • wrapper.resolveWindowsNpmCli (cyclomatic 16) npm/webcodex/bin/wrapper.js:41 — wrapper.resolveWindowsNpmCli 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 · Ir.splitBySection (cyclomatic 16) · ×1
  • Ir.splitBySection (cyclomatic 16) REDACTED:1463 — Ir.splitBySection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Ir.renderElement (cyclomatic 60) 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 · l.#ot (cyclomatic 16) · ×1
  • l.#ot (cyclomatic 16) src/mcp_pdf_app.html:647 — l.#ot has cyclomatic complexity 16 (threshold 15). Of this number, 13 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. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · l.#c (cyclomatic 16) · ×1
  • l.#c (cyclomatic 16) src/mcp_pdf_app.html:692 — l.#c has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: fi.setupMessageHandler (cyclomatic 35) 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 · REDACTED.submitWork (cyclomatic 16) · ×1
  • REDACTED.submitWork (cyclomatic 16) REDACTED:761 — REDACTED.submitWork 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 · assignPart (cyclomatic 16) · ×1
  • assignPart (cyclomatic 16) crates/webcodex-browser/src/cdp/widgets/date.js:50 — assignPart has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment crates/webcodex-workflow-session/src/model.rs:932 — /// todo thread exceeds this bound the assignment read fails closed rather than — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · UpdateWorkflow.UpdateWorkflow (cognitive 183) · ×1
  • UpdateWorkflow.UpdateWorkflow (cognitive 183) apps/desktop/src/features/settings/UpdateWorkflow.tsx:34 — UpdateWorkflow.UpdateWorkflow has cognitive complexity 183 (threshold 15). Drivers by points: ternaries 27 (140 pts), boolean chains 41, if/else 2 (nesting depth added 113). Of this number, 182 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. 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 · FirstRun.FirstRun (cognitive 124) · ×1
  • FirstRun.FirstRun (cognitive 124) apps/desktop/src/features/onboarding/FirstRun.tsx:47 — FirstRun.FirstRun has cognitive complexity 124 (threshold 15). Drivers by points: boolean chains 70, ternaries 26 (32 pts), if/else 16 (20 pts), error handling 2 (nesting depth added 10). Of this number, 84 points are the body's own statements and 40 belong to 6 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.
D2 · Cognitive Complexity · ParsedCall · ×1
  • ParsedCall::prepare (cognitive 95) src/mcp/tools/call.rs:204 — ParsedCall::prepare has cognitive complexity 95 (threshold 15). Drivers by points: if/else 41 (79 pts), boolean chains 8, match/switch 5 (8 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsPanel.SettingsView (cognitive 86) · ×1
  • SettingsPanel.SettingsView (cognitive 86) apps/desktop/src/features/settings/SettingsPanel.tsx:57 — SettingsPanel.SettingsView has cognitive complexity 86 (threshold 15). Drivers by points: boolean chains 32, if/else 25 (29 pts), ternaries 12 (21 pts), error handling 4 (nesting depth added 13). Of this number, 41 points are the body's own statements and 45 belong to 15 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 · DiagnosticsPanel.DiagnosticsContents (cognitive 85) · ×1
  • DiagnosticsPanel.DiagnosticsContents (cognitive 85) apps/desktop/src/features/settings/DiagnosticsPanel.tsx:23 — DiagnosticsPanel.DiagnosticsContents has cognitive complexity 85 (threshold 15). Drivers by points: boolean chains 42, if/else 24 (30 pts), ternaries 7 (11 pts), error handling 2 (nesting depth added 10). Of this number, 39 points are the body's own statements and 46 belong to 15 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.
D2 · Cognitive Complexity · REDACTED.renderGitReview (cognitive 84) · ×1
  • REDACTED.renderGitReview (cognitive 84) REDACTED:559 — REDACTED.renderGitReview has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 29 (57 pts), boolean chains 14, if/else 12 (13 pts) (nesting depth added 29). Most of this is not in the body itself: 14 of the 84 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 576, 602). 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 · Knowledge.refresh (cognitive 81) · ×1
  • Knowledge.refresh (cognitive 81) plugins/project-knowledge/knowledge.py:505 — Knowledge.refresh has cognitive complexity 81 (threshold 15). Drivers by points: if/else 22 (50 pts), boolean chains 10, ternaries 2 (8 pts), error handling 4 (7 pts), loops 4 (6 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConnectionRuntimes · ×1
  • ConnectionRuntimes::monitor (cognitive 80) apps/desktop/src-tauri/src/connections.rs:320 — ConnectionRuntimes::monitor has cognitive complexity 80 (threshold 15). Drivers by points: if/else 30 (68 pts), boolean chains 7, match/switch 2 (4 pts), loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthMiddleware · ×1
  • AuthMiddleware::handle (cognitive 80) src/auth/middleware.rs:284 — AuthMiddleware::handle has cognitive complexity 80 (threshold 15). Drivers by points: if/else 31 (74 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 44). 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 · WorkspaceContext.WorkspaceProvider (cognitive 77) · ×1
  • WorkspaceContext.WorkspaceProvider (cognitive 77) apps/desktop/src/features/workspace/WorkspaceContext.tsx:70 — WorkspaceContext.WorkspaceProvider has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 19 (31 pts), boolean chains 29, if/else 16 (17 pts) (nesting depth added 13). Most of this is not in the body itself: 11 of the 77 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 182, 136, 117, …). 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 · plugin.analyzeNodes (cognitive 75) · ×1
  • plugin.analyzeNodes (cognitive 75) plugins/campus-application/src/plugin.ts:221 — plugin.analyzeNodes has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (40 pts), ternaries 6 (18 pts), boolean chains 11, loops 4 (6 pts) (nesting depth added 37). Of this number, 74 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 · RuntimeSurface · ×1
  • RuntimeSurface::admit (cognitive 74) src/mcp/tools/call/surface.rs:14 — RuntimeSurface::admit has cognitive complexity 74 (threshold 15). Drivers by points: boolean chains 36, if/else 16 (31 pts), match/switch 3 (7 pts) (nesting depth added 19). 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 · fill-batch.reconcileFill (cognitive 74) · ×1
  • fill-batch.reconcileFill (cognitive 74) plugins/campus-application/src/fill-batch.ts:157 — fill-batch.reconcileFill has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 13 (42 pts), if/else 11 (17 pts), boolean chains 14, loops 1 (nesting depth added 35). 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 · RuntimePanel.RuntimePanelContent (cognitive 71) · ×1
  • RuntimePanel.RuntimePanelContent (cognitive 71) apps/desktop/src/features/settings/RuntimePanel.tsx:18 — RuntimePanel.RuntimePanelContent has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 30, if/else 21 (23 pts), ternaries 9 (16 pts), error handling 2 (nesting depth added 9). Of this number, 37 points are the body's own statements and 34 belong to 10 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 · RunnerCapacityPanel.RunnerCapacitySettings (cognitive 66) · ×1
  • RunnerCapacityPanel.RunnerCapacitySettings (cognitive 66) apps/desktop/src/features/settings/RunnerCapacityPanel.tsx:21 — RunnerCapacityPanel.RunnerCapacitySettings has cognitive complexity 66 (threshold 15). Drivers by points: boolean chains 35, if/else 18 (20 pts), ternaries 9 (10 pts), error handling 1 (nesting depth added 3). Of this number, 27 points are the body's own statements and 39 belong to 10 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.
D2 · Cognitive Complexity · native-config.inspectNativeConfig (cognitive 64) · ×1
  • native-config.inspectNativeConfig (cognitive 64) plugins/agent-browser/src/native-config.ts:41 — native-config.inspectNativeConfig has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 16, ternaries 13 (15 pts), error handling 3 (5 pts), loops 3 (nesting depth added 11). Of this number, 59 points are the body's own statements and 5 belong to 4 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 · REDACTED.renderValidationSummary (cognitive 62) · ×1
  • REDACTED.renderValidationSummary (cognitive 62) REDACTED:221 — REDACTED.renderValidationSummary has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 27 (44 pts), boolean chains 12, if/else 6 (nesting depth added 17). Most of this is not in the body itself: 13 of the 62 points are its own statements and the rest belongs to one function literal inside it that branches (line 235). 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 · REDACTED.loadWorkbench (cognitive 62) · ×1
  • REDACTED.loadWorkbench (cognitive 62) REDACTED:520 — REDACTED.loadWorkbench has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 15, ternaries 6, error handling 2 (4 pts) (nesting depth added 22). Of this number, 60 points are the body's own statements and 2 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 · REDACTED.validPlan (cognitive 61) · ×1
  • REDACTED.validPlan (cognitive 61) REDACTED:236 — REDACTED.validPlan has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (38 pts), boolean chains 21, loops 2 (nesting depth added 9). 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 · ReadinessBanner.ReadinessBanner (cognitive 60) · ×1
  • ReadinessBanner.ReadinessBanner (cognitive 60) apps/desktop/src/features/dashboard/ReadinessBanner.tsx:8 — ReadinessBanner.ReadinessBanner has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 14 (29 pts), boolean chains 24, if/else 4, error handling 2 (3 pts) (nesting depth added 16). Of this number, 52 points are the body's own statements and 8 belong to 3 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 · ConnectionCard.ConnectionCard (cognitive 60) · ×1
  • ConnectionCard.ConnectionCard (cognitive 60) apps/desktop/src/features/connection/ConnectionCard.tsx:34 — ConnectionCard.ConnectionCard has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 15 (32 pts), boolean chains 21, if/else 6 (7 pts) (nesting depth added 18). Of this number, 56 points are the body's own statements and 4 belong to 3 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 · RuntimeResponse · ×1
  • RuntimeResponse::finish (cognitive 59) src/mcp/tools/call/response.rs:17 — RuntimeResponse::finish has cognitive complexity 59 (threshold 15). Drivers by points: if/else 34 (49 pts), boolean chains 8, match/switch 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudflareConnectionCard.CloudflareConnectionCard (cognitive 59) · ×1
  • CloudflareConnectionCard.CloudflareConnectionCard (cognitive 59) apps/desktop/src/features/connection/CloudflareConnectionCard.tsx:61 — CloudflareConnectionCard.CloudflareConnectionCard has cognitive complexity 59 (threshold 15). Drivers by points: boolean chains 25, ternaries 12 (22 pts), if/else 8 (10 pts), error handling 2 (nesting depth added 12). Of this number, 40 points are the body's own statements and 19 belong to 3 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 · l.isVisible (cognitive 58) · ×1
  • l.isVisible (cognitive 58) src/mcp_pdf_app.html:690 — l.isVisible has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 4 (12 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PendingDispatchFence · ×1
  • PendingDispatchFence::synchronous_rejection (cognitive 56) crates/webcodex-runner-registry/src/dispatch_fence.rs:111 — PendingDispatchFence::synchronous_rejection has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (42 pts), match/switch 5 (10 pts), boolean chains 4 (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 · vi.render (cognitive 56) · ×1
  • vi.render (cognitive 56) src/mcp_pdf_app.html:690 — vi.render has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 39, if/else 5 (9 pts), loops 1 (4 pts), ternaries 1 (4 pts) (nesting depth added 10). Of this number, 51 points are the body's own statements and 5 belong to 8 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.
D2 · Cognitive Complexity · REDACTED.renderPresentation (cognitive 56) · ×1
  • REDACTED.renderPresentation (cognitive 56) REDACTED:775 — REDACTED.renderPresentation has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (34 pts), ternaries 9 (17 pts), boolean chains 5 (nesting depth added 23). Of this number, 54 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 · AdminProjectLifecycleService · ×1
  • AdminProjectLifecycleService::mutate_authorized_core (cognitive 55) src/admin_project_lifecycle.rs:286 — AdminProjectLifecycleService::mutate_authorized_core has cognitive complexity 55 (threshold 15). Drivers by points: if/else 35 (47 pts), boolean chains 7, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionPanel.ConnectionPanel (cognitive 55) · ×1
  • ConnectionPanel.ConnectionPanel (cognitive 55) apps/desktop/src/features/connection/ConnectionPanel.tsx:18 — ConnectionPanel.ConnectionPanel has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 32, ternaries 8 (15 pts), if/else 5 (6 pts), error handling 2 (nesting depth added 8). Of this number, 35 points are the body's own statements and 20 belong to 7 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.
D2 · Cognitive Complexity · useDesktopWorkspace.useDesktopWorkspace (cognitive 54) · ×1
  • useDesktopWorkspace.useDesktopWorkspace (cognitive 54) apps/desktop/src/hooks/useDesktopWorkspace.ts:12 — useDesktopWorkspace.useDesktopWorkspace has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (29 pts), boolean chains 14, error handling 5 (7 pts), ternaries 4 (nesting depth added 7). Most of this is not in the body itself: 3 of the 54 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 109, 59, 198, …). 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 · AboutPanel.AboutPanelContent (cognitive 54) · ×1
  • AboutPanel.AboutPanelContent (cognitive 54) apps/desktop/src/features/settings/AboutPanel.tsx:18 — AboutPanel.AboutPanelContent has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 24, ternaries 9 (18 pts), if/else 10 (11 pts), error handling 1 (nesting depth added 10). Of this number, 36 points are the body's own statements and 18 belong to 9 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 · PersistedSessionRecord · ×1
  • PersistedSessionRecord::into_record (cognitive 52) crates/webcodex-workflow-session/src/persistence.rs:222 — PersistedSessionRecord::into_record has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 11, loops 5 (8 pts) (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 · REDACTED.validContinuity (cognitive 51) · ×1
  • REDACTED.validContinuity (cognitive 51) REDACTED:159 — REDACTED.validContinuity has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 24, loops 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.
D2 · Cognitive Complexity · ActivityPanel.ActivityPanel (cognitive 50) · ×1
  • ActivityPanel.ActivityPanel (cognitive 50) apps/desktop/src/features/activity/ActivityPanel.tsx:56 — ActivityPanel.ActivityPanel has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 40, ternaries 5 (6 pts), if/else 4 (nesting depth added 1). Of this number, 34 points are the body's own statements and 16 belong to 12 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.
D2 · Cognitive Complexity · l.executeOperatorList (cognitive 50) · ×1
  • l.executeOperatorList (cognitive 50) src/mcp_pdf_app.html:690 — l.executeOperatorList has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 3 (10 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · form-cache.deriveMappings (cognitive 49) · ×1
  • form-cache.deriveMappings (cognitive 49) plugins/campus-application/src/form-cache.ts:414 — form-cache.deriveMappings has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 6 (13 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 21). Of this number, 44 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 · PreparedRuntimeCall · ×1
  • PreparedRuntimeCall::prepare (cognitive 48) src/mcp/tools/call.rs:489 — PreparedRuntimeCall::prepare has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 22). 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 · Adapter.request (cognitive 48) · ×1
  • Adapter.request (cognitive 48) integrations/model_gateway/adapter.py:163 — Adapter.request has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (42 pts), loops 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 26). 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 · l.showText (cognitive 48) · ×1
  • l.showText (cognitive 48) src/mcp_pdf_app.html:690 — l.showText has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 18, loops 2 (3 pts), ternaries 2 (3 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 · control (cognitive 48) · ×1
  • control (cognitive 48) extensions/browser-bridge/worker.js:153 — control has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 4 (11 pts), boolean chains 7, other 3, loops 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 · plugin.handle_frame (cognitive 47) · ×1
  • plugin.handle_frame (cognitive 47) plugins/project-knowledge/plugin.py:88 — plugin.handle_frame has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 9, error handling 3 (5 pts), loops 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 · Rt.#a (cognitive 47) · ×1
  • Rt.#a (cognitive 47) src/mcp_pdf_app.html:700 — Rt.#a has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 7 (12 pts), boolean chains 8, ternaries 2 (7 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 · ManagedInstructionsPanel.ManagedInstructionsPanel (cognitive 45) · ×1
  • ManagedInstructionsPanel.ManagedInstructionsPanel (cognitive 45) apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:11 — ManagedInstructionsPanel.ManagedInstructionsPanel has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 19, if/else 14 (19 pts), error handling 4 (6 pts), ternaries 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 29 belong to 5 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 · ConfigurationDataPanel.ConfigurationDataPanel (cognitive 44) · ×1
  • ConfigurationDataPanel.ConfigurationDataPanel (cognitive 44) apps/desktop/src/features/settings/ConfigurationDataPanel.tsx:36 — ConfigurationDataPanel.ConfigurationDataPanel has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 25, if/else 8 (10 pts), ternaries 7, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 9 of the 44 points are its own statements and the rest belongs to 5 function items inside it that branch (renderEntry, refresh, act, …). 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 · REDACTED.reconcile (cognitive 44) · ×1
  • REDACTED.reconcile (cognitive 44) REDACTED:390 — REDACTED.reconcile has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 5, error handling 3 (5 pts) (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 · REDACTED.renderWorkbench (cognitive 44) · ×1
  • REDACTED.renderWorkbench (cognitive 44) REDACTED:563 — REDACTED.renderWorkbench has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 16, ternaries 4 (14 pts), if/else 6 (11 pts), loops 2 (3 pts) (nesting depth added 16). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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 · Adapter.handle (cognitive 43) · ×1
  • Adapter.handle (cognitive 43) integrations/model_gateway/adapter.py:62 — Adapter.handle has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 11, error handling 2 (3 pts), loops 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 · ProjectsPanel.ProjectsPanel · ×1
  • ProjectsPanel.ProjectsPanel::unregisterSelected (cognitive 43) apps/desktop/src/features/projects/ProjectsPanel.tsx:152 — ProjectsPanel.ProjectsPanel::unregisterSelected has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (7 pts), error handling 2 (5 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ProjectsPanel.ProjectsPanel) 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 · ConnectionEditor.ConnectionEditor (cognitive 42) · ×1
  • ConnectionEditor.ConnectionEditor (cognitive 42) apps/desktop/src/features/connection/ConnectionEditor.tsx:10 — ConnectionEditor.ConnectionEditor has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 31, ternaries 6, if/else 4, error handling 1. Of this number, 30 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · RunnerFileAccess.RunnerFileAccess (cognitive 42) · ×1
  • RunnerFileAccess.RunnerFileAccess (cognitive 42) apps/desktop/src/features/settings/RunnerFileAccess.tsx:35 — RunnerFileAccess.RunnerFileAccess has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 17, error handling 3, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 15 of the 42 points are its own statements and the rest belongs to 6 function items inside it that branch (write, add, begin, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NativeBackend.run (cognitive 42) · ×1
  • NativeBackend.run (cognitive 42) plugins/agent-browser/src/backend.ts:132 — NativeBackend.run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 10, ternaries 5 (7 pts), error handling 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 · REDACTED.projectionSemanticFailure (cognitive 42) · ×1
  • REDACTED.projectionSemanticFailure (cognitive 42) REDACTED:494 — REDACTED.projectionSemanticFailure has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 14 (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 · REDACTED.recoverExpiredEndpoint (cognitive 42) · ×1
  • REDACTED.recoverExpiredEndpoint (cognitive 42) REDACTED:787 — REDACTED.recoverExpiredEndpoint has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShellJobValidationMetadata · ×1
  • ShellJobValidationMetadata::is_valid (cognitive 41) crates/webcodex-core/src/runner_protocol/job.rs:941 — ShellJobValidationMetadata::is_valid has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 26, if/else 12 (14 pts), match/switch 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 · form-cache.matchSectionField (cognitive 41) · ×1
  • form-cache.matchSectionField (cognitive 41) plugins/campus-application/src/form-cache.ts:103 — form-cache.matchSectionField has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (41 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 · context.parsePorcelainStatus (cognitive 41) · ×1
  • context.parsePorcelainStatus (cognitive 41) plugins/repo-context/src/context.ts:187 — context.parsePorcelainStatus has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 10, 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 · noProxyMatches (cognitive 41) · ×1
  • noProxyMatches (cognitive 41) REDACTED:178 — noProxyMatches has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 7, ternaries 2 (4 pts), error handling 1 (3 pts), 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 · State · ×1
  • State::receive (cognitive 40) crates/webcodex-browser/src/bridge.rs:191 — State::receive has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 7, match/switch 1 (nesting depth added 16). 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 · REDACTED.workCard (cognitive 40) · ×1
  • REDACTED.workCard (cognitive 40) REDACTED:616 — REDACTED.workCard has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 16, ternaries 2 (3 pts) (nesting depth added 9). Of this number, 31 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Knowledge.rebuild (cognitive 39) · ×1
  • Knowledge.rebuild (cognitive 39) plugins/project-knowledge/knowledge.py:374 — Knowledge.rebuild has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 4 (7 pts), boolean chains 5, loops 3 (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 · execute (cognitive 39) · ×1
  • execute (cognitive 39) plugins/agent-environment/src/bridge.mjs:39 — execute has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 9, if/else 6 (8 pts), error handling 2 (3 pts), other 2, loops 1, match/switch 1 (nesting depth added 10). Of this number, 38 points are the body's own statements and 1 belongs to 13 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 · ToolCall · ×1
  • ToolCall::from_tool_name_with_normalization (cognitive 38) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:256 — ToolCall::from_tool_name_with_normalization has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 6 (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 · session_recovery.validate_registry (cognitive 38) · ×1
  • session_recovery.validate_registry (cognitive 38) integrations/codex/session_recovery.py:42 — session_recovery.validate_registry has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 10, loops 5 (10 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 · ComputerPermissions.ComputerPermissions (cognitive 38) · ×1
  • ComputerPermissions.ComputerPermissions (cognitive 38) apps/desktop/src/features/settings/ComputerPermissions.tsx:14 — ComputerPermissions.ComputerPermissions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 15, ternaries 4, error handling 3 (nesting depth added 2). Of this number, 17 points are the body's own statements and 21 belong to 8 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.
D2 · Cognitive Complexity · RunnerDevices.RunnerDevices (cognitive 38) · ×1
  • RunnerDevices.RunnerDevices (cognitive 38) apps/desktop/src/features/projects/RunnerDevices.tsx:8 — RunnerDevices.RunnerDevices has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (27 pts), boolean chains 9, if/else 2 (nesting depth added 13). Most of this is not in the body itself: 2 of the 38 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 23, 12, 17). 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 · PluginToolCall · ×1
  • PluginToolCall::validate (cognitive 37) crates/webcodex-tool-contracts/src/tool_call/input_types.rs:74 — PluginToolCall::validate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 8, 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 · fetchToFile (cognitive 37) · ×1
  • fetchToFile (cognitive 37) REDACTED:463 — fetchToFile has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 7, error handling 4 (5 pts), ternaries 2 (nesting depth added 4). Most of this is not in the body itself: 6 of the 37 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 551, (anonymous)::fail, a function literal at line 606, …). 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 · webcodex_persistent_shell · ×1
  • webcodex_persistent_shell::unix::readers::spawn_control_reader (cognitive 36) crates/webcodex-persistent-shell/src/unix/readers.rs:70 — webcodex_persistent_shell::unix::readers::spawn_control_reader has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 3 (11 pts), loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Budget · ×1
  • Budget::copy (cognitive 36) src/tool_request_trace/diagnostics.rs:59 — Budget::copy has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · l.disable (cognitive 36) · ×1
  • l.disable (cognitive 36) src/mcp_pdf_app.html:700 — l.disable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 16). Of this number, 24 points are the body's own statements and 12 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 · REDACTED.renderExecutors (cognitive 36) · ×1
  • REDACTED.renderExecutors (cognitive 36) REDACTED:699 — REDACTED.renderExecutors has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 14, ternaries 10 (14 pts), if/else 4 (7 pts), loops 1 (nesting depth added 7). Of this number, 27 points are the body's own statements and 9 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 · REDACTED.renderGoalPreview (cognitive 36) · ×1
  • REDACTED.renderGoalPreview (cognitive 36) REDACTED:928 — REDACTED.renderGoalPreview has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 11, loops 4 (8 pts), ternaries 2 (4 pts) (nesting depth added 10). Of this number, 34 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 · PreparedInvocation · ×1
  • PreparedInvocation::prepare (cognitive 35) src/tool_runtime/kernel/recording.rs:34 — PreparedInvocation::prepare has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (28 pts), match/switch 3 (5 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 · ProjectsPanel.ProjectsPanel (cognitive 35) · ×1
  • ProjectsPanel.ProjectsPanel (cognitive 35) apps/desktop/src/features/projects/ProjectsPanel.tsx:16 — ProjectsPanel.ProjectsPanel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 32 (51 pts), boolean chains 39, ternaries 11 (16 pts), error handling 5 (8 pts), loops 4 (8 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. This shape REPEATS in the file: one other method here (ProjectsPanel.ProjectsPanel::unregisterSelected) 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 · mcp_spreadsheet_app.html.load (cognitive 35) · ×1
  • mcp_spreadsheet_app.html.load (cognitive 35) src/mcp_spreadsheet_app.html:753 — mcp_spreadsheet_app.html.load has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (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 · PersistentShellManager · ×1
  • PersistentShellManager::exec (cognitive 34) crates/webcodex-persistent-shell/src/execution.rs:6 — PersistentShellManager::exec has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (30 pts), match/switch 3, 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 · l.updateMode (cognitive 34) · ×1
  • l.updateMode (cognitive 34) src/mcp_pdf_app.html:647 — l.updateMode has cognitive complexity 34 (threshold 15). Drivers by points: loops 6 (15 pts), boolean chains 9, if/else 4 (7 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · REDACTED.renderValidationRun (cognitive 34) · ×1
  • REDACTED.renderValidationRun (cognitive 34) REDACTED:162 — REDACTED.renderValidationRun has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (18 pts), if/else 9 (13 pts), boolean chains 3 (nesting depth added 8). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 179). 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 · OAuth2Verifier · ×1
  • OAuth2Verifier::verify_for_ingress_sync (cognitive 33) src/auth/tokens.rs:223 — OAuth2Verifier::verify_for_ingress_sync has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 4, match/switch 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 · CodingAgentsPanel.CodingAgentsPanel (cognitive 33) · ×1
  • CodingAgentsPanel.CodingAgentsPanel (cognitive 33) apps/desktop/src/features/extensions/CodingAgentsPanel.tsx:13 — CodingAgentsPanel.CodingAgentsPanel has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 20, if/else 6, ternaries 4 (5 pts), error handling 2 (nesting depth added 1). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 58, restart, remove, …). 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 · ProjectRows.ProjectRow (cognitive 33) · ×1
  • ProjectRows.ProjectRow (cognitive 33) apps/desktop/src/features/projects/ProjectRows.tsx:24 — ProjectRows.ProjectRow has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 10, if/else 8 (10 pts) (nesting depth added 5). Of this number, 21 points are the body's own statements and 12 belong to 5 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 · Config · ×1
  • Config::parse (cognitive 32) crates/webcodex-openai-tunnel/src/bin/webcodex-tunnel/config.rs:70 — Config::parse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (22 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · Adapter.event (cognitive 32) · ×1
  • Adapter.event (cognitive 32) integrations/model_gateway/adapter.py:237 — Adapter.event has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.optionsIn (cognitive 32) · ×1
  • common.optionsIn (cognitive 32) crates/webcodex-browser/src/cdp/widgets/common.js:198 — common.optionsIn has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 16). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 201). 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 · install.extractTarGz (cognitive 32) · ×1
  • install.extractTarGz (cognitive 32) REDACTED:646 — install.extractTarGz has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 7, error handling 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 · (anonymous) (cognitive 32) · ×1
  • (anonymous) (cognitive 32) extensions/browser-bridge/worker.js:79 — (anonymous) has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, error handling 1 (4 pts), loops 2 (4 pts), other 2 (nesting depth added 7). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 83, 93, 94, …). 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 · Knowledge.search (cognitive 31) · ×1
  • Knowledge.search (cognitive 31) plugins/project-knowledge/knowledge.py:695 — Knowledge.search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (6 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · choice-controls.planChoiceGroup (cognitive 31) · ×1
  • choice-controls.planChoiceGroup (cognitive 31) plugins/campus-application/src/choice-controls.ts:18 — choice-controls.planChoiceGroup has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 6 (9 pts), boolean chains 7 (nesting depth added 13). Of this number, 27 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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 · us.setupStorage (cognitive 31) · ×1
  • us.setupStorage (cognitive 31) src/mcp_pdf_app.html:646 — us.setupStorage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 3 (9 pts), boolean chains 5, loops 1 (3 pts), match/switch 1 (nesting depth added 15). Of this number, 26 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · l.beginGroup (cognitive 31) · ×1
  • l.beginGroup (cognitive 31) src/mcp_pdf_app.html:690 — l.beginGroup has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 6 (10 pts), ternaries 3 (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 · worker.chrome.runtime.onMessage.addListener() (cognitive 30) · ×1
  • worker.chrome.runtime.onMessage.addListener() (cognitive 30) extensions/browser-bridge/worker.js:79 — worker.chrome.runtime.onMessage.addListener() has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, error handling 1 (4 pts), loops 2 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 3 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 83, 93). 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 · AddDevice.DeviceInvitationDialog (cognitive 29) · ×1
  • AddDevice.DeviceInvitationDialog (cognitive 29) apps/desktop/src/features/projects/AddDevice.tsx:33 — AddDevice.DeviceInvitationDialog has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8, ternaries 2 (4 pts), error handling 2 (nesting depth added 4). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (create, copy, validCode, …). 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 · location-values.resolveChoicePath (cognitive 29) · ×1
  • location-values.resolveChoicePath (cognitive 29) plugins/campus-application/src/location-values.ts:9 — location-values.resolveChoicePath has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (9 pts), boolean chains 8 (nesting depth added 9). Of this number, 28 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 · REDACTED.renderToolResult (cognitive 29) · ×1
  • REDACTED.renderToolResult (cognitive 29) REDACTED:68 — REDACTED.renderToolResult has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, ternaries 9 (10 pts), if/else 4 (nesting depth added 1). 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, 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 · REDACTED.renderAvailability (cognitive 29) · ×1
  • REDACTED.renderAvailability (cognitive 29) REDACTED:597 — REDACTED.renderAvailability has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 4 (8 pts), loops 3 (5 pts), boolean chains 4 (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 · RemoteShellTransport · ×1
  • RemoteShellTransport::wait_for_completion (cognitive 28) crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:222 — RemoteShellTransport::wait_for_completion has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · l.paintChar (cognitive 28) · ×1
  • l.paintChar (cognitive 28) src/mcp_pdf_app.html:690 — l.paintChar has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (14 pts) (nesting depth added 6). 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 · REDACTED.loadDirectory (cognitive 28) · ×1
  • REDACTED.loadDirectory (cognitive 28) REDACTED:834 — REDACTED.loadDirectory has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · us.setAttributes (cognitive 27) · ×1
  • us.setAttributes (cognitive 27) src/mcp_pdf_app.html:646 — us.setAttributes has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (7 pts), loops 2 (6 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · l.#l (cognitive 27) · ×1
  • l.#l (cognitive 27) src/mcp_pdf_app.html:692 — l.#l has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (9 pts), boolean chains 8 (nesting depth added 7). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 692, 692). 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 · l.editorDivPaste (cognitive 27) · ×1
  • l.editorDivPaste (cognitive 27) src/mcp_pdf_app.html:693 — l.editorDivPaste has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Rt.#l (cognitive 27) · ×1
  • Rt.#l (cognitive 27) src/mcp_pdf_app.html:700 — Rt.#l has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 2 (10 pts), boolean chains 2 (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CloudflareOwner · ×1
  • CloudflareOwner::run (cognitive 26) src/cloudflare_ingress.rs:1241 — CloudflareOwner::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 pts), boolean chains 3, 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 · ExtensionPathsEditor.ExtensionPathsEditor (cognitive 26) · ×1
  • ExtensionPathsEditor.ExtensionPathsEditor (cognitive 26) apps/desktop/src/features/extensions/ExtensionPathsEditor.tsx:14 — ExtensionPathsEditor.ExtensionPathsEditor has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13, boolean chains 9, if/else 4. Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (browse, a function literal at line 54, a function literal at line 48, …). 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 · RuntimeConsolePanel.RuntimeConsolePanel (cognitive 26) · ×1
  • RuntimeConsolePanel.RuntimeConsolePanel (cognitive 26) apps/desktop/src/features/console/RuntimeConsolePanel.tsx:13 — RuntimeConsolePanel.RuntimeConsolePanel has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 18, if/else 6 (7 pts), error handling 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 10 belong to 4 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.
D2 · Cognitive Complexity · REDACTED.reconcile (cognitive 26) · ×1
  • REDACTED.reconcile (cognitive 26) REDACTED:837 — REDACTED.reconcile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, error handling 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 · Ir.splitBySection (cognitive 26) · ×1
  • Ir.splitBySection (cognitive 26) REDACTED:1463 — Ir.splitBySection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 6, loops 2, ternaries 1 (2 pts) (nesting depth added 12). 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 · REDACTED.renderGitChanges (cognitive 26) · ×1
  • REDACTED.renderGitChanges (cognitive 26) REDACTED:466 — REDACTED.renderGitChanges has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, ternaries 4 (5 pts) (nesting depth added 3). Of this number, 21 points are the body's own statements and 5 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 · REDACTED.envelope (cognitive 26) · ×1
  • REDACTED.envelope (cognitive 26) REDACTED:301 — REDACTED.envelope has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 2 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 · InputChannel · ×1
  • InputChannel::with_writer (cognitive 25) crates/webcodex-runner/src/webcodex_runner/job_manager/input.rs:31 — InputChannel::with_writer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (4 pts), match/switch 1 (3 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 · ProjectTextEditInput · ×1
  • ProjectTextEditInput::validate (cognitive 25) crates/webcodex-tool-contracts/src/tool_inputs.rs:171 — ProjectTextEditInput::validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 8, 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 · install.startNetworkRequest (cognitive 25) · ×1
  • install.startNetworkRequest (cognitive 25) REDACTED:291 — install.startNetworkRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 5 (7 pts), boolean chains 4 (nesting depth added 3). Of this number, 19 points are the body's own statements and 6 belong to 2 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.
D2 · Cognitive Complexity · resume.resolveResumeValue (cognitive 25) · ×1
  • resume.resolveResumeValue (cognitive 25) plugins/campus-application/src/resume.ts:467 — resume.resolveResumeValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, 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 · Vn.getPattern (cognitive 25) · ×1
  • Vn.getPattern (cognitive 25) src/mcp_pdf_app.html:690 — Vn.getPattern has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 11). 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 · REDACTED.updateControls (cognitive 25) · ×1
  • REDACTED.updateControls (cognitive 25) REDACTED:364 — REDACTED.updateControls has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 24, loops 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 · REDACTED.saveGoal (cognitive 25) · ×1
  • REDACTED.saveGoal (cognitive 25) REDACTED:798 — REDACTED.saveGoal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, ternaries 2, 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.
D2 · Cognitive Complexity · assignPart (cognitive 25) · ×1
  • assignPart (cognitive 25) crates/webcodex-browser/src/cdp/widgets/date.js:50 — assignPart has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 23 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RetainedJobReceipt · ×1
  • RetainedJobReceipt::validate (cognitive 24) crates/webcodex-core/src/runner_job_receipt.rs:36 — RetainedJobReceipt::validate has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (8 pts), loops 1, match/switch 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 · ShellProcess · ×1
  • ShellProcess::wait_for_completion (cognitive 24) crates/webcodex-persistent-shell/src/unix.rs:71 — ShellProcess::wait_for_completion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 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 · WindowsShellProcess · ×1
  • WindowsShellProcess::wait_for_completion (cognitive 24) crates/webcodex-persistent-shell/src/windows.rs:155 — WindowsShellProcess::wait_for_completion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, match/switch 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 · ReceiptRegistryGuard · ×1
  • ReceiptRegistryGuard::drop (cognitive 24) crates/webcodex-runner-registry/src/receipts.rs:163 — ReceiptRegistryGuard::drop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostRecordResponse · ×1
  • PostRecordResponse::finish (cognitive 24) src/tool_runtime/kernel/postprocess.rs:39 — PostRecordResponse::finish has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4 (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 · CanonicalOrchestrationHost · ×1
  • CanonicalOrchestrationHost::invoke_tool (cognitive 24) src/tool_runtime/orchestration_host.rs:756 — CanonicalOrchestrationHost::invoke_tool has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · presentation.desktopErrorPresentation (cognitive 24) · ×1
  • presentation.desktopErrorPresentation (cognitive 24) apps/desktop/src/i18n/presentation.ts:164 — presentation.desktopErrorPresentation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 3, 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 · REDACTED.toolResultShape (cognitive 24) · ×1
  • REDACTED.toolResultShape (cognitive 24) REDACTED:214 — REDACTED.toolResultShape has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, error handling 1 (3 pts), loops 1 (2 pts), ternaries 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 · us.render (cognitive 24) · ×1
  • us.render (cognitive 24) src/mcp_pdf_app.html:646 — us.render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · l.endGroup (cognitive 24) · ×1
  • l.endGroup (cognitive 24) src/mcp_pdf_app.html:690 — l.endGroup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, ternaries 1 (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 · fi.extractPages (cognitive 24) · ×1
  • fi.extractPages (cognitive 24) src/mcp_pdf_app.html:690 — fi.extractPages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 12). 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 · l.render (cognitive 24) · ×1
  • l.render (cognitive 24) src/mcp_pdf_app.html:692 — l.render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, 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 · Ke.#c (cognitive 24) · ×1
  • Ke.#c (cognitive 24) src/mcp_pdf_app.html:700 — Ke.#c has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). 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 · ServiceCommand · ×1
  • ServiceCommand::run (cognitive 23) crates/webcodex-cli/src/environment/commands.rs:254 — ServiceCommand::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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 · OrchestrationEffectAccumulator · ×1
  • OrchestrationEffectAccumulator::finish (cognitive 23) src/tool_runtime/orchestration_host.rs:364 — OrchestrationEffectAccumulator::finish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 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 · external_observation_hook.deliver (cognitive 23) · ×1
  • external_observation_hook.deliver (cognitive 23) integrations/codex/external_observation_hook.py:144 — external_observation_hook.deliver has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodingAgentEditor.CodingAgentEditor (cognitive 23) · ×1
  • CodingAgentEditor.CodingAgentEditor (cognitive 23) apps/desktop/src/features/extensions/CodingAgentEditor.tsx:17 — CodingAgentEditor.CodingAgentEditor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 3 (4 pts), error handling 3, loops 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (submit, a function literal at line 52, chooseExecutable, …). 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 · WindowActivityDetail.WindowActivityDetail (cognitive 23) · ×1
  • WindowActivityDetail.WindowActivityDetail (cognitive 23) apps/desktop/src/features/activity/WindowActivityDetail.tsx:12 — WindowActivityDetail.WindowActivityDetail has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 16, if/else 4 (5 pts), error handling 1, ternaries 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 8 belong to 5 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.
D2 · Cognitive Complexity · App.DesktopApp (cognitive 23) · ×1
  • App.DesktopApp (cognitive 23) apps/desktop/src/App.tsx:34 — App.DesktopApp has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 20, ternaries 1 (2 pts), if/else 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 · config.loadConfig (cognitive 23) · ×1
  • config.loadConfig (cognitive 23) plugins/agent-browser/src/config.ts:24 — config.loadConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, 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 · upload-source.resolveUploadLocation (cognitive 23) · ×1
  • upload-source.resolveUploadLocation (cognitive 23) plugins/campus-application/src/upload-source.ts:10 — upload-source.resolveUploadLocation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, ternaries 3 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · l.#c (cognitive 23) · ×1
  • l.#c (cognitive 23) src/mcp_pdf_app.html:692 — l.#c has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 5 (8 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · REDACTED.addGitFile (cognitive 23) · ×1
  • REDACTED.addGitFile (cognitive 23) REDACTED:269 — REDACTED.addGitFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · REDACTED.appendJobDetails (cognitive 23) · ×1
  • REDACTED.appendJobDetails (cognitive 23) REDACTED:669 — REDACTED.appendJobDetails has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 16 (20 pts), boolean chains 2, if/else 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · REDACTED.loadOverview (cognitive 23) · ×1
  • REDACTED.loadOverview (cognitive 23) REDACTED:462 — REDACTED.loadOverview has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 7, if/else 5 (6 pts), error handling 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 · chooseYear (cognitive 23) · ×1
  • chooseYear (cognitive 23) crates/webcodex-browser/src/cdp/widgets/date.js:114 — chooseYear has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 9). Of this number, 18 points are the body's own statements and 5 belong to 9 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 · RunnerConfigOperationResponse · ×1
  • RunnerConfigOperationResponse::validate (cognitive 22) crates/webcodex-core/src/runner_protocol.rs:1370 — RunnerConfigOperationResponse::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, match/switch 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 · UnifiedInstallerManifest · ×1
  • UnifiedInstallerManifest::parse_value (cognitive 22) crates/webcodex-environment/src/unified_update.rs:451 — UnifiedInstallerManifest::parse_value has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (6 pts), boolean chains 4 (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 · Receipts · ×1
  • Receipts::open_inner (cognitive 22) crates/webcodex-openai-tunnel/src/run_receipts.rs:46 — Receipts::open_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApplyFileChangeInput · ×1
  • ApplyFileChangeInput::deserialize (cognitive 22) crates/webcodex-tool-contracts/src/tool_inputs.rs:331 — ApplyFileChangeInput::deserialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, 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 · CloudflareControl · ×1
  • CloudflareControl::provision_oauth (cognitive 22) src/cloudflare_ingress.rs:883 — CloudflareControl::provision_oauth has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 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 · read_handoff.read_handoff (cognitive 22) · ×1
  • read_handoff.read_handoff (cognitive 22) integrations/codex/read_handoff.py:163 — read_handoff.read_handoff has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 8, 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 · SshResourcesPanel.SshResourcesPanel · ×1
  • SshResourcesPanel.SshResourcesPanel::observe (cognitive 22) apps/desktop/src/features/extensions/SshResourcesPanel.tsx:44 — SshResourcesPanel.SshResourcesPanel::observe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (5 pts), boolean chains 3, error handling 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 · McpProvidersPanel.McpProvidersPanel (cognitive 22) · ×1
  • McpProvidersPanel.McpProvidersPanel (cognitive 22) apps/desktop/src/features/extensions/McpProvidersPanel.tsx:10 — McpProvidersPanel.McpProvidersPanel has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 16, if/else 3, error handling 2, ternaries 1. Of this number, 13 points are the body's own statements and 9 belong to 3 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.
D2 · Cognitive Complexity · UpdateComponents.UpdateComponents (cognitive 22) · ×1
  • UpdateComponents.UpdateComponents (cognitive 22) apps/desktop/src/features/settings/UpdateComponents.tsx:6 — UpdateComponents.UpdateComponents has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (18 pts), boolean chains 4 (nesting depth added 9). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 11, build). 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 · wrapper.captureProtectedNpmEnvironment (cognitive 22) · ×1
  • wrapper.captureProtectedNpmEnvironment (cognitive 22) npm/webcodex/bin/wrapper.js:76 — wrapper.captureProtectedNpmEnvironment has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context.parseCargoMetadata (cognitive 22) · ×1
  • context.parseCargoMetadata (cognitive 22) plugins/repo-context/src/context.ts:307 — context.parseCargoMetadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · l.commentButtonPosition (cognitive 22) · ×1
  • l.commentButtonPosition (cognitive 22) src/mcp_pdf_app.html:690 — l.commentButtonPosition has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (8 pts), loops 3 (7 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · REDACTED.preview (cognitive 22) · ×1
  • REDACTED.preview (cognitive 22) REDACTED:908 — REDACTED.preview has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), ternaries 2 (3 pts), error handling 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 · REDACTED.applyLaunch (cognitive 22) · ×1
  • REDACTED.applyLaunch (cognitive 22) REDACTED:1052 — REDACTED.applyLaunch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, ternaries 1 (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 · MachineEventSender · ×1
  • MachineEventSender::send (cognitive 21) apps/desktop/src-tauri/src/process/supervisor.rs:170 — MachineEventSender::send has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (21 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 · webcodex_computer_control · ×1
  • webcodex_computer_control::windows::serve (cognitive 21) crates/webcodex-computer-control/src/windows.rs:248 — webcodex_computer_control::windows::serve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 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 · ProjectInstructionsSnapshot · ×1
  • ProjectInstructionsSnapshot::retain_unavailable_scopes (cognitive 21) crates/webcodex-core/src/project_instructions.rs:278 — ProjectInstructionsSnapshot::retain_unavailable_scopes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, loops 1 (2 pts), match/switch 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 · McpGatewayManager · ×1
  • McpGatewayManager::handle (cognitive 21) crates/webcodex-runner/src/webcodex_runner/mcp_gateway.rs:267 — McpGatewayManager::handle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 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 · platform_security._windows_private_acl (cognitive 21) · ×1
  • platform_security._windows_private_acl (cognitive 21) integrations/codex/platform_security.py:202 — platform_security._windows_private_acl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · domain.resolveAuthorizedTarget (cognitive 21) · ×1
  • domain.resolveAuthorizedTarget (cognitive 21) plugins/safe-delete/domain.ts:181 — domain.resolveAuthorizedTarget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 4 (5 pts), boolean chains 2, ternaries 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 · TrayProjection · ×1
  • TrayProjection::from_snapshot (cognitive 20) apps/desktop/src-tauri/src/tray.rs:97 — TrayProjection::from_snapshot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProjectValidationRequest · ×1
  • ProjectValidationRequest::validate (cognitive 20) crates/webcodex-core/src/project_validation.rs:116 — ProjectValidationRequest::validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RunnerSkillRequest · ×1
  • RunnerSkillRequest::validate (cognitive 20) crates/webcodex-core/src/runner_skill.rs:262 — RunnerSkillRequest::validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RunFence · ×1
  • RunFence::acquire_restartable (cognitive 20) crates/webcodex-openai-tunnel/src/run_fence.rs:321 — RunFence::acquire_restartable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientIngressGate · ×1
  • ClientIngressGate::handle (cognitive 20) src/public_ingress_auth.rs:105 — ClientIngressGate::handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts) (nesting depth added 12). 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 · SessionShellRegistry · ×1
  • SessionShellRegistry::apply_result (cognitive 20) src/tool_runtime/session_shell.rs:205 — SessionShellRegistry::apply_result has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 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 · BrowserRuntimeStatus.BrowserRuntimeStatus (cognitive 20) · ×1
  • BrowserRuntimeStatus.BrowserRuntimeStatus (cognitive 20) apps/desktop/src/features/dashboard/BrowserRuntimeStatus.tsx:21 — BrowserRuntimeStatus.BrowserRuntimeStatus has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 6, if/else 5 (nesting depth added 4). Of this number, 12 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalServicesPanel.LocalServiceControls (cognitive 20) · ×1
  • LocalServicesPanel.LocalServiceControls (cognitive 20) apps/desktop/src/features/settings/LocalServicesPanel.tsx:17 — LocalServicesPanel.LocalServiceControls has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), ternaries 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (act, a function literal at line 36, a function literal at line 36). 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 · l._abortOperatorList (cognitive 20) · ×1
  • l._abortOperatorList (cognitive 20) src/mcp_pdf_app.html:690 — l._abortOperatorList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (3 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 · REDACTED.loadList (cognitive 20) · ×1
  • REDACTED.loadList (cognitive 20) REDACTED:868 — REDACTED.loadList has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 2, error handling 1, 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 · chooseMonth (cognitive 20) · ×1
  • chooseMonth (cognitive 20) crates/webcodex-browser/src/cdp/widgets/date.js:147 — chooseMonth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 172, a function literal at line 153, a function literal at line 158, …). 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 · ProcessSupervisor · ×1
  • ProcessSupervisor::stop_until (cognitive 19) apps/desktop/src-tauri/src/process/supervisor.rs:471 — ProcessSupervisor::stop_until has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 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 · Overview · ×1
  • Overview::key (cognitive 19) crates/webcodex-cli/src/webcodex_cli/controller_tui.rs:460 — Overview::key has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, 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 · ServerStatusCache · ×1
  • ServerStatusCache::wait_for_quiescent_ok (cognitive 19) crates/webcodex-lsp/src/supervisor.rs:1753 — ServerStatusCache::wait_for_quiescent_ok has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobAttentionCursor · ×1
  • JobAttentionCursor::project_result (cognitive 19) src/tool_runtime/job_attention.rs:171 — JobAttentionCursor::project_result has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Adapter.document (cognitive 19) · ×1
  • Adapter.document (cognitive 19) integrations/model_gateway/adapter.py:281 — Adapter.document has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (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 · PowerShellInstallGuidance.PowerShellGuidanceControls (cognitive 19) · ×1
  • PowerShellInstallGuidance.PowerShellGuidanceControls (cognitive 19) apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:16 — PowerShellInstallGuidance.PowerShellGuidanceControls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 3, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (recheck, openGuide). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CloudflareConnectionCard.OAuthHandoff (cognitive 19) · ×1
  • CloudflareConnectionCard.OAuthHandoff (cognitive 19) apps/desktop/src/features/connection/CloudflareConnectionCard.tsx:20 — CloudflareConnectionCard.OAuthHandoff has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (5 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 6 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 · RuntimePanel.BinaryFacts (cognitive 19) · ×1
  • RuntimePanel.BinaryFacts (cognitive 19) apps/desktop/src/features/settings/RuntimePanel.tsx:144 — RuntimePanel.BinaryFacts has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 16, ternaries 2 (3 pts) (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 · TunnelConfigDiagnostics.TunnelConfigDiagnostics (cognitive 19) · ×1
  • TunnelConfigDiagnostics.TunnelConfigDiagnostics (cognitive 19) apps/desktop/src/features/connection/TunnelConfigDiagnostics.tsx:8 — TunnelConfigDiagnostics.TunnelConfigDiagnostics has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (6 pts), error handling 2 (3 pts), if/else 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 6 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 · set_value.default (cognitive 19) · ×1
  • set_value.default (cognitive 19) crates/webcodex-browser/src/cdp/set_value.js:1 — set_value.default has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · fill-batch.operation (cognitive 19) · ×1
  • fill-batch.operation (cognitive 19) plugins/campus-application/src/fill-batch.ts:76 — fill-batch.operation has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 8. 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 · Dr.parseDrawingWrapper (cognitive 19) · ×1
  • Dr.parseDrawingWrapper (cognitive 19) REDACTED:1463 — Dr.parseDrawingWrapper has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 1 (4 pts), if/else 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). 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 · REDACTED.validActivity (cognitive 19) · ×1
  • REDACTED.validActivity (cognitive 19) REDACTED:144 — REDACTED.validActivity has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · l.getScaleForStroking (cognitive 19) · ×1
  • l.getScaleForStroking (cognitive 19) src/mcp_pdf_app.html:690 — l.getScaleForStroking has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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 · REDACTED.openGoal (cognitive 19) · ×1
  • REDACTED.openGoal (cognitive 19) REDACTED:788 — REDACTED.openGoal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, 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 · REDACTED.useSelectedContext (cognitive 19) · ×1
  • REDACTED.useSelectedContext (cognitive 19) REDACTED:1013 — REDACTED.useSelectedContext has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 6, ternaries 2. Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1017, 1033). 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 · (anonymous) (cognitive 19) · ×1
  • (anonymous) (cognitive 19) crates/webcodex-browser/src/cdp/set_value.js:1 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Controller.Run (cognitive 18) · ×1
  • Controller.Run (cognitive 18) crates/webcodex-persistent-shell/src/windows_controller.cs:95 — Controller.Run has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · FrameReader · ×1
  • FrameReader::poll (cognitive 18) crates/webcodex-browser/src/bridge/protocol.rs:71 — FrameReader::poll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 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 · SessionExecutionContext · ×1
  • SessionExecutionContext::validated (cognitive 18) crates/webcodex-core/src/workflow_session_contract.rs:354 — SessionExecutionContext::validated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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 · ServerInstance · ×1
  • ServerInstance::shutdown_until (cognitive 18) crates/webcodex-lsp/src/supervisor.rs:2423 — ServerInstance::shutdown_until has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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 · DurableRunStore · ×1
  • DurableRunStore::scan (cognitive 18) crates/webcodex-runner/src/webcodex_runner/coding_agent/store.rs:247 — DurableRunStore::scan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (5 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 · ShellExecutionContext · ×1
  • ShellExecutionContext::run_internal_posix_script_impl (cognitive 18) crates/webcodex-runner/src/webcodex_runner/shell/internal.rs:12 — ShellExecutionContext::run_internal_posix_script_impl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 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 · Knowledge.source (cognitive 18) · ×1
  • Knowledge.source (cognitive 18) plugins/project-knowledge/knowledge.py:288 — Knowledge.source has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 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 · McpProviderEditor.McpProviderEditor (cognitive 18) · ×1
  • McpProviderEditor.McpProviderEditor (cognitive 18) apps/desktop/src/features/extensions/McpProviderEditor.tsx:10 — McpProviderEditor.McpProviderEditor has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 4, if/else 3, error handling 2. Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (submit, a function literal at line 28, a function literal at line 49, …). 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 · ExtensionsPanel.ExtensionsPanel (cognitive 18) · ×1
  • ExtensionsPanel.ExtensionsPanel (cognitive 18) apps/desktop/src/features/extensions/ExtensionsPanel.tsx:20 — ExtensionsPanel.ExtensionsPanel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, ternaries 2, if/else 1. Of this number, 15 points are the body's own statements and 3 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.
D2 · Cognitive Complexity · useRuntimeUpdates.useRuntimeUpdates.refreshLocal (cognitive 18) · ×1
  • useRuntimeUpdates.useRuntimeUpdates.refreshLocal (cognitive 18) apps/desktop/src/hooks/useRuntimeUpdates.ts:35 — useRuntimeUpdates.useRuntimeUpdates.refreshLocal has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (5 pts), ternaries 3 (5 pts), error handling 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddLocalProject.AddLocalProject (cognitive 18) · ×1
  • AddLocalProject.AddLocalProject (cognitive 18) apps/desktop/src/features/projects/AddLocalProject.tsx:9 — AddLocalProject.AddLocalProject has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (7 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (run, a function literal at line 38, run::isCurrent, …). 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 · wrapper.resolveWindowsNpmCli (cognitive 18) · ×1
  • wrapper.resolveWindowsNpmCli (cognitive 18) npm/webcodex/bin/wrapper.js:41 — wrapper.resolveWindowsNpmCli has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, 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 · REDACTED.maybeStartBinding (cognitive 18) · ×1
  • REDACTED.maybeStartBinding (cognitive 18) REDACTED:942 — REDACTED.maybeStartBinding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, error handling 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 · Dr.parseDefaultProperties (cognitive 18) · ×1
  • Dr.parseDefaultProperties (cognitive 18) REDACTED:1463 — Dr.parseDefaultProperties has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 2 (6 pts), match/switch 1 (3 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 · l.#ot (cognitive 18) · ×1
  • l.#ot (cognitive 18) src/mcp_pdf_app.html:647 — l.#ot has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 1 (2 pts) (nesting depth added 2). Of this number, 15 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.
D2 · Cognitive Complexity · ps.#P (cognitive 18) · ×1
  • ps.#P (cognitive 18) src/mcp_pdf_app.html:647 — ps.#P has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 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 · Ge.editorStats (cognitive 18) · ×1
  • Ge.editorStats (cognitive 18) src/mcp_pdf_app.html:647 — Ge.editorStats has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 3 (4 pts), ternaries 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 · l._createMaskCanvas (cognitive 18) · ×1
  • l._createMaskCanvas (cognitive 18) src/mcp_pdf_app.html:690 — l._createMaskCanvas has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 3 (4 pts), 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 · command (cognitive 18) · ×1
  • command (cognitive 18) extensions/browser-bridge/worker.js:226 — command has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, error handling 2, other 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 · Sse · ×1
  • Sse::push (cognitive 17) crates/webcodex-openai-tunnel/src/mcp_http.rs:265 — Sse::push has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 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 · PatVerifier · ×1
  • PatVerifier::verify_sync (cognitive 17) src/auth/tokens.rs:70 — PatVerifier::verify_sync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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 · ModelErgonomicsCompletion · ×1
  • ModelErgonomicsCompletion::record_from_parts (cognitive 17) src/tool_runtime/model_ergonomics_telemetry.rs:434 — ModelErgonomicsCompletion::record_from_parts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · experience_proposals.validate_candidate (cognitive 17) · ×1
  • experience_proposals.validate_candidate (cognitive 17) integrations/codex/experience_proposals.py:142 — experience_proposals.validate_candidate has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, if/else 2, ternaries 1 (2 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · RunnerCapabilityAuthorization.AuthorizationFlow · ×1
  • RunnerCapabilityAuthorization.AuthorizationFlow::authorize (cognitive 17) apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:43 — RunnerCapabilityAuthorization.AuthorizationFlow::authorize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (3 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, 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 · wrapper.runNative (cognitive 17) · ×1
  • wrapper.runNative (cognitive 17) npm/webcodex/bin/wrapper.js:186 — wrapper.runNative has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3, loops 2 (nesting depth added 1). Of this number, 12 points are the body's own statements and 5 belong to 3 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 · fill-batch.createFillBatch (cognitive 17) · ×1
  • fill-batch.createFillBatch (cognitive 17) plugins/campus-application/src/fill-batch.ts:128 — fill-batch.createFillBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · plugin.supportFor (cognitive 17) · ×1
  • plugin.supportFor (cognitive 17) plugins/campus-application/src/plugin.ts:165 — plugin.supportFor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · context.mapAffectedPackages (cognitive 17) · ×1
  • context.mapAffectedPackages (cognitive 17) plugins/repo-context/src/context.ts:375 — context.mapAffectedPackages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 7). 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 · domain.moveToFreedesktopTrash (cognitive 17) · ×1
  • domain.moveToFreedesktopTrash (cognitive 17) plugins/safe-delete/domain.ts:394 — domain.moveToFreedesktopTrash has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, error handling 4 (5 pts), if/else 4 (5 pts), loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · REDACTED.bindSemanticFailure (cognitive 17) · ×1
  • REDACTED.bindSemanticFailure (cognitive 17) REDACTED:238 — REDACTED.bindSemanticFailure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · REDACTED.dispatchWake (cognitive 17) · ×1
  • REDACTED.dispatchWake (cognitive 17) REDACTED:728 — REDACTED.dispatchWake has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (5 pts), ternaries 2 (5 pts), error handling 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 · l._createContainer (cognitive 17) · ×1
  • l._createContainer (cognitive 17) src/mcp_pdf_app.html:690 — l._createContainer has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (4 pts), match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · l._getElementsByName (cognitive 17) · ×1
  • l._getElementsByName (cognitive 17) src/mcp_pdf_app.html:690 — l._getElementsByName has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (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 · REDACTED.jobState (cognitive 17) · ×1
  • REDACTED.jobState (cognitive 17) REDACTED:631 — REDACTED.jobState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · REDACTED.loadProjects (cognitive 17) · ×1
  • REDACTED.loadProjects (cognitive 17) REDACTED:424 — REDACTED.loadProjects has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), ternaries 2, error handling 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 · REDACTED.addReferenceNow (cognitive 17) · ×1
  • REDACTED.addReferenceNow (cognitive 17) REDACTED:996 — REDACTED.addReferenceNow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, error handling 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 · REDACTED.acceptResult (cognitive 17) · ×1
  • REDACTED.acceptResult (cognitive 17) REDACTED:1063 — REDACTED.acceptResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (2 pts), error handling 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 · ProjectFormatRequest · ×1
  • ProjectFormatRequest::validate (cognitive 16) crates/webcodex-core/src/project_format.rs:55 — ProjectFormatRequest::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, 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 · GoalPlan · ×1
  • GoalPlan::checkpoint (cognitive 16) crates/webcodex-store/src/goal_plan.rs:191 — GoalPlan::checkpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · read_handoff._valid_goal_detail (cognitive 16) · ×1
  • read_handoff._valid_goal_detail (cognitive 16) integrations/codex/read_handoff.py:66 — read_handoff._valid_goal_detail has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · plugin.serve (cognitive 16) · ×1
  • plugin.serve (cognitive 16) plugins/project-knowledge/plugin.py:162 — plugin.serve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuickShareSetup.QuickShareSetup (cognitive 16) · ×1
  • QuickShareSetup.QuickShareSetup (cognitive 16) apps/desktop/src/features/onboarding/QuickShareSetup.tsx:10 — QuickShareSetup.QuickShareSetup has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 4, if/else 3, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (chooseProject, run, a function literal at line 48). 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 · ContinuationFacts.ContinuationFacts (cognitive 16) · ×1
  • ContinuationFacts.ContinuationFacts (cognitive 16) apps/desktop/src/features/activity/ContinuationFacts.tsx:5 — ContinuationFacts.ContinuationFacts has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 3, if/else 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 · WorkflowSessionDetail.WorkflowSessionDetail (cognitive 16) · ×1
  • WorkflowSessionDetail.WorkflowSessionDetail (cognitive 16) apps/desktop/src/features/activity/WorkflowSessionDetail.tsx:33 — WorkflowSessionDetail.WorkflowSessionDetail has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3, ternaries 1. Of this number, 11 points are the body's own statements and 5 belong to 5 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 · common.open (cognitive 16) · ×1
  • common.open (cognitive 16) crates/webcodex-browser/src/cdp/widgets/common.js:173 — common.open has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.consoleText (cognitive 16) · ×1
  • worker.consoleText (cognitive 16) extensions/browser-bridge/worker.js:271 — worker.consoleText has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 2 (4 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 · BrowserController.snapshot (cognitive 16) · ×1
  • BrowserController.snapshot (cognitive 16) plugins/agent-browser/src/browser.ts:175 — BrowserController.snapshot has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 4 (5 pts), ternaries 3 (4 pts), error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · form-cache.resolveFormMappings (cognitive 16) · ×1
  • form-cache.resolveFormMappings (cognitive 16) plugins/campus-application/src/form-cache.ts:579 — form-cache.resolveFormMappings has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 3 (6 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · domain.runTrashBackend (cognitive 16) · ×1
  • domain.runTrashBackend (cognitive 16) plugins/safe-delete/domain.ts:465 — domain.runTrashBackend has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (2 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 · It.#f (cognitive 16) · ×1
  • It.#f (cognitive 16) src/mcp_pdf_app.html:647 — It.#f has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 6). 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 · l.createPatternCanvas (cognitive 16) · ×1
  • l.createPatternCanvas (cognitive 16) src/mcp_pdf_app.html:690 — l.createPatternCanvas has cognitive complexity 16 (threshold 15). Drivers by points: loops 2 (5 pts), boolean chains 4, ternaries 2 (4 pts), if/else 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 · Mi.render (cognitive 16) · ×1
  • Mi.render (cognitive 16) src/mcp_pdf_app.html:691 — Mi.render has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, ternaries 3 (4 pts), if/else 1, loops 1 (nesting depth added 1). Of this number, 10 points are the body's own statements and 6 belong to 5 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: patches.rs, edits.rs, mutations.rs crates/webcodex-runner/src/webcodex_runner/patches.rs — 3 files — `crates/webcodex-runner/src/webcodex_runner/patches.rs`, `crates/webcodex-tool-contracts/src/registry/output_schemas/edits.rs`, `src/tool_runtime/files/mutations.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 25 shared lines) · ×1
  • Near-duplicate member family (5 members, 25 shared lines) crates/webcodex-runner-registry/src/requests.rs:739 — crates/webcodex-runner-registry/src/requests.rs:739-823 | crates/webcodex-runner-registry/src/requests.rs:833-883 | crates/webcodex-runner-registry/src/requests.rs:1180-1231 | crates/webcodex-runner-registry/src/requests.rs:1241-1283 | crates/webcodex-runner-registry/src/requests.rs:1293-1328 — These 5 members are variants of one another: a block of 25 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 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 · Near-duplicate member family (3 members, 37 shared lines) · ×1
  • Near-duplicate member family (3 members, 37 shared lines) src/tool_runtime/skills.rs:1639 — src/tool_runtime/skills.rs:1639-1744 | src/tool_runtime/skills.rs:1755-1834 | src/tool_runtime/skills.rs:1845-1919 — These 3 members are variants of one another: a block of 37 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 family (3 members, 23 shared lines) · ×1
  • Near-duplicate member family (3 members, 23 shared lines) crates/webcodex-runner-registry/src/requests.rs:896 — crates/webcodex-runner-registry/src/requests.rs:896-956 | crates/webcodex-runner-registry/src/requests.rs:969-1098 | crates/webcodex-runner-registry/src/requests.rs:1111-1170 — These 3 members are variants of one another: a block of 23 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 (177 shared lines) · ×1
  • Near-duplicate member pair (177 shared lines) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:269 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:269-536 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:292-544 — These two members are variants of one another: 177 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 · Near-duplicate member pair (104 shared lines) · ×1
  • Near-duplicate member pair (104 shared lines) src/mcp/tools/call/specialized.rs:58 — src/mcp/tools/call/specialized.rs:58-201 | src/mcp/tools/call/specialized.rs:207-420 — These two members are variants of one another: 104 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 · Near-duplicate member pair (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:145 — crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:145-399 | crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:444-610 — These two members are variants of one another: 62 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 · Near-duplicate member pair (59 shared lines) · ×1
  • Near-duplicate member pair (59 shared lines) src/oauth_http/project_share.rs:48 — src/oauth_http/project_share.rs:48-185 | src/oauth_http/shared_key_bridge.rs:434-598 — These two members are variants of one another: 59 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 · Near-duplicate member pair (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:232 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:232-353 | crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:416-583 — These two members are variants of one another: 57 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 · Near-duplicate member pair (50 shared lines) · ×1
  • Near-duplicate member pair (50 shared lines) crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:264 — crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:264-345 | crates/webcodex-runner/src/webcodex_runner/validation/execute.rs:269-357 — These two members are variants of one another: 50 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 · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) src/tool_runtime/runtime_info.rs:448 — src/tool_runtime/runtime_info.rs:448-633 | src/tool_runtime/runtime_info.rs:755-948 — These two members are variants of one another: 44 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 · Near-duplicate member pair (36 shared lines) · ×1
  • Near-duplicate member pair (36 shared lines) crates/webcodex-workflow-session/src/events.rs:1033 — crates/webcodex-workflow-session/src/events.rs:1033-1139 | crates/webcodex-workflow-session/src/events.rs:1197-1279 — These two members are variants of one another: 36 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 · Near-duplicate member pair (34 shared lines) · ×1
  • Near-duplicate member pair (34 shared lines) crates/webcodex-cli/src/webcodex_cli/system.rs:161 — crates/webcodex-cli/src/webcodex_cli/system.rs:161-286 | src/project_entry_windows.rs:179-224 — These two members are variants of one another: 34 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 · Near-duplicate member pair (33 shared lines) · ×1
  • Near-duplicate member pair (33 shared lines) crates/webcodex-browser/src/cdp.rs:2407 — crates/webcodex-browser/src/cdp.rs:2407-2541 | crates/webcodex-browser/src/cdp.rs:2636-2753 — These two members are variants of one another: 33 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 · Near-duplicate member pair (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) src/tool_runtime/changes.rs:954 — src/tool_runtime/changes.rs:954-1040 | src/tool_runtime/changes.rs:1085-1166 — These two members are variants of one another: 30 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 · Near-duplicate member pair (26 shared lines) · ×1
  • Near-duplicate member pair (26 shared lines) crates/webcodex-runner/src/webcodex_runner/artifacts.rs:212 — crates/webcodex-runner/src/webcodex_runner/artifacts.rs:212-268 | crates/webcodex-runner/src/webcodex_runner/patches.rs:71-118 — These two members are variants of one another: 26 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 · Near-duplicate member pair (21 shared lines) · ×1
  • Near-duplicate member pair (21 shared lines) crates/webcodex-environment/src/privilege.rs:33 — crates/webcodex-environment/src/privilege.rs:33-76 | crates/webcodex-environment/src/privilege.rs:95-161 — These two members are variants of one another: 21 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 (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) apps/desktop/src-tauri/src/diagnostics.rs:616 — apps/desktop/src-tauri/src/diagnostics.rs:616-636 | apps/desktop/src-tauri/src/state/persistence.rs:139-167 | crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:491-542 | crates/webcodex-cli/src/webcodex_cli/login.rs:167-179 | src/project_entry_cloudflared.rs:611-646 | src/project_entry_setup.rs:1141-1190 | src/project_entry_setup.rs:1203-1273 — 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 (98 corresponding lines) · ×1
  • Edited copy of a member (98 corresponding lines) crates/webcodex-tool-contracts/src/tool_call/parsing.rs:643 — crates/webcodex-tool-contracts/src/tool_call/parsing.rs:643-740 | crates/webcodex-tool-contracts/src/tool_call/parsing.rs:795-905 — These two members are one piece of code written twice and then edited apart: 98 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (101 corresponding lines) · ×1
  • Edited copy of a member (101 corresponding lines) apps/desktop/src-tauri/src/webcodex/settings/acp.rs:31 — apps/desktop/src-tauri/src/webcodex/settings/acp.rs:31-154 | apps/desktop/src-tauri/src/webcodex/settings/mcp.rs:30-130 — These two members are one piece of code written twice and then edited apart: 101 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (89 corresponding lines) · ×1
  • Edited copy of a member (89 corresponding lines) crates/webcodex-workflow-session/src/store.rs:2578 — crates/webcodex-workflow-session/src/store.rs:2578-2682 | crates/webcodex-workflow-session/src/store/borrowed_projection_tests/reference.rs:8-96 — These two members are one piece of code written twice and then edited apart: 89 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (107 corresponding lines) · ×1
  • Edited copy of a member (107 corresponding lines) src/tool_runtime/skills.rs:2017 — src/tool_runtime/skills.rs:2017-2123 | src/tool_runtime/skills.rs:2135-2247 — These two members are one piece of code written twice and then edited apart: 107 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) crates/webcodex-store/src/activity.rs:125 — crates/webcodex-store/src/activity.rs:125-181 | crates/webcodex-store/src/activity.rs:194-246 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1004 — crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1004-1071 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1079-1139 — 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 (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) src/tool_runtime/computer_tools/screens.rs:61 — src/tool_runtime/computer_tools/screens.rs:61-139 | src/tool_runtime/computer_tools/screens.rs:141-215 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (74 corresponding lines) · ×1
  • Edited copy of a member (74 corresponding lines) crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:200 — crates/webcodex-tool-runtime-contracts/src/tool_audit/result.rs:200-273 | crates/webcodex-workflow-session/src/audit.rs:103-187 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:188 — crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:188-256 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:740-806 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:36 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:36-90 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:112-184 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) crates/webcodex-store/src/window_collaboration.rs:216 — crates/webcodex-store/src/window_collaboration.rs:216-261 | crates/webcodex-store/src/window_collaboration.rs:267-345 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (78 corresponding lines) · ×1
  • Edited copy of a member (78 corresponding lines) crates/webcodex-environment/src/service/linux.rs:269 — crates/webcodex-environment/src/service/linux.rs:269-346 | crates/webcodex-environment/src/service/macos.rs:211-300 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:82 — crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:82-119 | crates/webcodex-runner/src/webcodex_runner/artifacts/inspection.rs:368-414 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) crates/webcodex-environment/src/service/windows.rs:647 — crates/webcodex-environment/src/service/windows.rs:647-700 | crates/webcodex-environment/src/session_service.rs:343-397 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (65 corresponding lines) · ×1
  • Edited copy of a member (65 corresponding lines) src/tool_runtime/skills.rs:394 — src/tool_runtime/skills.rs:394-458 | src/tool_runtime/skills.rs:522-593 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (71 corresponding lines) · ×1
  • Edited copy of a member (71 corresponding lines) crates/webcodex-store/src/agent_continuation_reference.rs:52 — crates/webcodex-store/src/agent_continuation_reference.rs:52-122 | crates/webcodex-store/src/agent_task_attempt_reference.rs:80-167 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) src/tool_runtime/process.rs:190 — src/tool_runtime/process.rs:190-262 | src/tool_runtime/shell.rs:252-315 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) src/tool_runtime/communication.rs:764 — src/tool_runtime/communication.rs:764-807 | src/tool_runtime/communication.rs:950-1000 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:618 — crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:618-678 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:683-734 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 39+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 39+ corresponding lines) src/tool_runtime/docx_document.rs:57 — src/tool_runtime/docx_document.rs:57-99 | src/tool_runtime/pdf_document.rs:49-87 | src/tool_runtime/pdf_document.rs:130-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 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 (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) crates/webcodex-store/src/agent_task/endpoint_loss.rs:15 — crates/webcodex-store/src/agent_task/endpoint_loss.rs:15-85 | crates/webcodex-store/src/agent_wake.rs:2247-2296 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) src/tool_runtime/coding_agent.rs:2100 — src/tool_runtime/coding_agent.rs:2100-2122 | src/tool_runtime/git/diff_hunks.rs:235-256 | src/tool_runtime/git/diff_hunks.rs:264-286 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) apps/desktop/src-tauri/src/state/desktop_core.rs:1290 — apps/desktop/src-tauri/src/state/desktop_core.rs:1290-1351 | apps/desktop/src-tauri/src/state/desktop_core.rs:1359-1414 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 37+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 37+ corresponding lines) crates/webcodex-persistent-shell/src/unix/readers.rs:30 — crates/webcodex-persistent-shell/src/unix/readers.rs:30-67 | crates/webcodex-persistent-shell/src/windows.rs:354-390 | crates/webcodex-runner/src/webcodex_runner/remote_shell.rs:531-568 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 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, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) crates/webcodex-cli/src/lib.rs:1661 — crates/webcodex-cli/src/lib.rs:1661-1693 | crates/webcodex-cli/src/lib.rs:1695-1724 | crates/webcodex-cli/src/lib.rs:1726-1755 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 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, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) crates/webcodex-core/src/runner_skill.rs:438 — crates/webcodex-core/src/runner_skill.rs:438-464 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:1919-1943 | src/tool_runtime/skills.rs:2626-2648 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 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, 24+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 24+ corresponding lines) src/tool_runtime/computer_tools/input_receipts.rs:107 — src/tool_runtime/computer_tools/input_receipts.rs:107-133 | src/tool_runtime/computer_tools/input_receipts.rs:142-165 | src/tool_runtime/computer_tools/input_receipts.rs:172-197 | src/tool_runtime/computer_tools/input_receipts.rs:244-268 | src/tool_runtime/computer_tools/input_receipts.rs:322-347 | src/tool_runtime/computer_tools/input_receipts.rs:354-385 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 24 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 (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) crates/webcodex-admin/src/commands.rs:182 — crates/webcodex-admin/src/commands.rs:182-202 | crates/webcodex-admin/src/commands.rs:251-270 | crates/webcodex-admin/src/commands.rs:518-535 | crates/webcodex-admin/src/commands.rs:540-559 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) apps/desktop/src-tauri/src/webcodex/settings.rs:353 — apps/desktop/src-tauri/src/webcodex/settings.rs:353-372 | apps/desktop/src-tauri/src/webcodex/settings.rs:377-395 | apps/desktop/src-tauri/src/webcodex/settings.rs:400-424 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/webcodex-persistent-shell/src/lifecycle.rs:57 — crates/webcodex-persistent-shell/src/lifecycle.rs:57-78 | crates/webcodex-persistent-shell/src/lifecycle.rs:80-101 | crates/webcodex-persistent-shell/src/lifecycle.rs:103-123 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 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, 25+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 25+ corresponding lines) src/tool_runtime/browser_tools.rs:153 — src/tool_runtime/browser_tools.rs:153-177 | src/tool_runtime/browser_tools.rs:185-209 | src/tool_runtime/computer_tools/gateway.rs:102-127 | src/tool_runtime/computer_tools/gateway.rs:135-160 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 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, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) src/project_entry_regular_tunnel.rs:337 — src/project_entry_regular_tunnel.rs:337-353 | src/project_entry_share.rs:1048-1064 | src/server_shutdown.rs:212-232 — 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 (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) src/tool_runtime/agent_wait.rs:201 — src/tool_runtime/agent_wait.rs:201-217 | src/tool_runtime/communication.rs:499-521 | src/tool_runtime/communication.rs:532-553 | src/tool_runtime/communication.rs:1259-1285 — 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 (5 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 19+ corresponding lines) src/tool_runtime/communication.rs:299 — src/tool_runtime/communication.rs:299-320 | src/tool_runtime/communication.rs:378-400 | src/tool_runtime/communication.rs:1321-1340 | src/tool_runtime/communication.rs:1458-1477 | src/tool_runtime/communication.rs:1483-1501 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport/metrics.rs:101 — crates/webcodex-runner/src/webcodex_runner/transport/metrics.rs:101-130 | src/runner_http/telemetry.rs:85-116 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) src/tool_runtime/session_tools.rs:875 — src/tool_runtime/session_tools.rs:875-899 | src/tool_runtime/session_tools.rs:906-930 | src/tool_runtime/session_tools.rs:999-1024 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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, 13+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 13+ corresponding lines) src/tool_runtime/goal.rs:638 — src/tool_runtime/goal.rs:638-659 | src/tool_runtime/goal.rs:698-710 | src/tool_runtime/goal.rs:719-737 | src/tool_runtime/goal.rs:746-764 | src/tool_runtime/goal.rs:766-778 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:303 — crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:303-322 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:330-349 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:358-377 | crates/webcodex-runner/src/webcodex_runner/transport/result_submission.rs:385-404 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) src/tool_runtime/agent_task.rs:750 — src/tool_runtime/agent_task.rs:750-772 | src/tool_runtime/agent_task.rs:870-899 | src/tool_runtime/agent_task.rs:1173-1197 | src/tool_runtime/agent_task.rs:1257-1283 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 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, 21+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 21+ corresponding lines) src/tool_runtime/jobs.rs:1250 — src/tool_runtime/jobs.rs:1250-1270 | src/tool_runtime/jobs.rs:1272-1292 | src/tool_runtime/jobs.rs:1298-1322 | src/tool_runtime/jobs.rs:1329-1354 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 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, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/webcodex-cli/src/webcodex_cli/connect/process.rs:303 — crates/webcodex-cli/src/webcodex_cli/connect/process.rs:303-313 | crates/webcodex-runner/src/webcodex_runner/patches.rs:1046-1052 | src/project_entry_setup.rs:1277-1287 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:619 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:619-629 | crates/webcodex-runner/src/webcodex_runner/managed_ssh.rs:265-272 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:317-327 | src/tool_runtime/coding_agent.rs:1735-1745 | src/tool_runtime/session_context.rs:674-681 — These 5 members are one piece of code written 5 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 5 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) crates/webcodex-store/src/agent_task/models.rs:31 — crates/webcodex-store/src/agent_task/models.rs:31-43 | crates/webcodex-store/src/agent_task/models.rs:69-81 | crates/webcodex-store/src/agent_wait.rs:47-59 | crates/webcodex-store/src/communication.rs:69-80 | crates/webcodex-store/src/goal.rs:138-149 — 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 (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) src/tool_runtime/files/mutations/patch.rs:14 — src/tool_runtime/files/mutations/patch.rs:14-32 | src/tool_runtime/files/mutations/preflight.rs:98-113 | src/tool_runtime/files/mutations/text_edits.rs:9-25 | src/tool_runtime/files/mutations/write.rs:108-120 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) crates/webcodex-workflow-session/src/continuation.rs:2015 — crates/webcodex-workflow-session/src/continuation.rs:2015-2020 | crates/webcodex-workflow-session/src/handoff_brief.rs:469-473 | src/tool_runtime/project_resolution.rs:102-106 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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 (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) crates/webcodex-runner-registry/src/validation.rs:665 — crates/webcodex-runner-registry/src/validation.rs:665-667 | crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:523-525 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (63–65 lines × 2) · ×1
  • Duplicated block (63–65 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:339 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:339-403 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:355-417 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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 `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:354` calls `child_mut` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:338` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (61–65 lines × 2) · ×1
  • Duplicated block (61–65 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:457 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:457-521 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:471-531 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) crates/webcodex-store/src/oauth.rs:613 — crates/webcodex-store/src/oauth.rs:613-677 | crates/webcodex-store/src/oauth.rs:1006-1070 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/oauth.rs:613` 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.
D4 · Code Duplication · Duplicated block (64–65 lines × 2) · ×1
  • Duplicated block (64–65 lines × 2) crates/webcodex-workflow-session/src/store.rs:2584 — crates/webcodex-workflow-session/src/store.rs:2584-2648 | crates/webcodex-workflow-session/src/store/borrowed_projection_tests/reference.rs:18-81 — before extracting anything, compare `crates/webcodex-workflow-session/src/store.rs` and `crates/webcodex-workflow-session/src/store/borrowed_projection_tests/reference.rs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-workflow-session/src/store.rs:2584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:110 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:110-162 | crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:199-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:110` 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) src/mcp/tools/call/specialized.rs:127 — src/mcp/tools/call/specialized.rs:127-174 | src/mcp/tools/call/specialized.rs:343-390 — both copies are in the same file, so extract the 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 `src/mcp/tools/call/specialized.rs:127` 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, `src/mcp/tools/call/specialized.rs:342` calls `capture_payload_lazy`, `audit_projection` and `src/mcp/tools/call/specialized.rs:126` 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) src/tool_runtime/process.rs:908 — src/tool_runtime/process.rs:908-950 | src/tool_runtime/script.rs:109-151 — before extracting anything, compare `src/tool_runtime/process.rs` and `src/tool_runtime/script.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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 `src/tool_runtime/process.rs:908` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:909 — crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:909-946 | crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:1048-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner/src/webcodex_runner/projects/managed_worktree.rs:909` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) src/tool_runtime/skills.rs:1771 — src/tool_runtime/skills.rs:1771-1806 | src/tool_runtime/skills.rs:1857-1892 — both copies are in the same file, so extract the 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 `src/tool_runtime/skills.rs:1771` 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.
D4 · Code Duplication · Duplicated block (32–35 lines × 2) · ×1
  • Duplicated block (32–35 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:37 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:37-71 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:113-144 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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 `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs: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.
D4 · Code Duplication · Duplicated block (32–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) src/tool_runtime/process.rs:1039 — src/tool_runtime/process.rs:1039-1070 | src/tool_runtime/script.rs:206-238 — before extracting anything, compare `src/tool_runtime/process.rs` and `src/tool_runtime/script.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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 `src/tool_runtime/process.rs:1039` 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src/mcp/tools/call/specialized.rs:175 — src/mcp/tools/call/specialized.rs:175-201 | src/mcp/tools/call/specialized.rs:394-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/mcp/tools/call/specialized.rs:175` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/mcp/tools/call/specialized.rs:391` calls `capture_payload_lazy`, `audit_arguments` and `src/mcp/tools/call/specialized.rs:174` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) src/oauth_http/project_share.rs:250 — src/oauth_http/project_share.rs:250-274 | src/oauth_http/shared_key_bridge.rs:653-679 — before extracting anything, compare `src/oauth_http/project_share.rs` and `src/oauth_http/shared_key_bridge.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `src/oauth_http/project_share.rs:250` 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.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) crates/webcodex-lsp/src/navigation.rs:451 — crates/webcodex-lsp/src/navigation.rs:451-476 | crates/webcodex-lsp/src/navigation.rs:561-586 | crates/webcodex-lsp/src/navigation.rs:624-649 — 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 `crates/webcodex-lsp/src/navigation.rs:451` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-lsp/src/navigation.rs:560` calls `clamp` and `crates/webcodex-lsp/src/navigation.rs:450` 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 (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) src/oauth_http/project_share.rs:302 — src/oauth_http/project_share.rs:302-326 | src/oauth_http/shared_key_bridge.rs:1006-1031 — before extracting anything, compare `src/oauth_http/project_share.rs` and `src/oauth_http/shared_key_bridge.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 112 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 `src/oauth_http/project_share.rs:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–25 lines × 3) · ×1
  • Duplicated block (24–25 lines × 3) apps/desktop/src-tauri/src/webcodex/cli.rs:516 — apps/desktop/src-tauri/src/webcodex/cli.rs:516-540 | apps/desktop/src-tauri/src/webcodex/cli.rs:558-581 | apps/desktop/src-tauri/src/webcodex/cli.rs:628-652 — 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 `apps/desktop/src-tauri/src/webcodex/cli.rs:516` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–25 lines × 2) · ×1
  • Duplicated block (20–25 lines × 2) apps/desktop/src-tauri/src/webcodex/adapter.rs:431 — apps/desktop/src-tauri/src/webcodex/adapter.rs:431-450 | apps/desktop/src-tauri/src/webcodex/adapter.rs:482-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/desktop/src-tauri/src/webcodex/adapter.rs:431` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:405 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:405-429 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:421-441 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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 `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:421` 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. 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 (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:187 — crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:187-211 | crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs:161-182 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs` and `crates/webcodex-runner/src/webcodex_runner/job_manager/ssh.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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 `crates/webcodex-runner/src/webcodex_runner/job_manager/shell_worker.rs:187` 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.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:991 — crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:991-1015 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1146-1170 | crates/webcodex-runner/src/webcodex_runner/artifacts/upload.rs:1310-1334 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) crates/webcodex-runner-registry/src/requests.rs:792 — crates/webcodex-runner-registry/src/requests.rs:792-811 | crates/webcodex-runner-registry/src/requests.rs:1057-1079 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:1057` 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.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×1
  • Duplicated block (19–23 lines × 2) src/tool_runtime/runtime_info.rs:567 — src/tool_runtime/runtime_info.rs:567-589 | src/tool_runtime/runtime_info.rs:897-915 — both copies are in the same file, so extract the 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 `src/tool_runtime/runtime_info.rs:567` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/tool_runtime/runtime_info.rs:589` calls `to_string`, `runtime_build_info` and `src/tool_runtime/runtime_info.rs:915` 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 (20–22 lines × 3) · ×1
  • Duplicated block (20–22 lines × 3) src/tool_runtime/skills.rs:1664 — src/tool_runtime/skills.rs:1664-1685 | src/tool_runtime/skills.rs:1773-1792 | src/tool_runtime/skills.rs:1859-1878 — 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 `src/tool_runtime/skills.rs:1664` 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. 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 (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:305 — crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:305-326 | crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:323-340 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 236 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 `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/windows.rs:322` calls `id` and `crates/webcodex-runner/src/webcodex_runner/detached_job/platform/unix.rs:304` 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 (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) src/tool_runtime/session_shell.rs:457 — src/tool_runtime/session_shell.rs:457-478 | src/tool_runtime/session_shell.rs:524-545 — both copies are in the same file, so extract the 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 `src/tool_runtime/session_shell.rs:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:734 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:734-754 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:759-779 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:782-802 — 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 `crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:782` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (14–21 lines × 2) · ×1
  • Duplicated block (14–21 lines × 2) crates/webcodex-runner-registry/src/polling.rs:514 — crates/webcodex-runner-registry/src/polling.rs:514-534 | crates/webcodex-runner-registry/src/polling.rs:831-844 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/polling.rs:514` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner-registry/src/polling.rs:830` calls `normalize_persistent_shell_result` and `crates/webcodex-runner-registry/src/polling.rs:513` 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) crates/webcodex-workspace/src/project_recipe.rs:886 — crates/webcodex-workspace/src/project_recipe.rs:886-905 | crates/webcodex-workspace/src/project_recipe.rs:1058-1078 — both copies are in the same file, so extract the 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 `crates/webcodex-workspace/src/project_recipe.rs:886` 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.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) crates/webcodex-runner-registry/src/job_updates/start.rs:862 — crates/webcodex-runner-registry/src/job_updates/start.rs:862-881 | crates/webcodex-runner-registry/src/validation.rs:597-616 | src/tool_runtime/process.rs:321-340 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/webcodex-runner-registry/src/validation.rs:595` calls `validate_id`, `validate_process_argv` and `crates/webcodex-runner-registry/src/job_updates/start.rs:861` 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 (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) src/mcp/tools/call/specialized.rs:59 — src/mcp/tools/call/specialized.rs:59-74 | src/mcp/tools/call/specialized.rs:208-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:734 — crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:734-752 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:759-777 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:782-800 | crates/webcodex-cli/src/webcodex_cli/connect/oauth.rs:814-832 — 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.
D4 · Code Duplication · Duplicated block (16–19 lines × 4) · ×1
  • Duplicated block (16–19 lines × 4) crates/webcodex-computer/src/lib.rs:1572 — crates/webcodex-computer/src/lib.rs:1572-1590 | crates/webcodex-computer/src/lib.rs:1634-1649 | crates/webcodex-computer/src/lib.rs:1672-1687 | crates/webcodex-computer/src/lib.rs:1709-1724 — 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 `crates/webcodex-computer/src/lib.rs:1572` 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, `crates/webcodex-computer/src/lib.rs:1632` calls `native_effect_guard` and `crates/webcodex-computer/src/lib.rs:1570` 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 (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) src/tool_runtime/files/artifacts.rs:500 — src/tool_runtime/files/artifacts.rs:500-518 | src/tool_runtime/files/artifacts.rs:547-565 | src/tool_runtime/files/artifacts.rs:841-858 — 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 `src/tool_runtime/files/artifacts.rs:500` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) REDACTED:913 — REDACTED:913-931 | src/tool_runtime/search_project_texts.rs:226-242 — before extracting anything, compare `REDACTED` and `src/tool_runtime/search_project_texts.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 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.
D4 · Code Duplication · Duplicated block (14–18 lines × 3) · ×1
  • Duplicated block (14–18 lines × 3) crates/webcodex-store/src/agent_wait.rs:1079 — crates/webcodex-store/src/agent_wait.rs:1079-1092 | crates/webcodex-store/src/agent_wait.rs:1229-1245 | crates/webcodex-store/src/communication.rs:3039-3056 — before extracting anything, compare `crates/webcodex-store/src/agent_wait.rs` and `crates/webcodex-store/src/communication.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `crates/webcodex-store/src/agent_wait.rs:1079` 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.
D4 · Code Duplication · Duplicated block (11–17 lines × 2) · ×1
  • Duplicated block (11–17 lines × 2) src/runner_http/auth.rs:105 — src/runner_http/auth.rs:105-121 | src/runner_http/auth.rs:186-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 `src/runner_http/auth.rs:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) src/runner_tokens_http/routes.rs:303 — src/runner_tokens_http/routes.rs:303-318 | src/users_http/tokens.rs:259-275 — before extracting anything, compare `src/runner_tokens_http/routes.rs` and `src/users_http/tokens.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_tokens_http/routes.rs:303` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) src/tool_runtime/resource_references.rs:163 — src/tool_runtime/resource_references.rs:163-176 | src/tool_runtime/resource_references.rs:455-471 — both copies are in the same file, so extract the 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 (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) src/runner_tokens_http/routes.rs:96 — src/runner_tokens_http/routes.rs:96-111 | src/runner_tokens_http/routes.rs:192-206 | src/users_http/tokens.rs:96-111 | src/users_http/tokens.rs:167-181 — before extracting anything, compare `src/runner_tokens_http/routes.rs` and `src/users_http/tokens.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/runner_tokens_http/routes.rs:96` 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–16 lines × 3) · ×1
  • Duplicated block (13–16 lines × 3) src/tool_runtime/communication.rs:786 — src/tool_runtime/communication.rs:786-798 | src/tool_runtime/communication.rs:898-910 | src/tool_runtime/communication.rs:978-993 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–16 lines × 2) · ×1
  • Duplicated block (9–16 lines × 2) src/runtime_console_http/window_collaboration.rs:37 — src/runtime_console_http/window_collaboration.rs:37-52 | src/runtime_console_http/window_queries.rs:345-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/runtime_console_http/window_collaboration.rs:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) crates/webcodex-runner-registry/src/requests.rs:809 — crates/webcodex-runner-registry/src/requests.rs:809-823 | crates/webcodex-runner-registry/src/requests.rs:869-883 | crates/webcodex-runner-registry/src/requests.rs:1217-1231 | crates/webcodex-runner-registry/src/requests.rs:1269-1283 | crates/webcodex-runner-registry/src/requests.rs:1314-1328 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-runner-registry/src/requests.rs:809` 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.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) src/tool_runtime/process.rs:599 — src/tool_runtime/process.rs:599-613 | src/tool_runtime/process.rs:937-951 | src/tool_runtime/script.rs:138-152 | src/tool_runtime/shell.rs:467-481 — before extracting anything, compare `src/tool_runtime/process.rs` and `src/tool_runtime/script.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 104 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. 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 (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) crates/webcodex-lsp/src/supervisor.rs:521 — crates/webcodex-lsp/src/supervisor.rs:521-533 | crates/webcodex-lsp/src/supervisor.rs:819-833 — both copies are in the same file, so extract the 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 `crates/webcodex-lsp/src/supervisor.rs:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) crates/webcodex-runner-registry/src/requests.rs:657 — crates/webcodex-runner-registry/src/requests.rs:657-671 | crates/webcodex-runner-registry/src/requests.rs:1811-1822 — both copies are in the same file, so extract the 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 `crates/webcodex-runner-registry/src/requests.rs:657` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) crates/webcodex-runner-registry/src/jobs.rs:391 — crates/webcodex-runner-registry/src/jobs.rs:391-401 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:62-75 | crates/webcodex-runner/src/webcodex_runner/job_manager/retained.rs:102-112 — 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 `crates/webcodex-runner-registry/src/jobs.rs:391` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) crates/webcodex-store/src/activity.rs:126 — crates/webcodex-store/src/activity.rs:126-141 | crates/webcodex-store/src/activity.rs:195-207 — both copies are in the same file, so extract the 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 `crates/webcodex-store/src/activity.rs:126` 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 (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) crates/webcodex-lsp/src/navigation.rs:458 — crates/webcodex-lsp/src/navigation.rs:458-470 | crates/webcodex-lsp/src/navigation.rs:568-580 | crates/webcodex-lsp/src/navigation.rs:631-643 | crates/webcodex-lsp/src/navigation.rs:741-753 — 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) crates/webcodex-runner-registry/src/polling.rs:237 — crates/webcodex-runner-registry/src/polling.rs:237-249 | crates/webcodex-runner-registry/src/requests.rs:2015-2024 — 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 `crates/webcodex-runner-registry/src/polling.rs:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) crates/webcodex-workflow-session/src/continuation.rs:881 — crates/webcodex-workflow-session/src/continuation.rs:881-893 | crates/webcodex-workflow-session/src/handoff_brief.rs:321-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 `crates/webcodex-workflow-session/src/continuation.rs:881` 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 (12 lines × 11) · ×1
  • Duplicated block (12 lines × 11) crates/webcodex-cli/src/lib.rs:2790 — crates/webcodex-cli/src/lib.rs:2790-2801 | crates/webcodex-cli/src/lib.rs:2803-2814 | crates/webcodex-cli/src/lib.rs:2902-2913 | crates/webcodex-cli/src/lib.rs:2989-3000 | crates/webcodex-cli/src/lib.rs:3002-3013 | crates/webcodex-cli/src/lib.rs:3044-3055 | crates/webcodex-cli/src/lib.rs:3057-3068 | crates/webcodex-cli/src/lib.rs:3070-3081 | crates/webcodex-cli/src/lib.rs:3083-3094 | crates/webcodex-cli/src/lib.rs:3096-3107 | crates/webcodex-cli/src/lib.rs:3109-3120 — all 11 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • Duplicated block (11–12 lines × 4) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:229 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:229-240 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:386-397 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:409-420 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:423-433 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/shell/process.rs` and `crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 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 `crates/webcodex-runner/src/webcodex_runner/shell/process.rs:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–12 lines × 4) · ×1
  • Duplicated block (9–12 lines × 4) src/runner_tokens_http/routes.rs:69 — src/runner_tokens_http/routes.rs:69-80 | src/runner_tokens_http/routes.rs:165-176 | src/runner_tokens_http/routes.rs:262-270 | src/runner_tokens_http/routes.rs:296-304 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) crates/webcodex-runner-registry/src/requests.rs:1392 — crates/webcodex-runner-registry/src/requests.rs:1392-1403 | crates/webcodex-runner-registry/src/requests.rs:1485-1495 | crates/webcodex-runner-registry/src/requests.rs:1572-1583 — 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 `crates/webcodex-runner-registry/src/requests.rs:1392` 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) crates/webcodex-cli/src/webcodex_cli/system.rs:243 — crates/webcodex-cli/src/webcodex_cli/system.rs:243-254 | src/project_entry_windows.rs:193-201 — before extracting anything, compare `crates/webcodex-cli/src/webcodex_cli/system.rs` and `src/project_entry_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-cli/src/webcodex_cli/system.rs:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) crates/webcodex-runner-registry/src/job_updates.rs:295 — crates/webcodex-runner-registry/src/job_updates.rs:295-306 | crates/webcodex-runner-registry/src/job_updates.rs: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 `crates/webcodex-runner-registry/src/job_updates.rs:295` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) src/tool_runtime/files/mutations/preflight.rs:157 — src/tool_runtime/files/mutations/preflight.rs:157-168 | src/tool_runtime/files/mutations/text_edits.rs:414-423 — 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) crates/webcodex-runner/src/webcodex_runner/shell/process.rs:230 — crates/webcodex-runner/src/webcodex_runner/shell/process.rs:230-240 | crates/webcodex-runner/src/webcodex_runner/shell/process.rs:254-264 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:387-397 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:410-420 | crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs:423-433 — before extracting anything, compare `crates/webcodex-runner/src/webcodex_runner/shell/process.rs` and `crates/webcodex-runner/src/webcodex_runner/shell/scripts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 82 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/webcodex-cli/src/webcodex_cli/http.rs:27 — crates/webcodex-cli/src/webcodex_cli/http.rs:27-37 | crates/webcodex-cli/src/webcodex_cli/http.rs:64-74 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:79-89 | crates/webcodex-cli/src/webcodex_cli/token_commands.rs:138-148 — 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 `crates/webcodex-cli/src/webcodex_cli/http.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×1
  • Duplicated block (10–11 lines × 4) src/oauth_http/managed_authorize.rs:515 — src/oauth_http/managed_authorize.rs:515-524 | src/oauth_http/managed_authorize.rs:647-656 | src/oauth_http/metadata.rs:24-34 | src/oauth_http/metadata.rs:65-75 — 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. 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–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) src/tool_runtime/skills.rs:1689 — src/tool_runtime/skills.rs:1689-1699 | src/tool_runtime/skills.rs:1794-1802 | src/tool_runtime/skills.rs:1880-1888 — 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 `src/tool_runtime/skills.rs:1689` 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. 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 (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) crates/webcodex-admin/src/commands.rs:217 — crates/webcodex-admin/src/commands.rs:217-226 | crates/webcodex-admin/src/commands.rs:325-334 | crates/webcodex-admin/src/commands.rs:395-404 | crates/webcodex-admin/src/commands.rs:490-499 | crates/webcodex-cli/src/lib.rs:1263-1272 | crates/webcodex-cli/src/lib.rs:1305-1314 — there are 6 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 6 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, `crates/webcodex-cli/src/lib.rs:1273` calls `Err`, `to_string` and `crates/webcodex-admin/src/commands.rs:227` 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 (7–10 lines × 3) · ×1
  • Duplicated block (7–10 lines × 3) crates/webcodex-core/src/validation_identity.rs:143 — crates/webcodex-core/src/validation_identity.rs:143-152 | crates/webcodex-core/src/validation_identity.rs:161-167 | crates/webcodex-core/src/validation_identity.rs:195-201 — 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 `crates/webcodex-core/src/validation_identity.rs:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-core/src/validation_identity.rs:202` calls `get`, `and_then`, `Some` and `crates/webcodex-core/src/validation_identity.rs:153` 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 (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) src/auth/middleware.rs:316 — src/auth/middleware.rs:316-324 | src/auth/middleware.rs:356-364 | src/auth/middleware.rs:388-396 | src/auth/middleware.rs:416-424 | src/auth/middleware.rs:452-460 | src/auth/middleware.rs:480-488 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) crates/webcodex-computer/src/lib.rs:1571 — crates/webcodex-computer/src/lib.rs:1571-1579 | crates/webcodex-computer/src/lib.rs:1633-1641 | crates/webcodex-computer/src/lib.rs:1671-1679 | crates/webcodex-computer/src/lib.rs:1708-1716 | crates/webcodex-computer/src/lib.rs:1774-1782 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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, `crates/webcodex-computer/src/lib.rs:1632` calls `native_effect_guard` and `crates/webcodex-computer/src/lib.rs:1570` 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 (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) apps/desktop/src-tauri/src/state/persistence.rs:146 — apps/desktop/src-tauri/src/state/persistence.rs:146-152 | crates/webcodex-cli/src/webcodex_cli/connect/profile.rs:512-520 | src/project_entry_setup.rs:1231-1237 — 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. 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–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) crates/webcodex-store/src/agent_wait.rs:570 — crates/webcodex-store/src/agent_wait.rs:570-578 | crates/webcodex-store/src/communication.rs:2769-2774 — before extracting anything, compare `crates/webcodex-store/src/agent_wait.rs` and `crates/webcodex-store/src/communication.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `crates/webcodex-store/src/agent_wait.rs:570` 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.
D4 · Code Duplication · Duplicated block (3–9 lines × 3) · ×1
  • Duplicated block (3–9 lines × 3) crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:328 — crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:328-336 | crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:545-553 | crates/webcodex-tool-contracts/src/registry/output_schemas/jobs.rs:830-832 — 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 `crates/webcodex-tool-contracts/src/registry/output_schemas/files.rs:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 4) · ×1
  • Duplicated block (7–8 lines × 4) crates/webcodex-runner-registry/src/requests.rs:2004 — crates/webcodex-runner-registry/src/requests.rs:2004-2011 | crates/webcodex-runner-registry/src/requests.rs:2076-2083 | crates/webcodex-runner-registry/src/requests.rs:2217-2223 | crates/webcodex-runner-registry/src/requests.rs:2279-2286 — 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 `crates/webcodex-runner-registry/src/requests.rs:2004` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-runner-registry/src/requests.rs:2085` calls `Err`, `to_string` and `crates/webcodex-runner-registry/src/requests.rs:2287` 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:289 — crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:289-296 | crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:368-374 | crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:438-444 — 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 `crates/webcodex-runner/src/webcodex_runner/shell/commands.rs:289` 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 (6–8 lines × 3) · ×1
  • Duplicated block (6–8 lines × 3) src/mcp/tools.rs:569 — src/mcp/tools.rs:569-576 | src/mcp/tools.rs:667-674 | src/mcp/tools.rs:742-747 — 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 `src/mcp/tools.rs:569` 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 (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) crates/webcodex-admin/src/commands.rs:185 — crates/webcodex-admin/src/commands.rs:185-191 | crates/webcodex-admin/src/commands.rs:207-213 | crates/webcodex-admin/src/commands.rs:254-260 | crates/webcodex-admin/src/commands.rs:285-291 | crates/webcodex-admin/src/commands.rs:314-320 | crates/webcodex-admin/src/commands.rs:543-549 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/webcodex-admin/src/commands.rs:185` 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, `crates/webcodex-admin/src/commands.rs:321` calls `value` and `crates/webcodex-admin/src/commands.rs:214` 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 (5–7 lines × 2) · ×1
  • Duplicated block (5–7 lines × 2) src/users_http/tokens.rs:82 — src/users_http/tokens.rs:82-88 | src/users_http/tokens.rs:154-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) crates/webcodex-core/src/apply_edits_shared.rs:469 — crates/webcodex-core/src/apply_edits_shared.rs:469-474 | crates/webcodex-core/src/project_instructions.rs:566-571 | crates/webcodex-core/src/runner_instruction.rs:132-137 | crates/webcodex-store/src/artifact_handoff.rs:1058-1063 | crates/webcodex-store/src/external_observations.rs:30-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:631 — crates/webcodex-runner/src/webcodex_runner/configured_skills.rs:631-635 | crates/webcodex-runner/src/webcodex_runner/files.rs:13-17 | crates/webcodex-runner/src/webcodex_runner/skill_store.rs:2042-2046 | crates/webcodex-workspace/src/project_context.rs:1109-1113 | crates/webcodex-workspace/src/workspace_checkpoint.rs:871-875 | src/tool_runtime/files.rs:88-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) crates/webcodex-workflow-session/src/continuation.rs:2022 — crates/webcodex-workflow-session/src/continuation.rs:2022-2026 | src/tool_runtime/closeout_facts.rs:401-405 | src/tool_runtime/git/show_changes.rs:2011-2015 | src/tool_runtime/hygiene.rs:542-546 | src/tool_runtime/startup_brief.rs:1078-1082 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) crates/webcodex-cli/src/webcodex_cli/ops.rs:244 — crates/webcodex-cli/src/webcodex_cli/ops.rs:244-261 | crates/webcodex-cli/src/webcodex_cli/ops.rs:267-284 | crates/webcodex-cli/src/webcodex_cli/ops.rs:294-311 | crates/webcodex-cli/src/webcodex_cli/ops.rs:318-335 — 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 `crates/webcodex-cli/src/webcodex_cli/ops.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/webcodex-cli/src/webcodex_cli/ops.rs:286` calls `smoke_preflight_target_ready`, `find_project`, `Some` and `crates/webcodex-cli/src/webcodex_cli/ops.rs:312` 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 (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) plugins/project-knowledge/knowledge.py:474 — plugins/project-knowledge/knowledge.py:474-503 | plugins/project-knowledge/knowledge.py:660-687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Near-duplicate member family (4 members, 13 shared lines) · ×1
  • Near-duplicate member family (4 members, 13 shared lines) src/mcp_tests/file_import.rs:958 — src/mcp_tests/file_import.rs:958-1037 | src/mcp_tests/file_import.rs:1046-1119 | src/mcp_tests/file_import.rs:1128-1213 | src/mcp_tests/file_import.rs:1220-1301 — These 4 members are variants of one another: a block of 13 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 · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) src/mcp_tests/artifact_export.rs:13 — src/mcp_tests/artifact_export.rs:13-70 | src/mcp_tests/file_import.rs:300-360 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) src/mcp_tests/file_import.rs:1310 — src/mcp_tests/file_import.rs:1310-1381 | src/mcp_tests/file_import.rs:1390-1449 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 27+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 27+ corresponding lines) src/mcp_tests/plugin_check.rs:21 — src/mcp_tests/plugin_check.rs:21-49 | src/mcp_tests/plugin_tools.rs:193-221 | src/mcp_tests/plugin_tools.rs:228-254 | src/mcp_tests/ssh_resource.rs:14-42 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) scripts/e2e_linux_socket_activation.py:298 — scripts/e2e_linux_socket_activation.py:298-316 | scripts/e2e_linux_socket_activation.py:476-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `scripts/e2e_linux_socket_activation.py:475` calls `terminate` and `scripts/e2e_linux_socket_activation.py:297` 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 (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) scripts/agent_loop_report.py:629 — scripts/agent_loop_report.py:629-647 | scripts/agent_loop_report.py:683-702 — both copies are in the same file, so extract the 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 (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) scripts/e2e_cli_runtime_output.py:308 — scripts/e2e_cli_runtime_output.py:308-318 | scripts/e2e_cli_runtime_output.py:326-339 — both copies are in the same file, so extract the 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 `scripts/e2e_cli_runtime_output.py:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) scripts/agent_loop_report.py:939 — scripts/agent_loop_report.py:939-945 | scripts/agent_loop_report.py:1243-1252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) scripts/build_windows_unified_bootstrap.py:17 — scripts/build_windows_unified_bootstrap.py:17-21 | scripts/deb_lifecycle_acceptance.py:141-145 | scripts/e2e_codex_bidirectional_ws.py:208-212 | scripts/measure_cli_runtime_projection.py:27-31 | scripts/package_unified_installer.py:40-44 | scripts/prepare_desktop_bundle_macos.py:32-36 | scripts/prepare_release_metadata.py:139-143 | scripts/prepare_windows_unified_installer.py:27-31 — 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 8 call sites, so a change lands once.
D5 · Coupling · Unstable project webcodex · ×1
  • Unstable project webcodex — webcodex has instability 0.94 with 1 dependents.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 129 typed · 86 plain JS — the untyped files are apps/desktop/scripts/check-form-control-css.mjs, apps/desktop/scripts/generate-icons.mjs, crates/webcodex-browser/src/cdp/set_value.js, crates/webcodex-browser/src/cdp/widgets/choice.js, crates/webcodex-browser/src/cdp/widgets/common.js, crates/webcodex-browser/src/cdp/widgets/date.js (+80 more).
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (8 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (8 clone groups) apps/desktop/src/features/onboarding/QuickShareSetup.tsx:19 — 8 duplicated blocks under apps/desktop/src/features/ have copies in at least two of the sibling directories activity, extensions, onboarding, projects, settings — 2 of them are reported below, and 6 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 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 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 8 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 (43 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (43 matched lines × 2 locations) scripts/ui-smoke/desktop-runtime-probe.mjs:19 — scripts/ui-smoke/desktop-runtime-probe.mjs:19 · scripts/ui-smoke/desktop-runtime-simple.mjs:14 — the two spans are one implementation copied and then locally edited — 532 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 (29 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (29 matched lines × 2 locations) scripts/ui-smoke/mcp-workspaces.mjs:13 — scripts/ui-smoke/mcp-workspaces.mjs:13 · scripts/ui-smoke/work-result-controls.mjs:10 — the two spans are one implementation copied and then locally edited — 372 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 (21 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (21 matched lines × 2 locations) apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:22 — apps/desktop/src/features/extensions/RunnerCapabilityAuthorization.tsx:22 · apps/desktop/src/features/extensions/SshResourcesPanel.tsx:25 — the two spans are one implementation copied and then locally edited — 200 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 (20 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (20 matched lines × 2 locations) apps/desktop/src/features/projects/ProjectsPanel.tsx:111 — apps/desktop/src/features/projects/ProjectsPanel.tsx:111 · apps/desktop/src/features/projects/ProjectsPanel.tsx:145 — the two spans are one implementation copied and then locally edited — 123 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 (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) scripts/ui-smoke/smoke.mjs:122 — scripts/ui-smoke/smoke.mjs:122 · scripts/ui-smoke/smoke.mjs:139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (14 matched lines × 2 locations) apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:27 — apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:27 · apps/desktop/src/features/settings/PowerShellInstallGuidance.tsx:42 — the two spans are one implementation copied and then locally edited — 81 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 (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) scripts/ui-smoke/projects-runtime.mjs:7 — scripts/ui-smoke/projects-runtime.mjs:7 · scripts/ui-smoke/runtime-overview.mjs:7 — 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 with local edits (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) apps/desktop/src/features/onboarding/FirstRun.tsx:114 — apps/desktop/src/features/onboarding/FirstRun.tsx:114 · apps/desktop/src/features/onboarding/QuickShareSetup.tsx:18 — the two spans are one implementation copied and then locally edited — 95 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 (12 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (12 matched lines × 2 locations) scripts/ui-smoke/admin-preferences.mjs:123 — scripts/ui-smoke/admin-preferences.mjs:123 · scripts/ui-smoke/window-session-record.mjs:231 — the two spans are one implementation copied and then locally edited — 83 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 (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) scripts/ui-smoke/projects-runtime.mjs:77 — scripts/ui-smoke/projects-runtime.mjs:77 · scripts/ui-smoke/runtime-workflow.mjs:51 — 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 (7 lines × 5 locations) · ×1
  • Duplicated block (7 lines × 5 locations) apps/desktop/src/i18n/configuration-data.ts:83 — apps/desktop/src/i18n/configuration-data.ts:83 · apps/desktop/src/i18n/connections-tools.ts:141 · apps/desktop/src/i18n/device-invitation.ts:35 · apps/desktop/src/i18n/product.ts:349 · +1 more site(s) not listed — the 5 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. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (7 lines × 6 locations) · ×1
  • Duplicated block (7 lines × 6 locations) scripts/ui-smoke/admin-preferences.mjs:2 — scripts/ui-smoke/admin-preferences.mjs:2 · scripts/ui-smoke/desktop-resize-theme.mjs:3 · scripts/ui-smoke/session-navigation.mjs:3 · scripts/ui-smoke/sidebar-geometry.mjs:2 · +2 more site(s) not listed — the 6 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. There is one copy in each of 6 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (7 lines × 4 locations) · ×1
  • Duplicated block (7 lines × 4 locations) scripts/ui-smoke/pdf-document-reader.mjs:192 — scripts/ui-smoke/pdf-document-reader.mjs:192 · scripts/ui-smoke/pdf-document-reader.mjs:229 · scripts/ui-smoke/pdf-document-reader.mjs:251 · scripts/ui-smoke/pdf-document-reader.mjs:308 — all 4 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.
R2 · Cyclomatic Complexity · Complex function FirstRun (cyclomatic 125, cognitive 100) · ×1
  • Complex function FirstRun (cyclomatic 125, cognitive 100) apps/desktop/src/features/onboarding/FirstRun.tsx:47 — FirstRun has cyclomatic complexity 125 and cognitive complexity 100; 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 UpdateWorkflow (cyclomatic 119, cognitive 79) · ×1
  • Complex function UpdateWorkflow (cyclomatic 119, cognitive 79) apps/desktop/src/features/settings/UpdateWorkflow.tsx:34 — UpdateWorkflow has cyclomatic complexity 119 and cognitive complexity 79; 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 DiagnosticsContents (cyclomatic 54, cognitive 49) · ×1
  • Complex function DiagnosticsContents (cyclomatic 54, cognitive 49) apps/desktop/src/features/settings/DiagnosticsPanel.tsx:23 — DiagnosticsContents has cyclomatic complexity 54 and cognitive complexity 49; 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 invoke (cyclomatic 52, cognitive 28) · ×1
  • Complex function invoke (cyclomatic 52, cognitive 28) scripts/ui-smoke/desktop-shim.js:18 — invoke has cyclomatic complexity 52 and cognitive complexity 28; 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 ReadinessBanner (cyclomatic 50, cognitive 42) · ×1
  • Complex function ReadinessBanner (cyclomatic 50, cognitive 42) apps/desktop/src/features/dashboard/ReadinessBanner.tsx:8 — ReadinessBanner has cyclomatic complexity 50 and cognitive complexity 42; 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 ConnectionCard (cyclomatic 49, cognitive 47) · ×1
  • Complex function ConnectionCard (cyclomatic 49, cognitive 47) apps/desktop/src/features/connection/ConnectionCard.tsx:34 — ConnectionCard has cyclomatic complexity 49 and cognitive complexity 47; 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 ConnectionEditor (cyclomatic 47, cognitive 40) · ×1
  • Complex function ConnectionEditor (cyclomatic 47, cognitive 40) apps/desktop/src/features/connection/ConnectionEditor.tsx:10 — ConnectionEditor has cyclomatic complexity 47 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 46, cognitive 75) · ×1
  • Complex function (anonymous) (cyclomatic 46, cognitive 75) scripts/ui-smoke/mcp-workspaces.mjs:65 — (anonymous) has cyclomatic complexity 46 and cognitive complexity 75; 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 SettingsView (cyclomatic 45, cognitive 35) · ×1
  • Complex function SettingsView (cyclomatic 45, cognitive 35) apps/desktop/src/features/settings/SettingsPanel.tsx:57 — SettingsView has cyclomatic complexity 45 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 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 AboutPanelContent (cyclomatic 42, cognitive 35) · ×1
  • Complex function AboutPanelContent (cyclomatic 42, cognitive 35) apps/desktop/src/features/settings/AboutPanel.tsx:18 — AboutPanelContent has cyclomatic complexity 42 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 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 RunnerCapacitySettings (cyclomatic 42, cognitive 32) · ×1
  • Complex function RunnerCapacitySettings (cyclomatic 42, cognitive 32) apps/desktop/src/features/settings/RunnerCapacityPanel.tsx:21 — RunnerCapacitySettings has cyclomatic complexity 42 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 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 CloudflareConnectionCard (cyclomatic 42, cognitive 31) · ×1
  • Complex function CloudflareConnectionCard (cyclomatic 42, cognitive 31) apps/desktop/src/features/connection/CloudflareConnectionCard.tsx:61 — CloudflareConnectionCard has cyclomatic complexity 42 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 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 ProjectsPanel (cyclomatic 41, cognitive 36) · ×1
  • Complex function ProjectsPanel (cyclomatic 41, cognitive 36) apps/desktop/src/features/projects/ProjectsPanel.tsx:16 — ProjectsPanel has cyclomatic complexity 41 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 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 ConnectionPanel (cyclomatic 41, cognitive 30) · ×1
  • Complex function ConnectionPanel (cyclomatic 41, cognitive 30) apps/desktop/src/features/connection/ConnectionPanel.tsx:18 — ConnectionPanel has cyclomatic complexity 41 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 control (cyclomatic 40, cognitive 48) · ×1
  • Complex function control (cyclomatic 40, cognitive 48) extensions/browser-bridge/worker.js:153 — control has cyclomatic complexity 40 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 RuntimePanelContent (cyclomatic 39, cognitive 33) · ×1
  • Complex function RuntimePanelContent (cyclomatic 39, cognitive 33) apps/desktop/src/features/settings/RuntimePanel.tsx:18 — RuntimePanelContent has cyclomatic complexity 39 and cognitive complexity 33; 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 DesktopApp (cyclomatic 37, cognitive 29) · ×1
  • Complex function DesktopApp (cyclomatic 37, cognitive 29) apps/desktop/src/App.tsx:34 — DesktopApp has cyclomatic complexity 37 and cognitive complexity 29; 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 ActivityPanel (cyclomatic 36, cognitive 32) · ×1
  • Complex function ActivityPanel (cyclomatic 36, cognitive 32) apps/desktop/src/features/activity/ActivityPanel.tsx:56 — ActivityPanel has cyclomatic complexity 36 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 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 execute (cyclomatic 33, cognitive 38) · ×1
  • Complex function execute (cyclomatic 33, cognitive 38) plugins/agent-environment/src/bridge.mjs:39 — execute has cyclomatic complexity 33 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 (anonymous) (cyclomatic 32, cognitive 38) · ×1
  • Complex function (anonymous) (cyclomatic 32, cognitive 38) scripts/ui-smoke/server.mjs:12 — (anonymous) has cyclomatic complexity 32 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 (anonymous) (cyclomatic 29, cognitive 31) · ×1
  • Complex function (anonymous) (cyclomatic 29, cognitive 31) apps/desktop/src/hooks/useDesktopWorkspace.ts:109 — (anonymous) has cyclomatic complexity 29 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 inspect (cyclomatic 28, cognitive 22) · ×1
  • Complex function inspect (cyclomatic 28, cognitive 22) scripts/ui-smoke/admin-preferences.mjs:22 — inspect has cyclomatic complexity 28 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 27, cognitive 22) · ×1
  • Complex function (anonymous) (cyclomatic 27, cognitive 22) apps/desktop/src/features/projects/RunnerDevices.tsx:23 — (anonymous) has cyclomatic complexity 27 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 RunnerFileAccess (cyclomatic 27, cognitive 17) · ×1
  • Complex function RunnerFileAccess (cyclomatic 27, cognitive 17) apps/desktop/src/features/settings/RunnerFileAccess.tsx:35 — RunnerFileAccess has cyclomatic complexity 27 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function inspect (cyclomatic 26, cognitive 32) · ×1
  • Complex function inspect (cyclomatic 26, cognitive 32) scripts/ui-smoke/sidebar-geometry.mjs:12 — inspect has cyclomatic complexity 26 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.
R2 · Cyclomatic Complexity · Complex function noProxyMatches (cyclomatic 25, cognitive 41) · ×1
  • Complex function noProxyMatches (cyclomatic 25, cognitive 41) REDACTED:178 — noProxyMatches has cyclomatic complexity 25 and cognitive complexity 41; 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 renderEntry (cyclomatic 25, cognitive 21) · ×1
  • Complex function renderEntry (cyclomatic 25, cognitive 21) apps/desktop/src/features/settings/ConfigurationDataPanel.tsx:86 — renderEntry has cyclomatic complexity 25 and cognitive complexity 21; 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 capture (cyclomatic 24, cognitive 35) · ×1
  • Complex function capture (cyclomatic 24, cognitive 35) scripts/ui-smoke/web-page-consistency.mjs:51 — capture has cyclomatic complexity 24 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 extractTarGz (cyclomatic 24, cognitive 32) · ×1
  • Complex function extractTarGz (cyclomatic 24, cognitive 32) REDACTED:646 — extractTarGz has cyclomatic complexity 24 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.
R2 · Cyclomatic Complexity · Complex function ProjectRow (cyclomatic 24, cognitive 19) · ×1
  • Complex function ProjectRow (cyclomatic 24, cognitive 19) apps/desktop/src/features/projects/ProjectRows.tsx:24 — ProjectRow has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ComputerPermissions (cyclomatic 24, cognitive 19) · ×1
  • Complex function ComputerPermissions (cyclomatic 24, cognitive 19) apps/desktop/src/features/settings/ComputerPermissions.tsx:14 — ComputerPermissions has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ExtensionsPanel (cyclomatic 24, cognitive 18) · ×1
  • Complex function ExtensionsPanel (cyclomatic 24, cognitive 18) apps/desktop/src/features/extensions/ExtensionsPanel.tsx:20 — ExtensionsPanel has cyclomatic complexity 24 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 23, cognitive 28) · ×1
  • Complex function (anonymous) (cyclomatic 23, cognitive 28) extensions/browser-bridge/worker.js:83 — (anonymous) has cyclomatic complexity 23 and cognitive complexity 28; 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 desktopErrorPresentation (cyclomatic 23, cognitive 24) · ×1
  • Complex function desktopErrorPresentation (cyclomatic 23, cognitive 24) apps/desktop/src/i18n/presentation.ts:164 — desktopErrorPresentation has cyclomatic complexity 23 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RuntimeConsolePanel (cyclomatic 23, cognitive 15) · ×1
  • Complex function RuntimeConsolePanel (cyclomatic 23, cognitive 15) apps/desktop/src/features/console/RuntimeConsolePanel.tsx:13 — RuntimeConsolePanel has cyclomatic complexity 23 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 22, cognitive 21) · ×1
  • Complex function (anonymous) (cyclomatic 22, cognitive 21) frontend/test-v2/navigation.test.tsx:21 — (anonymous) has cyclomatic complexity 22 and cognitive complexity 21; 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 poll (cyclomatic 22, cognitive 19) · ×1
  • Complex function poll (cyclomatic 22, cognitive 19) apps/desktop/src/features/workspace/WorkspaceContext.tsx:136 — poll has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 unregisterSelected (cyclomatic 21, cognitive 43) · ×1
  • Complex function unregisterSelected (cyclomatic 21, cognitive 43) apps/desktop/src/features/projects/ProjectsPanel.tsx:152 — unregisterSelected has cyclomatic complexity 21 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 captureProtectedNpmEnvironment (cyclomatic 21, cognitive 23) · ×1
  • Complex function captureProtectedNpmEnvironment (cyclomatic 21, cognitive 23) npm/webcodex/bin/wrapper.js:76 — captureProtectedNpmEnvironment has cyclomatic complexity 21 and cognitive complexity 23; 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 ManagedInstructionsPanel (cyclomatic 21, cognitive 17) · ×1
  • Complex function ManagedInstructionsPanel (cyclomatic 21, cognitive 17) apps/desktop/src/features/extensions/ManagedInstructionsPanel.tsx:11 — ManagedInstructionsPanel has cyclomatic complexity 21 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 897 lines of code REDACTED:1 — REDACTED has 897 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 · apps/desktop/src/i18n/update-text.ts · ×1
  • apps/desktop/src/i18n/update-text.ts: 563 lines of code apps/desktop/src/i18n/update-text.ts:1 — apps/desktop/src/i18n/update-text.ts has 563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~207 LoC) · ×1
  • Dead file (~207 LoC) scripts/ui-smoke/work-result-card.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~186 LoC) · ×1
  • Dead file (~186 LoC) scripts/ui-smoke/window-workspace.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~143 LoC) · ×1
  • Dead file (~143 LoC) scripts/ui-smoke/desktop-clarity-layout.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~129 LoC) · ×1
  • Dead file (~129 LoC) scripts/ui-smoke/i18n-project-layout.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~117 LoC) · ×1
  • Dead file (~117 LoC) scripts/ui-smoke/desktop-connection-readability.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~78 LoC) · ×1
  • Dead file (~78 LoC) scripts/ui-smoke/collaboration-history.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~76 LoC) · ×1
  • Dead file (~76 LoC) scripts/ui-smoke/desktop-connection-recovery.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~72 LoC) · ×1
  • Dead file (~72 LoC) scripts/ui-smoke/desktop-runtime-probe.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~66 LoC) · ×1
  • Dead file (~66 LoC) scripts/ui-smoke/desktop-runtime-simple.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~58 LoC) · ×1
  • Dead file (~58 LoC) scripts/ui-smoke/runtime-overview.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~51 LoC) · ×1
  • Dead file (~51 LoC) scripts/ui-smoke/window-collaboration.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~50 LoC) · ×1
  • Dead file (~50 LoC) scripts/ui-smoke/work-header.mjs — no import path from any entry point (94 application, 4 tooling, 153 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Minor — 103 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate frontend/src/mcp-apps/docx-app.mjs:30 — `!!value && typeof value === "object" && !Array.isArray(value) && typeof value.success === "boolean" && (Object.prototype.hasOwnProperty.call…` appears character-identically in 2 files — frontend/src/mcp-apps/docx-app.mjs, frontend/src/mcp-apps/work-result/pdf-document.mjs. 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 frontend/src/mcp-apps/docx-app.mjs:37 — `!block || block.type !== "text" || typeof block.text !== "string" || block.text.length > 400_000` appears character-identically in 2 files — frontend/src/mcp-apps/docx-app.mjs, frontend/src/mcp-apps/work-result/pdf-document.mjs. 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 frontend/scripts/build-docx.mjs:26 — `!existsSync(resolve(dir, "REDACTED")) && dirname(dir) !== dir` appears character-identically in 2 files — frontend/scripts/build-docx.mjs, frontend/scripts/build-work-result-markdown.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/admin-preferences.mjs:41 — `Math.abs(control.icon.cx - control.cx) <= 1 && Math.abs(control.icon.cy - control.cy) <= 1` appears character-identically in 2 files — scripts/ui-smoke/admin-preferences.mjs, scripts/ui-smoke/sidebar-geometry.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/projects-runtime.mjs:47 — `bounds.body <= width + 1 && bounds.root <= width + 1` appears character-identically in 5 files — scripts/ui-smoke/projects-runtime.mjs, scripts/ui-smoke/runtime-overview.mjs, scripts/ui-smoke/runtime-workflow.mjs, scripts/ui-smoke/window-workspace.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/admin-preferences.mjs:60 — `bounds.x >= 0 && bounds.x + bounds.width <= width + 1 && bounds.y >= 0 && bounds.y + bounds.height <= 1001` appears character-identically in 2 files — scripts/ui-smoke/admin-preferences.mjs, scripts/ui-smoke/sidebar-geometry.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/mcp-workspaces.mjs:192 — `box.left >= 0 && box.right <= innerWidth + 1 && box.top >= 0 && box.bottom <= innerHeight + 1` appears character-identically in 2 files — scripts/ui-smoke/mcp-workspaces.mjs, scripts/ui-smoke/work-result-controls.mjs. 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 apps/desktop/src/features/console/RuntimeConsolePanel.tsx:33 — `busy || Boolean(state.current_operation)` appears character-identically in 6 files — apps/desktop/src/features/console/RuntimeConsolePanel.tsx, apps/desktop/src/features/extensions/useExtensionsState.ts, apps/desktop/src/features/onboarding/QuickShareSetup.tsx, apps/desktop/src/features/settings/DiagnosticsPanel.tsx. 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 frontend/src/mcp-apps/docx-app.mjs:49 — `candidate && typeof candidate === "object" && !Array.isArray(candidate)` appears character-identically in 2 files — frontend/src/mcp-apps/docx-app.mjs, frontend/src/mcp-apps/work-result/pdf-document.mjs. 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 frontend/src/runtime-v2/state/useProjectSessions.ts:73 — `current === "available" || current === "stale"` appears character-identically in 2 files — frontend/src/runtime-v2/state/useProjectSessions.ts, frontend/src/runtime-v2/state/useWindowWorkspace.ts. 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 plugins/repo-context/src/context.ts:130 — `details.killed === true || details.code === "ETIMEDOUT"` appears character-identically in 2 files — plugins/repo-context/src/context.ts, plugins/repo-info/src/plugin.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/desktop-runtime-probe.mjs:59 — `dimensions.document <= dimensions.viewport + 1 && dimensions.content <= dimensions.main + 1` appears character-identically in 2 files — scripts/ui-smoke/desktop-runtime-probe.mjs, scripts/ui-smoke/desktop-runtime-simple.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/desktop-connection-readability.mjs:67 — `document.documentElement.lang === locale && document.documentElement.dataset.theme === theme` appears character-identically in 2 files — scripts/ui-smoke/desktop-connection-readability.mjs, scripts/ui-smoke/i18n-project-layout.mjs. 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 apps/desktop/src/features/console/RuntimeConsolePanel.tsx:44 — `error && desktopErrorPresentation(error, t)` appears character-identically in 4 files — apps/desktop/src/features/console/RuntimeConsolePanel.tsx, apps/desktop/src/features/settings/DiagnosticsPanel.tsx, apps/desktop/src/features/settings/LocalServicesPanel.tsx, apps/desktop/src/features/settings/RuntimePanel.tsx. 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 frontend/src/admin_controller.ts:37 — `error && typeof error === "object" && "name" in error && error.name === "AbortError"` appears character-identically in 2 files — frontend/src/admin_controller.ts, frontend/src/admin_mutation_controller.ts. 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 frontend/src/ui/cardAppearance.ts:27 — `event.key === SELECTION_STORAGE_KEY || event.key === null` appears character-identically in 2 files — frontend/src/ui/cardAppearance.ts, frontend/src/ui/useSelectionPreference.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/ui-smoke/mcp-workspaces.mjs:66 — `event.source !== frame.contentWindow || event.data?.jsonrpc !== '2.0'` appears character-identically in 3 files — scripts/ui-smoke/mcp-workspaces.mjs, scripts/ui-smoke/pdf-document-reader.mjs, scripts/ui-smoke/work-result-controls.mjs. 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 plugins/repo-context/src/context.ts:267 — `head === undefined || !/^[0-9a-f]{40,64}$/u.test(head)` appears character-identically in 2 files — plugins/repo-context/src/context.ts, plugins/repo-info/src/plugin.ts. 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 frontend/scripts/build-docx.mjs:18 — `html.split(begin).length !== 2 || html.split(end).length !== 2` appears character-identically in 6 files — frontend/scripts/build-docx.mjs, frontend/scripts/build-pdf-document.mjs, frontend/scripts/build-selection-motion.mjs, frontend/scripts/build-spreadsheet.mjs. 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 plugins/agent-browser/scripts/live-smoke.mjs:10 — `process.env.WC_TEST_AGENT_BROWSER || 'agent-browser'` appears character-identically in 2 files — plugins/agent-browser/scripts/live-smoke.mjs, plugins/agent-browser/scripts/native-smoke.mjs. 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 frontend/src/runtime-v2/components/SessionWindowNavigation.tsx:34 — `response?.status === 403 || response?.status === 404` appears character-identically in 3 files — frontend/src/runtime-v2/components/SessionWindowNavigation.tsx, frontend/src/runtime-v2/state/useGoalWorkspace.ts, frontend/src/runtime-v2/state/useSessionWorkspace.ts. 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 frontend/scripts/build-pdf-document.mjs:17 — `script.includes(begin) || script.includes(end)` appears character-identically in 2 files — frontend/scripts/build-pdf-document.mjs, frontend/scripts/build-work-result-pdf.mjs. 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 frontend/src/runtime-v2/components/GoalWorkbench.tsx:308 — `session.project_name || session.project_id` appears character-identically in 2 files — frontend/src/runtime-v2/components/GoalWorkbench.tsx, frontend/src/runtime-v2/model/work.ts. 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 apps/desktop/src/features/onboarding/FirstRunCompletion.tsx:56 — `state.topology?.experience === "full" && state.topology.server.kind === "local"` appears character-identically in 2 files — apps/desktop/src/features/onboarding/FirstRunCompletion.tsx, apps/desktop/src/features/projects/AddDevice.tsx. 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 npm/plugin-sdk/src/schema.ts:100 — `value !== null && typeof value === "object"` appears character-identically in 2 files — npm/plugin-sdk/src/schema.ts, npm/plugin-sdk/src/types.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×12
  • Silent fallback default in catch frontend/src/ui/selectionPreference.ts:12 — `loadSelectionPreference` swallows every exception into `return "accent"` — 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 apps/desktop/src/hooks/useAppearance.ts:22 — `storedAppearance` swallows every exception into `return "system"` — 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 apps/desktop/src/i18n/locale.tsx:59 — `storedLocale` swallows every exception into `return "zh-CN"` — 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 frontend/src/admin-react/model.ts:29 — `display` 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 frontend/src/runtime_storage.ts:18 — `loadAppearancePreference` swallows every exception into `return "system"` — 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 frontend/src/runtime_storage.ts:46 — `loadWorkspaceViewPreference` swallows every exception into `return "home"` — 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 frontend/src/runtime_storage.ts:62 — `loadRememberedRuntimeCredential` 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 frontend/src/runtime_storage.ts:100 — `loadDraft` 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 frontend/src/runtime-v2/components/WindowBoardSplit.tsx:7 — `WindowBoardSplit` swallows every exception into `return 400` — 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 npm/webcodex/bin/wrapper.js:108 — `captureProtectedNpmEnvironment` 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 plugins/agent-browser/src/config.ts:84 — `displayUrl` swallows every exception into `return '(unavailable)'` — 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 plugins/campus-application/src/mapping-memory.ts:58 — `mappingSiteIdentity` swallows every exception into `return "unknown"` — 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.
D10 · Test Quality · Mock-dominated test · ×11
  • Mock-dominated test: keeps Add Project a single non-replayed write after an uncertain result frontend/test-v2/relations.test.tsx:106 — This test sets up 4 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: edits the shared Session focus from the composer frontend/test-v2/window-collaboration.test.tsx:516 — 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.
  • Mock-dominated test: subscribes before consuming the pending initial target and acknowledges once apps/desktop/src/lib/desktop-navigation.test.ts:18 — This test sets up 3 test doubles (for example `vi.fn`) against 0 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: late registration after disposal unlistens without consuming native navigation apps/desktop/src/lib/desktop-navigation.test.ts:80 — 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: uses the exact installed environment for local service controls without applying effects on load apps/desktop/src/features/RuntimeShell.test.tsx:406 — 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: confirms Server interruption before applying tracing through a service restart apps/desktop/src/features/RuntimeShell.test.tsx:494 — 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: requires explicit Full trace confirmation, preserving the expected env revision apps/desktop/src/features/RuntimeShell.test.tsx:515 — 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: does not export to a late save-dialog result after %s apps/desktop/src/features/RuntimeShell.test.tsx:814 — This test sets up 5 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: cancels a folder choice when file-access settings unmount apps/desktop/src/features/WorkspaceSettings.test.tsx:130 — This test sets up 4 test doubles (for example `vi.fn`) 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: discards a folder choice after an intervening %s change, even when it changes back apps/desktop/src/features/WorkspaceSettings.test.tsx:157 — This test sets up 4 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: ignores a file-access mutation that completes after leaving the settings page apps/desktop/src/features/WorkspaceSettings.test.tsx:175 — This test sets up 3 test doubles (for example `vi.fn`) 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.
X7 · Silent fallback defaults · Silent fallback default on Err · ×8
  • Silent fallback default on Err crates/webcodex-cli/src/webcodex_cli/connections.rs:507 — `real_subdirs` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/webcodex-cli/src/webcodex_cli/connections.rs:541 — `connections_for_server` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/webcodex-cli/src/webcodex_cli/service.rs:828 — `query_status_output` turns every `Err` into `"unknown".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/webcodex-core/src/lsp_bridge.rs:573 — `to_stdout_json` turns every `Err` into `r#"{"format":"webcodex.agent_lsp_result.v1","success":false,"error":{"code":"lsp_protocol_error","message":"failed to serialize result"}}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/webcodex-core/src/validation_bridge.rs:211 — `to_stdout_json` turns every `Err` into `r#"{"format":"webcodex.validation_bridge_result.v1","success":false,"error":{"code":"protocol_error","message":"failed to serialize result"}}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/webcodex-runner/src/webcodex_runner/projects/catalog.rs:148 — `load_runner_project_shell_contexts_from_dir` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src/oauth_http/managed_authorize.rs:263 — `allowed_oauth_resource_indicators` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err src/project_entry_share.rs:243 — `read_persisted_share_project_roots` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
X9 · Subsumed condition operand · Subsumed condition operand · ×5
  • Subsumed condition operand src/tool_runtime/checkpoint.rs:645 — `lower.contains("client_secret=")` can never decide this `||` — every value satisfying `lower.contains("client_secret=")` also satisfies `lower.contains("secret=")`, 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 src/tool_runtime/validation.rs:153 — `lower.contains("working directory")` can never decide this `||` — every value satisfying `lower.contains("working directory")` also satisfies `lower.contains("directory")`, 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 src/tool_runtime/tests/files/search.rs:63 — `cmd.contains("/usr/bin/head")` can never decide this `||` — every value satisfying `cmd.contains("/usr/bin/head")` also satisfies `cmd.contains("/bin/head")`, 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 scripts/check_markdown_links.py:69 — `target.startswith("//")` can never decide this `||` — every value satisfying `target.startswith("//")` also satisfies `target.startswith("/")`, 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 crates/webcodex-environment/src/service/macos.rs:153 — `stderr.contains("service not found")` can never decide this `||` — every value satisfying `stderr.contains("service not found")` also satisfies `stderr.contains("not found")`, 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.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 210 significant file(s) lose their only recent owner: crates/webcodex-cli/src/webcodex_cli/login.rs, crates/webcodex-store/src/agent_wake.rs, crates/webcodex-lsp/src/supervisor.rs, crates/webcodex-cli/src/webcodex_cli/service.rs, src/tool_runtime/sessions/tests.rs, crates/webcodex-code-mode/src/runtime.rs, crates/webcodex-core/src/plugin.rs, crates/webcodex-runner/src/webcodex_runner/plugin.rs (+202 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 21 significant file(s) lose their only recent owner: scripts/e2e_generic_agent_ws.py, scripts/agent_temporal_evidence.py, crates/webcodex-cli/src/environment/update.rs, crates/webcodex-environment/src/unified_update/install.rs, integrations/codex/experience_proposals.py, crates/webcodex-environment/src/upgrade/status/tests.rs, crates/webcodex-workflow-session/src/task_context.rs, crates/webcodex-environment/src/unified_update/install/tests.rs (+13 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: apps/desktop/src-tauri/src/lifecycle_log.rs, apps/desktop/src-tauri/src/lifecycle_log/tests.rs, apps/desktop/src-tauri/src/platform/windows/session_shutdown.rs. Pair on, review, or document these before any departure.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure scripts/agent_temporal_evidence.py:328 — `_matches_python_command` returns `False` when `(SyntaxError, ValueError, RecursionError, tokenize.TokenError)` 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.
  • Silent fallback default on parse failure scripts/claude_window_headers.py:189 — `window_headers` returns `{}` when `(OSError, ValueError, UnicodeError)` 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.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 7 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 (243 single-owned of 1237 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; 1237 of the 1376 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)) (+1 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/tool_runtime/computer_tools/request.rs, crates/webcodex-browser/src/supervisor/reaper.rs, integrations/codex/session_recovery.py, integrations/codex/external_observation_hook.py, scripts/deb_lifecycle_acceptance.py, crates/webcodex-environment/src/upgrade/windows_package.rs, crates/webcodex-cli/src/webcodex_cli/controller_tui.rs, crates/webcodex-runner/src/webcodex_runner/coding_agent/diagnose.rs (+1 more).
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `docs/agent/architecture-decisions.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API crates/webcodex-environment/src/service/runtime.rs:29 — 1 public type in `webcodex_environment.service.runtime.implementation` is marked as implementation by its own namespace, folder or name: `ServiceStop` (crates/webcodex-environment/src/service/runtime.rs:29, `implementation`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 8/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/webcodex-admin`, `crates/webcodex-browser`, `crates/webcodex-cli`, `crates/webcodex-openai-tunnel` and 2 more.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation apps/desktop/package.json:14 — `apps/desktop/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`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code · Unused export 'readinessNextAction' · ×1
  • Unused export 'readinessNextAction' apps/desktop/src/i18n/presentation.ts:48 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'serverReadinessLabel' · ×1
  • Unused export 'serverReadinessLabel' apps/desktop/src/i18n/presentation.ts:229 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'runnerReadinessLabel' · ×1
  • Unused export 'runnerReadinessLabel' apps/desktop/src/i18n/presentation.ts:237 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'projectReadinessLabel' · ×1
  • Unused export 'projectReadinessLabel' apps/desktop/src/i18n/presentation.ts:245 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'runtimeLabel' · ×1
  • Unused export 'runtimeLabel' apps/desktop/src/i18n/presentation.ts:284 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'flush' · ×1
  • Unused module-local declaration 'flush' frontend/test-v2/admin_controller.test.ts:77 — 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.
R8 · Dependency Hygiene · Test-only dependency 'react' in production deps · ×1
  • Test-only dependency 'react' in production deps REDACTED:43 — Only test files import it (first: frontend/test-v2/navigation.test.tsx:2) — move it to devDependencies.
Minor — 16 finding(s)
D12 · Dependency Hygiene · Outdated · ×15
  • Outdated: agent-client-protocol-schema — `agent-client-protocol-schema` is locked at 1.7.0 but 1.18.0 is the current stable release on crates.io, and it already satisfies the `"1.7.0"` requirement declared in crates/webcodex-runner/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p agent-client-protocol-schema` and commit the updated REDACTED.
  • Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: chrono — `chrono` is locked at 0.4.44 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/webcodex-runner/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: futures-util — `futures-util` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.186 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: quinn — `quinn` is locked at 0.11.9 but 0.11.12 is the current stable release on crates.io, and it already satisfies the `"0.11"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p quinn` and commit the updated REDACTED.
  • Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.150 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.52.3 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • Outdated: unicase — `unicase` is locked at 2.9.0 but 2.10.0 is the current stable release on crates.io, and it already satisfies the `"2.9"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicase` and commit the updated REDACTED.
  • Outdated: uuid — `uuid` is locked at 1.23.1 but 1.29.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
  • Outdated: webpki-roots — `webpki-roots` is locked at 1.0.10 but 1.0.12 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/webcodex-runner/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webpki-roots` and commit the updated REDACTED.
  • Outdated: xcap — `xcap` is locked at 0.9.8 but 0.9.10 is the current stable release on crates.io, and it already satisfies the `"0.9.8"` requirement declared in crates/webcodex-computer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p xcap` and commit the updated REDACTED.
  • Outdated: xml — `xml` is locked at 1.3.0 but 1.4.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/webcodex-runner/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p xml` and commit the updated REDACTED.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: webcodex-tool-contracts — webcodex-tool-contracts: abstractness 0.00, instability 0.20, distance 0.80 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

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-1d32e9e605ef4fc3aae4afc2c244d6fb/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-1d32e9e605ef4fc3aae4afc2c244d6fb/history-1.json --exit-code 0 --source .3artifacts/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=414" --report-format json --report-path /tmp/watchdog-gitleaks-1d32e9e605ef4fc3aae4afc2c244d6fb/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1414 --max-count=382" --report-format json --report-path /tmp/watchdog-gitleaks-1d32e9e605ef4fc3aae4afc2c244d6fb/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1796 --max-count=395" --report-format json --report-path /tmp/watchdog-gitleaks-1d32e9e605ef4fc3aae4afc2c244d6fb/history-4.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-4.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-1d32e9e605ef4fc3aae4afc2c244d6fb/tree.json --exit-code 0 --source .1artifacts/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 --exclude frontend .31artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .59artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .2artifacts/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 9 file(s) — `apps/desktop/src/components/NavigationIcon.tsx`, `apps/desktop/src/features/extensions/extension-panel-registry.ts`, `apps/desktop/src/i18n/device-invitation.ts`, `apps/desktop/src/lib/desktop-api.ts`, `apps/desktop/src/lib/desktop-observation.ts`, … (+4 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1eb63-67bb-7d82-a46a-86654e93a0c8 · 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