Public report of rivet-dev/agentos, published 28 October 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.10.5). Watchdog 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, 28 October 2026, 15:25 UTC · Survey ID cd_1d5b5c7ad8f8422d9a4351b64fd68b03

rivet-dev/agentos

Measured 28 October 2026, 15:06 UTC, at code version 3c60c9a

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 51out 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 large codebase: 394,099 lines of product code in 205 projects, tests not counted · Estimated rebuild effort: about 4.0 person-years · Weakest lens: Production Readiness, 36

Findings by how serious they are

154 critical 2229 serious 146 minor

11 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 15:06 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 Watchdog. It is open to any tool that implements it, and today Watchdog 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. Watchdog works 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 ▸

84of 84 dimensions measured by tools.
2464of 2529 findings point to an exact file and line, so you can open each one in the code. The other 65 concern the repository as a whole, such as missing documentation.
84dimensions across 8 lenses, read from 394,099 lines of product code in 205 projects.
Chapters

Executive summary

rivet-dev/agentos is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back in part because it has uses of packages that aren't listed. It scores 51 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Production Readiness, at 36, is the weakest lens and counts most in the score. The best first step for the work it takes is making the three tests that check nothing check their results, worth about 5 points. Tidying the declared packages would lift Production Readiness itself, worth about 6 points. Raising Production Readiness to 62 would lift the score to about 62.

Seventy-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty-two known security holes in the packages the code depends on can be used by attackers, and thirteen pipeline steps run downloads nobody checks. Pinning each tool to an exact version, updating the vulnerable packages and checking each download against a checksum would close these risks. Fixing the weaknesses the scanner points to would fix the nine security weaknesses in the code, and the eight unsafe settings in infrastructure or container files need changing to safe values. The three tests that check nothing need to check the result they produce.

The product code is 394,099 lines, about €580,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.
Production Readiness 36 · counts for 45%Security and Compliance 59 · counts for 25%Code Health 59 · counts for 14%Performance 69 · counts for 8%Architecture 74 · counts for 4%Accessibility 74 · counts for 2%Maturity 82 · counts for 1%Event Sourcing 100 · counts for 1%

If Production Readiness rose from 36 to 62, the lowest score rated Strong, the score would rise from 51 to about 62.

Code composition: what the lines of code are
Product code 71%Tests 29%
Rebuild cost: about €580,000 · Estimate
Cost to rebuild€190,000 to €970,000, for 3,211 to 10,187 hours of work, about 4.0 person-years for 2 to 8 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 51. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 394,099 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

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

1
Resolve the 3 No assertions (empty test) finding(s) in Test Quality — start with libc-test-conformance.test.ts, os-test-conformance.test.ts, sidecar-exit.test.ts.
Raises the score by about 5 points · Low effort · Test Quality
2
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Raises the score by about 6 points · Medium effort · Dependency Hygiene
3
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Raises the score by about 2 points · Medium effort · Outbound HTTP resilience

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 €580,000 to build again, about 4.0 person-years of work. Its weakest lens is Production Readiness, at 36 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 3 No assertions (empty test) finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 3 Test Quality 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 6.7 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 158,227 lines over the last 90 days, which is about 641,698 lines a year. At that pace, the extra work comes to an estimated 51.3 to 307.7 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 Watchdog's 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 @agentos-software/build-essential build-essential @agentos-software/common common @agentos-software/build-essential->@agentos-software/common @agentos-software/everything everything @rivet-dev/agentos-core agentos-core @rivet-dev/agentos-runtime-core agentos-runtime-core @rivet-dev/agentos-core->@rivet-dev/agentos-runtime-core @rivet-dev/agentos-shell agentos-shell @rivet-dev/agentos-shell->@rivet-dev/agentos-core agentos-bridge agentos-bridge agentos-client agentos-client agentos-client->agentos-bridge agentos-vfs-core agentos-vfs-core agentos-client->agentos-vfs-core agentos-vm-config agentos-vm-config agentos-client->agentos-vm-config agentos-execution agentos-execution agentos-execution->agentos-bridge agentos-runtime agentos-runtime agentos-execution->agentos-runtime agentos-v8-runtime agentos-v8-runtime agentos-execution->agentos-v8-runtime agentos-kernel agentos-kernel agentos-kernel->agentos-bridge agentos-kernel->agentos-runtime agentos-kernel->agentos-vfs-core agentos-native-sidecar agentos-native-sidecar agentos-native-sidecar->agentos-bridge agentos-native-sidecar->agentos-client agentos-native-sidecar->agentos-execution agentos-native-sidecar->agentos-kernel agentos-native-sidecar-core agentos-native-sidecar-core agentos-native-sidecar->agentos-native-sidecar-core agentos-native-sidecar->agentos-runtime agentos-sidecar-protocol agentos-sidecar-protocol agentos-native-sidecar->agentos-sidecar-protocol agentos-native-sidecar->agentos-v8-runtime agentos-native-sidecar->agentos-vfs-core agentos-native-sidecar->agentos-vm-config agentos-native-sidecar-browser agentos-native-sidecar-browser agentos-native-sidecar-browser->agentos-bridge agentos-native-sidecar-browser->agentos-kernel agentos-native-sidecar-browser->agentos-native-sidecar-core agentos-native-sidecar-browser->agentos-sidecar-protocol agentos-native-sidecar-browser->agentos-vm-config agentos-native-sidecar-core->agentos-bridge agentos-native-sidecar-core->agentos-kernel agentos-native-sidecar-core->agentos-sidecar-protocol agentos-native-sidecar-core->agentos-vfs-core agentos-native-sidecar-core->agentos-vm-config agentos-shims agentos-shims wasi-ext wasi-ext agentos-shims->wasi-ext agentos-sidecar-protocol->agentos-vm-config agentos-v8-runtime->agentos-bridge agentos-v8-runtime->agentos-runtime agentos-vfs-core->agentos-runtime __more__ +183 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.

641 modules, with 1075 dependencies between them. 8 loops run through 69 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 601 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 agentos_bridge2 packages.core.src.runtime-compat3 packages.runtime-core.src.protocol-frames4 packages.runtime-core.src.sidecar-process5 uucore.lib.features.format.num_format6 agentos_client.fs7 agentos_expr8 ctrlc9 packages.core.src.agent-os10 packages.runtime-benchmarks.src.focused11 agentos_client.software12 agentos_runtime.accounting13 agentos_vfs_core.engine.error14 agentos_vfs_core.engine.types15 agentos_vfs_core.posix.vfs16 packages.core.src17 packages.runtime-browser.src18 packages.runtime-core.src19 uucore.lib.mods.error20 agentos_runtime.capability21 agentos_runtime.supervision22 agentos_vfs_core.posix.mount_plugin23 agentos_vfs_core.posix.root_fs24 agentos_kernel.kernel25 agentos_runtime26 agentos_v8_runtime.session27 agentos_execution.v8_host28 agentos_execution.javascript29 agentos_execution.python30 agentos_execution.wasm31 agentos_sidecar_protocol.protocol32 agentos_native_sidecar.state33 agentos_vm_config34 agentos_client.config35 agentos_client.agent_os36 agentos_native_sidecar_core.root_fs37 agentos_native_sidecar.vm38 agentos_native_sidecar.service39 agentos_native_sidecar.filesystem40 agentos_native_sidecar.stdio
1 agentos_bridge
2 packages.core.src.runtime-compat
3 packages.runtime-core.src.protocol-frames
4 packages.runtime-core.src.sidecar-process
5 uucore.lib.features.format.num_format
6 agentos_client.fs1
7 agentos_expr1
8 ctrlc1
9 packages.core.src.agent-os168
10 packages.runtime-benchmarks.src.focused9
11 agentos_client.software11
12 agentos_runtime.accounting21
13 agentos_vfs_core.engine.error11
14 agentos_vfs_core.engine.types1
15 agentos_vfs_core.posix.vfs121
16 packages.core.src17921
17 packages.runtime-browser.src2011
18 packages.runtime-core.src217241
19 uucore.lib.mods.error57
20 agentos_runtime.capability115
21 agentos_runtime.supervision213
22 agentos_vfs_core.posix.mount_plugin1111
23 agentos_vfs_core.posix.root_fs141122
24 agentos_kernel.kernel144111124
25 agentos_runtime3236
26 agentos_v8_runtime.session55
27 agentos_execution.v8_host221
28 agentos_execution.javascript1281248
29 agentos_execution.python12213311
30 agentos_execution.wasm112213111
31 agentos_sidecar_protocol.protocol222111
32 agentos_native_sidecar.state471412011511149224442
33 agentos_vm_config11118
34 agentos_client.config624
35 agentos_client.agent_os1101112412
36 agentos_native_sidecar_core.root_fs1111122
37 agentos_native_sidecar.vm11211328229111
38 agentos_native_sidecar.service111111211222262023
39 agentos_native_sidecar.filesystem1214221711
40 agentos_native_sidecar.stdio39312615534
Uses a module listed above itPart of a loopThe module itself
1 agentos_bridge2 packages.core.src.runtime-compat3 packages.runtime-core.src.protocol-frames4 packages.runtime-core.src.sidecar-process5 uucore.lib.features.format.num_format6 agentos_client.fs7 agentos_expr8 ctrlc9 packages.core.src.agent-os10 packages.runtime-benchmarks.src.focused11 agentos_client.software12 agentos_runtime.accounting13 agentos_vfs_core.engine.error14 agentos_vfs_core.engine.types15 agentos_vfs_core.posix.vfs16 packages.core.src17 packages.runtime-browser.src18 packages.runtime-core.src19 uucore.lib.mods.error20 agentos_runtime.capability21 agentos_runtime.supervision22 agentos_vfs_core.posix.mount_plugin23 agentos_vfs_core.posix.root_fs24 agentos_kernel.kernel25 agentos_runtime26 agentos_v8_runtime.session27 agentos_execution.v8_host28 agentos_execution.javascript29 agentos_execution.python30 agentos_execution.wasm31 agentos_sidecar_protocol.protocol32 agentos_native_sidecar.state33 agentos_vm_config34 agentos_client.config35 agentos_client.agent_os36 agentos_native_sidecar_core.root_fs37 agentos_native_sidecar.vm38 agentos_native_sidecar.service39 agentos_native_sidecar.filesystem40 agentos_native_sidecar.stdioagentos_bridge1packages.core.src.runtime-compat2packages.runtime-core.src.protocol-frames3packages.runtime-core.src.sidecar-process4uucore.lib.features.format.num_format5agentos_client.fs6agentos_expr7ctrlc8packages.core.src.agent-os9packages.runtime-benchmarks.src.focused10agentos_client.software11agentos_runtime.accounting12agentos_vfs_core.engine.error13agentos_vfs_core.engine.types14agentos_vfs_core.posix.vfs15packages.core.src16packages.runtime-browser.src17packages.runtime-core.src18uucore.lib.mods.error19agentos_runtime.capability20agentos_runtime.supervision21agentos_vfs_core.posix.mount_plugin22agentos_vfs_core.posix.root_fs23agentos_kernel.kernel24agentos_runtime25agentos_v8_runtime.session26agentos_execution.v8_host27agentos_execution.javascript28agentos_execution.python29agentos_execution.wasm30agentos_sidecar_protocol.protocol31agentos_native_sidecar.state32agentos_vm_config33agentos_client.config34agentos_client.agent_os35agentos_native_sidecar_core.root_fs36agentos_native_sidecar.vm37agentos_native_sidecar.service38agentos_native_sidecar.filesystem39agentos_native_sidecar.stdio4011116891121111121179212011217241571152131111141122144111124323655221128124812213311112213111222111471412011511149224442111186241101112412111112211211328229111111111211222262023121422171139312615534+601 more modules (most-connected shown)

At a glance — Code Health · 59% · Adequate · gated by D2 ·

At a glance — Architecture · 74% · Strong ·

At a glance — Maturity · 82% · Strong ·

At a glance — Readiness · 36% · Weak · gated by D12, R8, P7 ·

At a glance — Security · 59% · Adequate · gated by D29, D30, D36 ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Accessibility · 74% · Strong ·

At a glance — Performance · 69% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection119High / Critical
A03:2025 — Software Supply Chain Failures87High / Critical
A02:2025 — Security Misconfiguration12High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

First, clean up the dependency tree by removing unused packages and explicitly declaring imports to ensure a lean and transparent build. Next, address the three empty test files to improve test coverage and reliability. Then, harden outbound HTTP calls by enforcing strict timeouts and adding retry logic with back-off to prevent hangs and failures. Finally, enable automated dependency scanning tools and replace weak cryptographic hashes with stronger alternatives or non-cryptographic variants depending on their specific use case.

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

Do thisHelpsEffortDimension
Resolve the 3 No assertions (empty test) finding(s) in Test Quality — start with libc-test-conformance.test.ts, os-test-conformance.test.ts, sidecar-exit.test.ts.+4.5 ptsLowTest Quality
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+5.7 ptsMediumDependency Hygiene
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+2.3 ptsMediumOutbound HTTP resilience
Enable Dependabot/Renovate or a dependency-review gate.+1.4 ptsMediumSecurity & performance tooling
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED.+0.6 ptsLowSupply-chain Provenance & Signing
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 8 sites, not one: `crates/native-sidecar/src/execution/javascript/crypto.rs:268` (`Md5::digest`), `crates/native-sidecar/src/execution/javascript/crypto.rs:269` (`Sha1::digest`), `crates/native-sidecar/src/execution/javascript/crypto.rs:279` (`MessageDigest::md5`), `crates/native-sidecar/src/execution/javascript/crypto.rs:280` (`MessageDigest::sha1`), `crates/native-sidecar/src/execution/javascript/crypto.rs:1724` (`MessageDigest::md5`), `crates/native-sidecar/src/execution/javascript/crypto.rs:1725` (`MessageDigest::sha1`), `toolchain/stubs/uucore/src/lib/features/checksum/mod.rs:352` (`Md5::default`), `toolchain/stubs/uucore/src/lib/features/checksum/mod.rs:354` (`Sha1::default`). Each is a separate decision — fixing only the line this row cites leaves the others in place.+1.2 ptsMediumWeb-Security Posture
Resolve the 8 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3), REDACTED.+0.5 ptsLowIaC & Container Security
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED.+0.5 ptsLowSecrets (history)

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.6SlopDependency Vulnerabilities: High vulnerability: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
crates/native-sidecar/src/extension_services.rs5.5MixedCyclomatic Complexity: agentos_native_sidecar::extension_services::prepare_extension_service_command (cyclomatic 24)
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

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

Critical — 154

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

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

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

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

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

What we checked — 84 dimensions across the health lenses
D1D2D3D4D5D6D7D9D10D12D13D14D15D17D19D20D26D28D29D30D31D34D35D36D43AC2AC5AC7AX10AX3AX5AX6AX7AX8AX9ES1ES2M1M2M3M4P1P10P2P3P4P6P7PF1PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X27X28X29X3X30X4X5

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, 2464 of 2529 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog 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
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a1830c-acb5-7645-8cd0-e1acf26ae4d8.

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 — Watchdog 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 .ts, .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.3% — 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. In the meantime, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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,448 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 158 test source file(s) (.rs) 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 — Watchdog 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 `pnpm install --frozen-lockfile --ignore-scripts` in packages/agentos-sandbox/ (1 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/agentos-toolchain/ (18 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/build-tools/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/core/ (264 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/node-pty/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/posix/ (0 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/runtime-browser/ (153 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/runtime-core/ (167 tests); jest via `npm ci --ignore-scripts` in packages/runtime-core/tests/integration/projects/jest-native-resolver-blocked/ (1 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/runtime-core/tests/integration/projects/vitest-default-rolldown-native-blocked/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/runtime-core/tests/integration/projects/vitest-pass/; node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/runtime-sidecar/ (7 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 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.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the node:test suite in packages/build-tools/ was NOT MEASURED: the node:test run in packages/build-tools/ produced no per-test report (throw new Error(). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the node:test suite in packages/node-pty/ was NOT MEASURED: the node:test run in packages/node-pty/ produced no per-test report (throw new Error(). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/runtime-core/tests/integration/projects/vitest-default-rolldown-native-blocked/ was NOT MEASURED: the install for packages/runtime-core/tests/integration/projects/vitest-default-rolldown-native-blocked/ left no `vitest` binary under node_modules, so the suite could not be launched. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/runtime-core/tests/integration/projects/vitest-pass/ was NOT MEASURED: the install for packages/runtime-core/tests/integration/projects/vitest-pass/ left no `vitest` binary under node_modules, so the suite could not be launched. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (13 contributor(s) across 487 commit(s) sampled, automation and bot accounts excluded). One of them holds 83% of the history; the other 12 hold 1.4% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog 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 deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog 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 on C# first (docs/plans/deterministic-engine.md, P5): 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 — not measured this run — Watchdog 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 the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog 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.
  • D28 Secrets (history) — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. D28's config-credential rule (REDACTED) parses each committed `.json` config as a document and reads credential-named values; `packages/runtime-benchmarks/results/coldstart-resident-full-matrix-20260619.json` did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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. `packages/core/src/index.ts`, `packages/runtime-benchmarks/src/quick-gate.ts`, `packages/runtime-browser/src/sab-reactor.ts`, `packages/runtime-browser/src/worker.ts`, `packages/typescript/src/index.ts`, … (+34 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 — Watchdog 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.
  • AXR1 Runtime accessibility — not measured this run — Watchdog 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 (docker/dev/compose.yaml). compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c set -eux; curl -fsSL \"https://deb.nodesource.com/setup_${NODE_MAJOR}.x\" | bash -; apt-get install -y --no-install-recommends nodejs; corepack enable; corepack prepare \"pnpm@${PNPM_VERSION}\" --activate; rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100; runtime evidence skipped.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Rust, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Rust, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 — Watchdog measured this, but not all of it. What it 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 filesystem refused the listing or the read of: crates/agentos-sidecar/AGENTS.md. Every other path was read.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 306 further occurrence(s) are not listed individually; the score already reflects all 346.
  • R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 73 further occurrence(s) are not listed individually; the score already reflects all 113.
  • R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Kotlin, Scala, Go, Swift, Python and Ruby source only, and no C# was loaded, no Java, Kotlin, Scala, Go, Swift, Python or Ruby was found, and this repository's C, C++ is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 103 further occurrence(s) are not listed individually; the score already reflects all 143.

Repo exclusion declarations: 4 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — 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.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • 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.
  • 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.
  • 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.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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 Complexity5.4 / 10Adequate✓ 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 5.4 / 10 · rule-coverage 100% · ceiling Prevented

346 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc at 155. A further 64 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 RequestPayload::deserialize at 73 — they are counted neither in the figure above nor in this dimension's score. 18 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/sidecar-protocol/src/protocol.rs (RequestPayload::deserialize at 73), crates/native-sidecar-core/src/router.rs (agentos_native_sidecar_core::router::route_request_payload at 40), crates/native-sidecar-core/src/signals.rs (agentos_native_sidecar_core::signals::signal_number_from_name at 33), crates/bridge/src/queue_tracker.rs (TrackedLimit::as_str at 32), crates/native-sidecar-browser/src/wire_dispatch.rs (BrowserWireDispatcher::dispatch at 31), and 13 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.

agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc (cyclomatic 155) · ×37crates/native-sidecar/src/filesystem.rs:1564
NativeSidecar::poll_descendant_javascript_child_process (cyclomatic 141) · ×29crates/native-sidecar/src/execution/child_process.rs:8752
agentos_v8_runtime::session::session_thread (cyclomatic 98) · ×12crates/v8-runtime/src/session.rs:2238
agentos_execution::wasm::handle_internal_wasm_sync_rpc_request (cyclomatic 82) · ×9crates/execution/src/wasm.rs:1468
KernelVm::fd_socket_recvmsg (cyclomatic 23) · ×6crates/kernel/src/kernel.rs:3908

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc (cyclomatic 155), agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc (cyclomatic 154), agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc (cyclomatic 145). — 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 4 together lifts Cyclomatic Complexity from 5.4 to about 5.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity2.4 / 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.4 / 10 · rule-coverage 100% · ceiling Prevented

544 method(s) exceeded the cognitive complexity threshold of 15; the worst was NativeSidecar::poll_descendant_javascript_child_process at 394.

agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc (cognitive 326) · ×72crates/native-sidecar/src/execution/javascript/rpc.rs:2997
NativeSidecar::poll_descendant_javascript_child_process (cognitive 394) · ×34crates/native-sidecar/src/execution/child_process.rs:8752
agentos_v8_runtime::session::session_thread (cognitive 365) · ×14crates/v8-runtime/src/session.rs:2238
agentos_execution::wasm::handle_internal_wasm_sync_rpc_request (cognitive 143) · ×11crates/execution/src/wasm.rs:1468
AgentOs::exec_argv_process (cognitive 64) · ×9crates/client/src/process.rs:555

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

What to do

  1. Bring the 11 bodies over 120 down to 120 or less in Cognitive Complexity — start with NativeSidecar::poll_descendant_javascript_child_process (cognitive 394), agentos_v8_runtime::session::session_thread (cognitive 365), agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc (cognitive 326). — 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 11 together lifts Cognitive Complexity from 2.4 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

327 god class(es) detected.

FileTooLong: runners/wasm-runner.mjs · ×118crates/execution/assets/runners/wasm-runner.mjs
FunctionTooLong: agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc · ×108crates/native-sidecar/src/execution/javascript/rpc.rs:2997
MethodTooLong: OwnedLanguageSidecar.execute_language_operation_owned · ×46crates/native-sidecar/src/language_execution.rs:1235
ClassTooLong: KernelVm · ×28crates/kernel/src/kernel.rs:446
TooManyMethods: KernelVm · ×22crates/kernel/src/kernel.rs:446

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

What to do

  1. Resolve the 118 FileTooLong finding(s) in God Classes — start with lib.rs (6), stdio.rs (2), service.rs (2). — One of this dimension's main actionable groups (118 warning-level).
  2. Resolve the 108 FunctionTooLong finding(s) in God Classes — start with stdio.rs (5), http2.rs (5), rpc.rs (4). — One of this dimension's main actionable groups (108 warning-level).
  3. Resolve the 46 MethodTooLong finding(s) in God Classes — start with language_execution.rs (5), vm.rs (4), process.rs (4). — One of this dimension's main actionable groups (46 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.2 / 10Stronggated by 650 serious findings✓ Tool-verified

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

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

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

620 duplicated block group(s) detected. A further 30 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .ts (26% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (9 lines × 2) · ×56crates/client/src/agent_os.rs:516
Duplicated block (10 lines × 2) · ×46crates/execution/src/javascript.rs:7430
Duplicated block (7 lines × 2) · ×45crates/client/src/software.rs:1458
Duplicated block (8 lines × 2) · ×44crates/client/src/agent_os.rs:2336
Duplicated block (11 lines × 2) · ×39crates/client/src/agent_os.rs:1853

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

What to do

  1. Resolve the 56 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with child_process.rs (4), launch.rs (4), lib.rs (4). — One of this dimension's main actionable groups (56 warning-level).
  2. Resolve the 46 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with lib.rs (7), child_process.rs (4), process.rs (4). — One of this dimension's main actionable groups (46 warning-level).
  3. Resolve the 45 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with kernel.rs (4), tcp.rs (4), filesystem.rs (3). — One of this dimension's main actionable groups (45 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling9.5 / 10Stronggated by 13 serious findings✓ 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 9.5 / 10 · rule-coverage 100% · ceiling Prevented

203 production modules (Cargo+npm), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 12 module(s) off the main sequence, with abstractness counted on 47 of the 203 (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: agentos-diff · ×12
Unstable project @agentos-software/common

What to do

  1. Resolve the 12 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 1 Unstable project @agentos-software/common finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

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

3 of 271 classes have LCOM4 above 3.

Low cohesion: ActiveProcess (LCOM4 18) · ×3crates/native-sidecar/src/state.rs:2039

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with state.rs (2), extension_services.rs. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

Classify ADR enforcement: std patch: ExitStatusExt for wasm32-wasip1 · ×4toolchain/std-patches/0008-wasi-exit-status-ext.md

What to do

  1. Resolve the 4 Classify ADR enforcement finding(s) in Architectural Integrity — start with 0008-wasi-exit-status-ext.md, 0009-wasi-split-paths.md, 0002-wasi-fs-asyncify-inline.md. — One of this dimension's main actionable groups (4 recommendation-level).
  2. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D9 · Test Distribution9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

4046 test methods: 2743 unit, 1229 integration, 0 BDD, 74 e2e. The JavaScript/TypeScript suite contributes 1448 `it`/`test` case(s) across 263 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 2598 `#[test]` function(s) across 326 file(s) declaring at least one; its unit/integration split is Cargo's own — 127 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.8 / 10Adequategated by 3 critical findings✓ Tool-verified

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

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

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

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

No assertions (empty test): ${testName} — ${exclusion.reason} · ×3toolchain/conformance/libc-test-conformance.test.ts:285
No assertions: passes on the current tree · ×8scripts/verify-fixed-versions.test.mjs:25
Fixed-sleep synchronisation: interactive shell: tree / produces output and prompt returns · ×3software/tree/test/tree-test.nightly.test.ts:92
Skipped test: ${String(name)} [missing Google Drive credentials]packages/core/tests/google-drive-backend.test.ts:46
Skipped (documented): (unnamed test) · ×6software/ssh/test/ssh.nightly.test.ts:313

What to do

  1. Resolve the 3 No assertions (empty test) finding(s) in Test Quality — start with libc-test-conformance.test.ts, os-test-conformance.test.ts, sidecar-exit.test.ts. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 8 No assertions finding(s) in Test Quality — start with verify-fixed-versions.test.mjs (5), ctrl-c-shell-behavior.nightly.test.ts, signal-forwarding.nightly.test.ts. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 3 Fixed-sleep synchronisation finding(s) in Test Quality — start with tree-test.nightly.test.ts (2), vim-interactive.nightly.test.ts. — One of this dimension's main actionable groups (3 warning-level).
  4. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D12 · Dependency Hygiene8.2 3.8 / 10Weak✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 3.8 / 10 · rule-coverage 47% · ceiling Verified

37 outdated, 0 yanked direct Cargo dependencies. 102 of 218 direct crates were graded against crates.io (0 not published there, 116 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: anyhow · ×37

What to do

  1. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 490 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.1 / 10Stronggated by 35 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.1 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: crates/native-sidecar/src/execution/child_process.rs (15×141=2115); crates/native-sidecar/src/execution/javascript/rpc.rs (7×154=1078); crates/v8-runtime/src/session.rs (8×98=784) Repeated repair below the complexity floor: crates/native-sidecar/src/state.rs (7 of 11 changes were fixes); crates/native-sidecar/src/execution/mod.rs (6 of 10 changes were fixes); crates/native-sidecar/src/execution/coordinator.rs (5 of 7 changes were fixes)

Hotspot: crates/native-sidecar/src/execution/child_process.rs · ×27crates/native-sidecar/src/execution/child_process.rs:8752
Repeated repair: crates/native-sidecar/src/state.rs · ×8crates/native-sidecar/src/state.rs:123

What to do

  1. Resolve the 27 Hotspot finding(s) in Churn × Complexity Hotspots — start with process.rs (2), lib.rs (2), child_process.rs. — One of this dimension's main actionable groups (27 warning-level).
  2. Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with state.rs, mod.rs, coordinator.rs. — One of this dimension's main actionable groups (8 warning-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 39 serious findings✓ 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

39 deducted task-comment markers across 394099 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.

TodoComment · ×39software/ssh/test/ssh.nightly.test.ts:241

What to do

  1. Resolve the 39 TodoComment finding(s) in Explicit Debt — start with process_event_broker.rs (8), child_process.rs (5), e2e-npm-suite.nightly.test.ts (3). — One of this dimension's main actionable groups (39 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

0 of 4 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.

D26 · Project Cohesion9.6 / 10Exemplary✓ Tool-verified

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

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

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

4 of 205 build units (Cargo, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

✓ On the Gold path — maintain.

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

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

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

REDACTED

What to do

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

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

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

119 finding(s): 0 critical, 105 high, 14 medium, 0 low. 79 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 61 file(s) — `crates/execution/assets/runners/wasm-runner.mjs`, `crates/native-sidecar/src/execution/child_process.rs` (line 11573), `REDACTED`, `packages/core/src/agent-os.ts`, `packages/core/src/index.ts` (line 43, line 83), … (+56 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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.

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

79 finding(s): 4 critical, 28 high, 41 medium, 6 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 25 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (22), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (25 issue-level).
  2. Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 3 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2), 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 Security6.9 / 10Adequate✓ 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 6.9 / 10 · rule-coverage 100% · ceiling Documented

12 finding(s): 0 critical, 8 high, 4 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 8 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 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 448 of the 728 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored 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. SCORED, not informational.

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.

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.

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.

AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — your Biome config enables no a11y rules and there's no axe/pa11y/Lighthouse in tests or CI. Start by turning on Biome's own a11y rule group to catch issues at author time. What was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.

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.

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

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

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

  • `VirtualFileSystem` declares 23 required operations: `readFile`, `readTextFile`, `readDir`, `readDirWithTypes`, `writeFile`, `createDir`, `mkdir`, `exists`, `stat`, `removeFile`, `removeDir`, `rename`, `realpath`, `symlink`, `readlink`, `lstat`, `link`, `chmod`, `chown`, `utimes`, `truncate`, `pread`, `pwrite`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. (×4) — REDACTED:139, packages/core/src/runtime.ts:33, packages/runtime-browser/src/runtime.ts:51, …
  • `Kernel` declares 20 required operations: `mount`, `dispose`, `exec`, `spawn`, `openShell`, `connectTerminal`, `mountFs`, `unmountFs`, `readFile`, `writeFile`, `mkdir`, `readdir`, `readdirRecursive`, `stat`, `exists`, `removeFile`, `removeDir`, `removePath`, `rename`, `movePath`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. (×2) — REDACTED:447, packages/core/src/runtime.ts:328
  • `BenchVm` declares 16 required operations: `writeFile`, `mkdir`, `delete`, `readFile`, `readDir`, `readdir`, `readDirWithTypes`, `exec`, `execArgv`, `spawnNodeCapture`, `spawn`, `waitProcess`, `execWasmCommand`, `getResourceSnapshot`, `dispose`, `sidecarPid`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — packages/runtime-benchmarks/src/lib/vm.ts:35
  • `Kernel` declares 21 required operations: `mount`, `dispose`, `exec`, `spawn`, `openShell`, `connectTerminal`, `mountFs`, `unmountFs`, `readFile`, `writeFile`, `mkdir`, `readdir`, `stat`, `exists`, `removeFile`, `removeDir`, `rename`, `pwrite`, `vmFetch`, `registerHostFunctions`, `getResourceSnapshot`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — packages/runtime-core/src/test-runtime.ts:476

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX7 · Slice cohesion6.8 / 10Strong✓ Tool-verified

Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.

Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.

  • `UtmpxIter` (slice 'utmpx') depends on `SystemdUtmpxIter` from slice 'systemd_logind'. — toolchain/stubs/uucore/src/lib/features/utmpx.rs:394

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. 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.

ES1 · Fold determinism10.0 / 10Exemplary✓ 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.

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.

M1 · Documentation (README)6.9 / 10Strong✓ Tool-verified

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • 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.
  • Add a README to the 237 of 264 project(s) that lack one — worth up to 1.8 pts.
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.

What to do

  • Grow the ADR log (currently 4) — reach 8 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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 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.

P2 · Observability5.1 / 10Adequate✓ 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 7/147 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/execution/assets/undici-shims`, `crates/native-baseline`, `packages/agentos-toolchain`, `packages/build-tools` and 135 more.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
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.

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 & Rollback7.0 / 10Strong✓ Tool-verified

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

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

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.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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

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

  • `ureq::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/native-sidecar/src/plugins/google_drive.rs:375, crates/native-sidecar/src/plugins/google_drive.rs:411
  • `ureq::post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/native-sidecar/src/plugins/google_drive.rs:435, crates/native-sidecar/src/plugins/google_drive.rs:574
  • `ureq::request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/native-sidecar/src/plugins/google_drive.rs:469
  • `ureq::delete(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/native-sidecar/src/plugins/google_drive.rs:492
  • `http.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — packages/runtime-benchmarks/src/families/net.ts:92

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

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

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

PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language 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.

  • `readSync` in `read` 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. — REDACTED:137
  • `closeSync` in `close` 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. — REDACTED:143
  • `fs.closeSync` in `close` 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. — REDACTED:380
  • `fs.fstatSync` in `stat` 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. — REDACTED:393
  • `fs.fsyncSync` in `sync` 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. — REDACTED:397
  • `fs.ftruncateSync` in `truncate` 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. — REDACTED:404
  • `fs.chmodSync` in `chmod` 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. — REDACTED:412
  • `fs.chownSync` in `chown` 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. — REDACTED:420
  • `fs.futimesSync` in `utimes` 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. — REDACTED:424
  • `fs.readSync` in `read` 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. — REDACTED:446
  • `fs.writeSync` in `write` 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) — REDACTED:462, REDACTED:470
  • `fs.readSync` in `_readAllContent` 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. — REDACTED:1513
  • `fs.writevSync` in `callback to void` 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. — REDACTED:1809
  • `fs.readFileSync` in `callback to void` 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. — REDACTED:1819
  • `fs.writeFileSync` in `callback to void` 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) — REDACTED:1831, REDACTED:1833
  • `fs.openSync` in `fsReadFileAsync` 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. — REDACTED:2410
  • `fs.cpSync` in `cp` 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. — REDACTED:3905
  • `fs.mkdtempSync` in `mkdtemp` 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. — REDACTED:3908
  • `fs.opendirSync` in `opendir` 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. — REDACTED:3911
  • `fs.openSync` in `open` 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. — REDACTED:3914
  • `fs.statfsSync` in `statfs` 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. — REDACTED:3917
  • `fs.globSync` in `glob` 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. — REDACTED:3920
  • `fs.rmSync` in `rm` 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. — REDACTED:3926
  • `fs.lchownSync` in `lchown` 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. — REDACTED:3935
  • `fs.realpathSync` in `realpath` 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. — REDACTED:3950
  • `mkdtempSync` in `runNodeProgramMeasured` 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. — packages/runtime-benchmarks/src/lib/layers.ts:240
  • `writeFileSync` in `runNodeProgramMeasured` 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. — packages/runtime-benchmarks/src/lib/layers.ts:243
  • `execFileSync` in `runNodeProgramMeasured` 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. — packages/runtime-benchmarks/src/lib/layers.ts:258
  • `rmSync` in `runNodeProgramMeasured` 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. — packages/runtime-benchmarks/src/lib/layers.ts:275
  • `execFileSync` in `runNativeLayerMeasured` 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. — packages/runtime-benchmarks/src/lib/native.ts:95

What to do

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

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication8.5 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.

  • 80 duplicated blocks under packages/ have copies in at least two of the sibling directories build-tools, core, manifest, runtime-browser, runtime-core — 68 of them are reported below, and 12 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 80 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 80 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 80 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. — packages/runtime-browser/src/os-filesystem.ts:44
  • packages/runtime-browser/src/os-filesystem.ts:44 · packages/runtime-core/src/test-runtime.ts:649 — the two spans are one implementation copied and then locally edited — 2203 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. — packages/runtime-browser/src/os-filesystem.ts:44
  • REDACTED:1259 · REDACTED:1027 — the two spans are one implementation copied and then locally edited — 1499 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. — REDACTED:1259
  • REDACTED:1759 · packages/runtime-core/src/test-runtime.ts:2461 — 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. — REDACTED:1759
  • REDACTED:2770 · REDACTED:2173 — the two spans are one implementation copied and then locally edited — 1242 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. — REDACTED:2770
  • REDACTED:822 · packages/runtime-core/src/test-runtime.ts:1385 — 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. — REDACTED:822
  • REDACTED:2205 · packages/runtime-core/src/test-runtime.ts:2862 — the two spans are one implementation copied and then locally edited — 983 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. — REDACTED:2205
  • packages/core/src/runtime.ts:1 · packages/runtime-core/src/test-runtime.ts:123 — the two spans are one implementation copied and then locally edited — 1016 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. — packages/core/src/runtime.ts:1
  • REDACTED:2443 · packages/runtime-core/src/test-runtime.ts:3217 — the two spans are one implementation copied and then locally edited — 786 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. — REDACTED:2443
  • REDACTED:322 · packages/core/src/runtime.ts:203 — 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. — REDACTED:322
  • REDACTED:1052 · REDACTED:839 — 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. — REDACTED:1052
  • crates/execution/assets/runners/python-runner.mjs:479 · crates/execution/assets/runners/python-runner.mjs:706 — 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. — crates/execution/assets/runners/python-runner.mjs:479
  • packages/build-tools/bridge-src/builtins/http.ts:3835 · packages/build-tools/bridge-src/builtins/http.ts:4012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/build-tools/bridge-src/builtins/http.ts:3835
  • REDACTED:1572 · packages/runtime-core/src/test-runtime.ts:2155 — 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. — REDACTED:1572
  • REDACTED:352 · REDACTED:236 — the two spans are one implementation copied and then locally edited — 595 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. — REDACTED:352
  • packages/core/src/sidecar/cargo.ts:1 · packages/runtime-core/src/cargo.ts:1 — these 2 files are line-for-line copies of one another — 104 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — packages/core/src/sidecar/cargo.ts:1
  • packages/runtime-browser/src/converged-net-bridge.ts:70 · packages/runtime-browser/src/converged-pty-bridge.ts:54 — the two spans are one implementation copied and then locally edited — 541 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. — packages/runtime-browser/src/converged-net-bridge.ts:70
  • packages/build-tools/bridge-src/builtins/child-process.ts:809 · packages/build-tools/bridge-src/builtins/child-process.ts:948 — 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. — packages/build-tools/bridge-src/builtins/child-process.ts:809
  • REDACTED:1890 · REDACTED:1490 — 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. — REDACTED:1890
  • REDACTED:2502 · REDACTED:1918 — 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. — REDACTED:2502
  • REDACTED:2087 · packages/runtime-core/src/test-runtime.ts:2747 — the two spans are one implementation copied and then locally edited — 578 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. — REDACTED:2087
  • packages/runtime-core/src/sidecar-process.ts:739 · packages/runtime-core/src/sidecar-process.ts:1581 — the two spans are one implementation copied and then locally edited — 352 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. — packages/runtime-core/src/sidecar-process.ts:739
  • REDACTED:265 · REDACTED:154 — 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. — REDACTED:265
  • REDACTED:1387 · packages/runtime-core/src/test-runtime.ts:1972 — 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. — REDACTED:1387
  • crates/execution/assets/undici-shims/http.js:3 · crates/execution/assets/undici-shims/https.js:3 — 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. — crates/execution/assets/undici-shims/http.js:3
  • packages/build-tools/bridge-src/builtins/builtin-modules.ts:349 · packages/build-tools/bridge-src/builtins/stdin.ts:379 — the two spans are one implementation copied and then locally edited — 423 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. — packages/build-tools/bridge-src/builtins/builtin-modules.ts:349
  • REDACTED:763 · packages/runtime-core/src/test-runtime.ts:1272 — 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. — REDACTED:763
  • crates/execution/assets/runners/wasi-module.js:2709 · crates/execution/assets/runners/wasm-runner.mjs:12222 — the two spans are one implementation copied and then locally edited — 342 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. — crates/execution/assets/runners/wasi-module.js:2709
  • REDACTED:1231 · packages/runtime-core/src/test-runtime.ts:1795 — 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. — REDACTED:1231
  • REDACTED:55 · packages/runtime-core/src/test-runtime.ts:58 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — REDACTED:55
  • REDACTED:2672 · REDACTED:2088 — 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. — REDACTED:2672
  • packages/core/src/options-schema.ts:61 · packages/runtime-core/src/node-runtime-options-schema.ts:43 — 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. — packages/core/src/options-schema.ts:61
  • REDACTED:758 · REDACTED:641 — 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. — REDACTED:758
  • crates/execution/assets/runners/wasm-runner.mjs:3428 · crates/execution/assets/runners/wasm-runner.mjs:6345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/execution/assets/runners/wasm-runner.mjs:3428
  • packages/build-tools/bridge-src/builtins/child-process.ts:764 · packages/build-tools/bridge-src/builtins/child-process.ts:903 — 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. — packages/build-tools/bridge-src/builtins/child-process.ts:764
  • packages/core/src/options-schema.ts:15 · packages/runtime-core/src/node-runtime-options-schema.ts:5 — 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. — packages/core/src/options-schema.ts:15
  • REDACTED:1322 · packages/runtime-core/src/test-runtime.ts:1889 — 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. — REDACTED:1322
  • crates/execution/assets/runners/wasm-runner.mjs:6699 · crates/execution/assets/runners/wasm-runner.mjs:6815 — 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. — crates/execution/assets/runners/wasm-runner.mjs:6699
  • REDACTED:1140 · packages/runtime-core/src/test-runtime.ts:1704 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — REDACTED:1140
  • secure-exec/src/index.ts:55 · secure-exec/src/typescript.ts:22 — 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. — secure-exec/src/index.ts:55

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.4 / 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.

  • REDACTED:18 imports undici/lib/api/index.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:18
  • REDACTED:19 imports undici/lib/dispatcher/agent.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:19
  • REDACTED:20 imports undici/lib/dispatcher/client.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:20
  • REDACTED:21 imports undici/lib/web/fetch/index.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:21
  • REDACTED:22 imports undici/lib/web/fetch/formdata.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:22
  • REDACTED:23 imports undici/lib/global.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:23
  • REDACTED:24 imports undici/lib/web/fetch/headers.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:24
  • REDACTED:25 imports undici/lib/web/fetch/request.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:25
  • REDACTED:26 imports undici/lib/web/fetch/response.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:26
  • REDACTED:27 imports undici/lib/web/webidl/index.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:27
  • REDACTED:78 imports undici/lib/util/runtime-features.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:78
  • packages/core/tests/sandbox-integration.test.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../../agentos-sandbox/src/index.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/core/tests/sandbox-integration.test.ts:3
  • packages/vm-test-harness/src/index.ts:63 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/vm-test-harness/src/index.ts:63
  • packages/vm-test-harness/src/index.ts:72 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/vm-test-harness/src/index.ts:72
  • packages/vm-test-harness/src/index.ts:88 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/vm-test-harness/src/index.ts:88
  • packages/vm-test-harness/src/index.ts:95 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/vm-test-harness/src/index.ts:95
  • scripts/publish/verify-common-software.mjs:12 reaches into another package with a relative path (../../software/common/package.json) — import the package by name instead. — scripts/publish/verify-common-software.mjs:12

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity5.0 / 10Adequate✓ Tool-verified

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

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

  • toGeneratedRequestPayload has cyclomatic complexity 116 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. — packages/runtime-core/src/request-payloads.ts:405
  • net_poll has cyclomatic complexity 99 and cognitive complexity 227; 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. — crates/execution/assets/runners/wasm-runner.mjs:5344
  • _pollOneoff has cyclomatic complexity 77 and cognitive complexity 134; 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. — crates/execution/assets/runners/wasi-module.js:2495
  • _pumpBridgeReads has cyclomatic complexity 69 and cognitive complexity 122; 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. — packages/build-tools/bridge-src/builtins/net.ts:2735
  • fromGeneratedResponsePayload has cyclomatic complexity 66 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. — packages/runtime-core/src/response-payloads.ts:329
  • http2Dispatch has cyclomatic complexity 62 and cognitive complexity 81; 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. — packages/build-tools/bridge-src/builtins/http2.ts:1994
  • poll_oneoff has cyclomatic complexity 61 and cognitive complexity 102; 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. — crates/execution/assets/runners/wasm-runner.mjs:12064
  • _fdRead has cyclomatic complexity 58 and cognitive complexity 103; 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. — crates/execution/assets/runners/wasi-module.js:1677
  • net_recv has cyclomatic complexity 56 and cognitive complexity 84; 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. — crates/execution/assets/runners/wasm-runner.mjs:6238
  • (anonymous) has cyclomatic complexity 55 and cognitive complexity 73; 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. — packages/core/src/test/sandbox-agent.ts:238
  • decodeSpawnActions has cyclomatic complexity 52 and cognitive complexity 97; 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. — crates/execution/assets/runners/wasm-runner.mjs:1614
  • _fdWrite has cyclomatic complexity 51 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/execution/assets/runners/wasi-module.js:1404
  • spawnSync has cyclomatic complexity 51 and cognitive complexity 60; 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. — packages/build-tools/bridge-src/builtins/child-process.ts:1535
  • fd_recvmsg_rights has cyclomatic complexity 49 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/execution/assets/runners/wasm-runner.mjs:8466
  • proc_spawn_v2 has cyclomatic complexity 49 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 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. — crates/execution/assets/runners/wasm-runner.mjs:6842
  • fd_read has cyclomatic complexity 45 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/execution/assets/runners/wasm-runner.mjs:10639
  • spawn has cyclomatic complexity 42 and cognitive complexity 59; 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. — packages/build-tools/bridge-src/builtins/child-process.ts:1361
  • path_open has cyclomatic complexity 41 and cognitive complexity 56; 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. — crates/execution/assets/runners/wasm-runner.mjs:10082

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files4.9 / 10Adequate✓ 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.

  • crates/execution/assets/runners/wasm-runner.mjs has 12045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/execution/assets/runners/wasm-runner.mjs:1
  • packages/core/src/agent-os.ts has 6149 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/agent-os.ts:1
  • packages/runtime-browser/src/runtime.ts has 4831 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-browser/src/runtime.ts:1
  • packages/build-tools/bridge-src/builtins/http.ts has 4648 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/http.ts:1
  • REDACTED has 4312 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
  • packages/build-tools/bridge-src/builtins/net.ts has 3798 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/net.ts:1
  • packages/runtime-browser/src/worker.ts has 3562 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-browser/src/worker.ts:1
  • REDACTED has 3428 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
  • packages/runtime-core/src/test-runtime.ts has 3233 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-core/src/test-runtime.ts:1
  • crates/execution/assets/runners/wasi-module.js has 2685 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/execution/assets/runners/wasi-module.js:1
  • packages/build-tools/bridge-src/builtins/http2.ts has 2473 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/http2.ts:1
  • REDACTED has 2442 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
  • crates/execution/assets/runners/python-runner.mjs has 2388 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/execution/assets/runners/python-runner.mjs:1
  • REDACTED has 2345 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
  • packages/runtime-core/src/sidecar-process.ts has 1954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-core/src/sidecar-process.ts:1
  • packages/build-tools/bridge-src/builtins/child-process.ts has 1810 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/child-process.ts:1
  • packages/build-tools/bridge-src/global-exposure.ts has 1681 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/global-exposure.ts:1
  • packages/runtime-core/src/node-runtime.ts has 1397 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-core/src/node-runtime.ts:1
  • packages/build-tools/bridge-src/builtins/dgram.ts has 1323 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/dgram.ts:1
  • packages/build-tools/bridge-src/builtins/crypto.ts has 1257 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/crypto.ts:1
  • packages/build-tools/bridge-src/builtins/process.ts has 1167 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/process.ts:1
  • packages/runtime-browser/src/runtime-driver.ts has 1104 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-browser/src/runtime-driver.ts:1
  • packages/build-tools/bridge-src/builtins/builtin-modules.ts has 1056 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/builtin-modules.ts:1
  • packages/typescript/src/index.ts has 864 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/typescript/src/index.ts:1
  • packages/runtime-core/src/request-payloads.ts has 796 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-core/src/request-payloads.ts:1
  • packages/runtime-core/src/response-payloads.ts has 744 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-core/src/response-payloads.ts:1
  • packages/shell/src/main.ts has 699 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/shell/src/main.ts:1
  • packages/build-tools/bridge-src/builtins/misc-stubs.ts has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/misc-stubs.ts:1
  • packages/runtime-core/src/protocol-client.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. — packages/runtime-core/src/protocol-client.ts:1
  • packages/runtime-core/src/event-buffer.ts has 557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-core/src/event-buffer.ts:1
  • packages/build-tools/bridge-src/builtins/timers.ts has 525 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/timers.ts:1
  • packages/build-tools/bridge-src/builtins/console.ts has 521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/console.ts:1
  • packages/agentos-toolchain/src/aospkg.ts has 516 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/agentos-toolchain/src/aospkg.ts:1
  • scripts/pipboy/src/cli.ts has 481 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — scripts/pipboy/src/cli.ts:1
  • packages/core/src/sandbox.ts has 460 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/sandbox.ts:1
  • packages/runtime-browser/src/driver.ts has 449 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-browser/src/driver.ts:1
  • packages/runtime-browser/src/os-filesystem.ts has 447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/runtime-browser/src/os-filesystem.ts:1
  • packages/build-tools/bridge-src/builtins/stdin.ts has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/build-tools/bridge-src/builtins/stdin.ts:1
  • packages/core/src/options-schema.ts has 412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/options-schema.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 Coverage6.0 / 10Adequate✓ 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. (×40) — crates/execution/assets/runners/wasm-runner.mjs:1, packages/build-tools/bridge-src/builtins/http.ts:1, REDACTED:1, …

What to do

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

What to do

  • Bump outdated dependencies to current versions to limit upgrade debt.
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 Code7.8 / 10Strong✓ 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.

  • 1 file(s) (~2 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — packages/runtime-core/tests/integration/projects/typescript-cli-pass
  • 2 file(s) (~13 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — packages/runtime-core/tests/integration/projects/vitest-default-rolldown-native-blocked
  • Unreachable from the 354 application, 40 tooling and 445 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (354 application, 40 tooling, 445 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/build-tools/bridge-src/polyfills/abort.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/build-tools/bridge-src/polyfills/dom-events.ts
  • no import path from any entry point (354 application, 40 tooling, 445 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 (×11) — packages/build-tools/bridge-src/polyfills/abort.ts, packages/playground/frontend/runtime-harness.js, packages/runtime-benchmarks/src/quick-gate.ts, …
  • Nothing imports this binding — it is safe to review for removal. (×14) — packages/runtime-benchmarks/bench-utils.ts:38, packages/runtime-benchmarks/bench-utils.ts:42, packages/runtime-benchmarks/bench-utils.ts:46, …
  • 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. (×7) — crates/execution/assets/runners/python-runner.mjs:441, packages/core/src/agent-os.ts:934, packages/core/src/agent-os.ts:973, …
  • This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments. (×3) — packages/core/src/agent-os.ts:2759, packages/core/src/agent-os.ts:2766, packages/core/src/agent-os.ts:2768
  • Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used. — packages/core/src/agent-os.ts:5341

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 Hygiene0.0 / 10Critical✓ Tool-verified

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

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

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×2) — crates/execution/assets/undici-shims/websocket-lazy.js:7, packages/runtime-core/tests/integration/projects/jest-native-resolver-blocked/src/index.cjs:5
  • Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2)
  • Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.

What to do

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

  • packages/build-tools/bridge-src/builtins/builtin-modules.ts → packages/build-tools/bridge-src/builtins/console.ts → packages/build-tools/bridge-src/builtins/events.ts → packages/build-tools/bridge-src/builtins/process.ts → packages/build-tools/bridge-src/builtins/builtin-modules.ts (one verified cycle inside a mutually-dependent group of 21 files) — packages/build-tools/bridge-src/builtins/builtin-modules.ts:20
  • REDACTED → REDACTED → REDACTED — REDACTED:15

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×8) — crates/native-sidecar/src/execution/javascript/crypto.rs:268, crates/native-sidecar/src/execution/javascript/crypto.rs:269, crates/native-sidecar/src/execution/javascript/crypto.rs:279, …

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 8 sites, not one: `crates/native-sidecar/src/execution/javascript/crypto.rs:268` (`Md5::digest`), `crates/native-sidecar/src/execution/javascript/crypto.rs:269` (`Sha1::digest`), `crates/native-sidecar/src/execution/javascript/crypto.rs:279` (`MessageDigest::md5`), `crates/native-sidecar/src/execution/javascript/crypto.rs:280` (`MessageDigest::sha1`), `crates/native-sidecar/src/execution/javascript/crypto.rs:1724` (`MessageDigest::md5`), `crates/native-sidecar/src/execution/javascript/crypto.rs:1725` (`MessageDigest::sha1`), `toolchain/stubs/uucore/src/lib/features/checksum/mod.rs:352` (`Md5::default`), `toolchain/stubs/uucore/src/lib/features/checksum/mod.rs:354` (`Sha1::default`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification6.9 / 10Strong✓ Tool-verified

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

  • This function unwraps IPv4-MAPPED IPv6 (`to_ipv4_mapped`, line 53) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 52 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — crates/kernel/src/network_policy.rs:52

What to do

  • Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

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

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

X18 · Disposal-pattern correctness5.2 / 10Adequate✓ Tool-verified

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

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

  • `kernel` is never created by `NodeRuntime` — it is the constructor parameter `kernel` (line 570), and its declared type `Kernel` is an interface — yet this class disposes it here (line 1140). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — packages/runtime-core/src/node-runtime.ts:1140
  • `protocolClient` is never created by `SidecarProcess` — it is the constructor parameter `protocolClient` (line 354), and its declared type `SidecarProcessTransport` is an interface — yet this class disposes it here (line 1886). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — packages/runtime-core/src/sidecar-process.ts:1886
  • `#kernel` is never created by `AgentOs` — it is the constructor parameter `kernel` (line 2888), and its declared type `Kernel` is an interface — yet this class disposes it here (line 5955). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — packages/core/src/agent-os.ts:5955
  • `driver` is never created by `CronManager` — it is the constructor parameter `driver` (line 63), and its declared type `ScheduleDriver` is an interface — yet this class disposes it here (line 129). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — packages/core/src/cron/cron-manager.ts:129

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

X2 · Cancellation propagation6.6 / 10Adequate✓ Tool-verified

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

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

  • Only 3/7 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `get` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — scripts/publish/verify-common-software.mjs:29
  • `crateVersionExists` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — scripts/publish/src/ci/bin.ts:52
  • `fetch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:926
  • `httpRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:949

What to do

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

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

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

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

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

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

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

  • `LANGUAGE_ICONS[proc.language]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/playground/frontend/app.js:329
  • `addProcessMenu.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/playground/frontend/app.js:450

What to do

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

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

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

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

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen.

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

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

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

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

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

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

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

X3 · Exception handling5.1 / 10Adequate✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×27) — scripts/publish/src/lib/r2.ts:143, packages/typescript/src/index.ts:303, packages/typescript/src/index.ts:431, …
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×11) — REDACTED:415, REDACTED:1608, REDACTED:1611, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — packages/runtime-browser/src/root-filesystem-from-vfs.ts:57, packages/runtime-browser/src/sab-reactor.ts:202

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging7.7 / 10Strong✓ Tool-verified

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

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

  • `warn!` at line 5398 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/native-sidecar/src/service.rs:5398
  • `error!` at line 3687 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/native-sidecar/src/stdio.rs:3687

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.8 / 10Exemplary✓ Tool-verified

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

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

  • 98/99 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~0.3 `!` null assertions per 1k TypeScript source lines — 32 assertion(s) across the 100133 source line(s) of the 286 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (12), packages/core/src/agent-os.ts (5), REDACTED (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

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

WCAG coverage — what static analysis assessed

Statically assessed 3 of 55 WCAG 2.2 Level A/AA success criteria (5%; ≈6% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 52 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
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 52 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.1, 2.2.2, 2.3.1, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.1, 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 Health59%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture74%StrongSolid.
Maturity82%StrongSolid.
Readiness36%Weak — gated by D12, R8, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security59%Adequate — gated by D29, D30, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Accessibility74%StrongSolid.
Performance69%StrongSolid.
Unscored — 3 check(s) recorded observations but carry no score

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

  • P12 CI test-gate honesty — 5 observation(s) recorded · 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'.
  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 24 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 45 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC3 Page structure — No structural check found in the parsed markup — AC3 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC6 Visual & motion safety — No styled element found in the parsed markup — AC6 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • 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 17 — an image could not be built) — failed to solve: process "/bin/sh -c set -eux; curl -fsSL \"https://deb.nodesource.com/setup_${NODE_MAJOR}.x\" | bash -; apt-get install -y --no-install-recommends nodejs; corepack enable; corepack prepare \"pnpm@${PNPM_VERSION}\" --activate; rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100; 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 a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, 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 a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • 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 is measured on C# only; JavaScript, Python, Rust, TypeScript not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript, Rust, TypeScript 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+ projects each declaring an entity of their own. 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"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .rs, .ts, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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.
  • 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) — 39 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • 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 (2 of 3 signals for this style — below the bar we score at): 122 value object(s); 7 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • 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
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 3 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X26 Unsynchronised callback handoff — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — 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 — 154 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 54 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×25
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · No assertions (empty test) · ×3
  • No assertions (empty test): ${testName} — ${exclusion.reason} toolchain/conformance/libc-test-conformance.test.ts:285 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): ${testName} — ${exclusion.reason} toolchain/conformance/os-test-conformance.test.ts:375 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): a sidecar outlives more VM create and dispose cycles than its event buffer holds packages/core/tests/sidecar-exit.test.ts:107 — Test method has an empty body — it asserts nothing and exercises no code.
D30 · Dependency Vulnerabilities · High vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D11 · Test Reliability · Test suite declares a test script but contains no test files · ×1
  • Test suite declares a test script but contains no test files: packages/posix/ — The vitest suite in packages/posix/ was installed and launched successfully, and the runner then found no test files to run — include: **/*.{test,spec}.?(c|m)[jt]s?(x). The package declares a test script, so it reads as a tested package to anyone who checks its manifest, but there is nothing behind the declaration: no test case exists, so it cannot detect a regression and its presence overstates how much of this repository is tested. The ask is the owner's: write the first test for this package, or remove the test script from a package that has none. This is not a report that the tests FAIL — there are none.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'ws' · ×1
  • Unlisted import 'ws' crates/execution/assets/undici-shims/websocket-lazy.js:7 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'unrs-resolver' · ×1
  • Unlisted import 'unrs-resolver' packages/runtime-core/tests/integration/projects/jest-native-resolver-blocked/src/index.cjs:5 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (4 files) · ×1
  • Import cycle (4 files) packages/build-tools/bridge-src/builtins/builtin-modules.ts:20 — packages/build-tools/bridge-src/builtins/builtin-modules.ts → packages/build-tools/bridge-src/builtins/console.ts → packages/build-tools/bridge-src/builtins/events.ts → packages/build-tools/bridge-src/builtins/process.ts → packages/build-tools/bridge-src/builtins/builtin-modules.ts (one verified cycle inside a mutually-dependent group of 21 files)
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) REDACTED:15 — REDACTED → REDACTED → REDACTED
Serious — 2229 finding(s)
D3 · God Classes · FileTooLong · ×118
  • FileTooLong: runners/wasm-runner.mjs crates/execution/assets/runners/wasm-runner.mjs — FileTooLong — 9114 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 8614 over it, 18.23× 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: execution/child_process.rs crates/native-sidecar/src/execution/child_process.rs — FileTooLong — 7764 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 7264 over it, 15.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/kernel.rs crates/kernel/src/kernel.rs — FileTooLong — 7410 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: KernelVm (4 blocks, 446-9946), declaring 50 free functions. The bar is 500 significant lines; this is 6910 over it, 14.82× 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/javascript.rs crates/execution/src/javascript.rs — FileTooLong — 4996 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 79 free functions. The bar is 500 significant lines; this is 4496 over it, 9.99× 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/agent-os.ts packages/core/src/agent-os.ts — FileTooLong — 4531 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4031 over it, 9.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/stdio.rs crates/native-sidecar/src/stdio.rs — FileTooLong — 4399 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 3899 over it, 8.80× 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/service.rs crates/native-sidecar/src/service.rs — FileTooLong — 4290 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 3790 over it, 8.58× 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/filesystem.rs crates/native-sidecar/src/filesystem.rs — FileTooLong — 4216 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 136 free functions. The bar is 500 significant lines; this is 3716 over it, 8.43× 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: javascript/rpc.rs crates/native-sidecar/src/execution/javascript/rpc.rs — FileTooLong — 4049 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 3549 over it, 8.10× 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/runtime.ts packages/runtime-browser/src/runtime.ts — FileTooLong — 3899 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: POLYFILL_CODE_MAP (1159-4700). The bar is 500 significant lines; this is 3399 over it, 7.80× 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/vm.rs crates/native-sidecar/src/vm.rs — FileTooLong — 3853 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 90 free functions. The bar is 500 significant lines; this is 3353 over it, 7.71× 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: builtins/http.ts packages/build-tools/bridge-src/builtins/http.ts — FileTooLong — 3564 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3064 over it, 7.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: execution/launch.rs crates/native-sidecar/src/execution/launch.rs — FileTooLong — 3434 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 130 free functions. The bar is 500 significant lines; this is 2934 over it, 6.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3286 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2786 over it, 6.57× 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/wasm.rs crates/execution/src/wasm.rs — FileTooLong — 3276 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 95 free functions. The bar is 500 significant lines; this is 2776 over it, 6.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: builtins/net.ts packages/build-tools/bridge-src/builtins/net.ts — FileTooLong — 2955 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2455 over it, 5.91× 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: network/http2.rs crates/native-sidecar/src/execution/network/http2.rs — FileTooLong — 2945 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 64 free functions. The bar is 500 significant lines; this is 2445 over it, 5.89× 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: network/tcp.rs crates/native-sidecar/src/execution/network/tcp.rs — FileTooLong — 2752 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 2252 over it, 5.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/worker.ts packages/runtime-browser/src/worker.ts — FileTooLong — 2699 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2199 over it, 5.40× 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/session.rs crates/v8-runtime/src/session.rs — FileTooLong — 2673 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 2173 over it, 5.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2626 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2126 over it, 5.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: src/protocol.rs crates/sidecar-protocol/src/protocol.rs — FileTooLong — 2598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 50 free functions. The bar is 500 significant lines; this is 2098 over it, 5.20× 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/benchmark.rs crates/execution/src/benchmark.rs — FileTooLong — 2594 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 74 free functions. The bar is 500 significant lines; this is 2094 over it, 5.19× 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/language_execution.rs crates/native-sidecar/src/language_execution.rs — FileTooLong — 2382 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 1882 over it, 4.76× 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/state.rs crates/native-sidecar/src/state.rs — FileTooLong — 2353 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 1853 over it, 4.71× 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.
  • + 93 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×108
  • FunctionTooLong: agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc crates/native-sidecar/src/execution/javascript/rpc.rs:2997 — FunctionTooLong — agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc runs 1544 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 1444 over it, 15.44× 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: agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc crates/native-sidecar/src/execution/javascript/rpc.rs:613 — FunctionTooLong — agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc runs 1408 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 1308 over it, 14.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc crates/native-sidecar/src/filesystem.rs:1564 — FunctionTooLong — agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc runs 1240 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 1140 over it, 12.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::stdio::run_protocol_engine crates/native-sidecar/src/stdio.rs:1840 — FunctionTooLong — agentos_native_sidecar::stdio::run_protocol_engine runs 810 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 710 over it, 8.10× 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: agentos_native_sidecar::execution::network::http2::service_javascript_http2_sync_rpc crates/native-sidecar/src/execution/network/http2.rs:3099 — FunctionTooLong — agentos_native_sidecar::execution::network::http2::service_javascript_http2_sync_rpc runs 598 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 498 over it, 5.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: worker.createBrowserProcess packages/runtime-browser/src/worker.ts:2630 — FunctionTooLong — createBrowserProcess runs 567 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 467 over it, 5.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.
  • FunctionTooLong: net-tcp-event-floor.bench.deriveGuestBridgeTrace packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:831 — FunctionTooLong — deriveGuestBridgeTrace runs 525 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 425 over it, 5.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::execution::network::http2::spawn_http2_server_session crates/native-sidecar/src/execution/network/http2.rs:2310 — FunctionTooLong — agentos_native_sidecar::execution::network::http2::spawn_http2_server_session runs 462 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 362 over it, 4.62× 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: worker.initRuntime packages/runtime-browser/src/worker.ts:1908 — FunctionTooLong — initRuntime runs 443 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 343 over it, 4.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_baseline::run_once crates/native-baseline/src/main.rs:285 — FunctionTooLong — agentos_native_baseline::run_once runs 439 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 339 over it, 4.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::execution::launch::execute_owned crates/native-sidecar/src/execution/launch.rs:4939 — FunctionTooLong — agentos_native_sidecar::execution::launch::execute_owned runs 383 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 283 over it, 3.83× 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: process-spawn.bench.main packages/runtime-benchmarks/src/focused/process-spawn.bench.ts:1031 — FunctionTooLong — main runs 370 significant lines (blank, comment-only and punctuation-only lines excluded) 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: response-payloads.fromGeneratedResponsePayload packages/runtime-core/src/response-payloads.ts:329 — FunctionTooLong — fromGeneratedResponsePayload runs 351 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 251 over it, 3.51× 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: agentos_native_sidecar::execution::network::http2::spawn_http2_client_session crates/native-sidecar/src/execution/network/http2.rs:1867 — FunctionTooLong — agentos_native_sidecar::execution::network::http2::spawn_http2_client_session 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: request-payloads.toGeneratedRequestPayload packages/runtime-core/src/request-payloads.ts:405 — FunctionTooLong — toGeneratedRequestPayload runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::stdio::route_protocol_frame crates/native-sidecar/src/stdio.rs:3164 — FunctionTooLong — agentos_native_sidecar::stdio::route_protocol_frame runs 321 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 221 over it, 3.21× 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: agentos_native_sidecar_core::limits::validate_vm_limits crates/native-sidecar-core/src/limits.rs:1134 — FunctionTooLong — agentos_native_sidecar_core::limits::validate_vm_limits 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.
  • FunctionTooLong: agentos_native_sidecar::execution::network::udp::run_native_udp_owner crates/native-sidecar/src/execution/network/udp.rs:579 — FunctionTooLong — agentos_native_sidecar::execution::network::udp::run_native_udp_owner runs 311 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 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc_response crates/native-sidecar/src/execution/javascript/rpc.rs:2558 — FunctionTooLong — agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc_response runs 304 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 204 over it, 3.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: net-tcp-event-floor.bench.defaultRows packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:108 — FunctionTooLong — defaultRows runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) 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: builtin-modules.loadBuiltinModule packages/build-tools/bridge-src/builtins/builtin-modules.ts:698 — FunctionTooLong — loadBuiltinModule runs 271 significant lines (blank, comment-only and punctuation-only lines excluded) 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: agentos_native_sidecar::stdio::run_async crates/native-sidecar/src/stdio.rs:1449 — FunctionTooLong — agentos_native_sidecar::stdio::run_async 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.
  • FunctionTooLong: python-runner.installPythonWorkspaceFs crates/execution/assets/runners/python-runner.mjs:1674 — FunctionTooLong — installPythonWorkspaceFs runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::language_execution::lower_operation crates/native-sidecar/src/language_execution.rs:520 — FunctionTooLong — agentos_native_sidecar::language_execution::lower_operation runs 263 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 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agentos_native_sidecar::execution::network::udp::service_javascript_dgram_sync_rpc crates/native-sidecar/src/execution/network/udp.rs:1891 — FunctionTooLong — agentos_native_sidecar::execution::network::udp::service_javascript_dgram_sync_rpc runs 255 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 155 over it, 2.55× 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.
  • + 83 more in this group — see findings.md.
D2 · Cognitive Complexity · agentos_native_sidecar · ×72
  • agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc (cognitive 326) crates/native-sidecar/src/execution/javascript/rpc.rs:2997 — agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc has cognitive complexity 326 (threshold 15). Drivers by points: if/else 100 (243 pts), match/switch 23 (67 pts), loops 3 (10 pts), boolean chains 6 (nesting depth added 194). 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.
  • agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc (cognitive 247) crates/native-sidecar/src/filesystem.rs:1564 — agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc has cognitive complexity 247 (threshold 15). Drivers by points: if/else 80 (194 pts), match/switch 16 (36 pts), boolean chains 9, loops 3 (8 pts) (nesting depth added 139). 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.
  • agentos_native_sidecar::stdio::run_protocol_engine (cognitive 166) crates/native-sidecar/src/stdio.rs:1840 — agentos_native_sidecar::stdio::run_protocol_engine has cognitive complexity 166 (threshold 15). Drivers by points: if/else 28 (78 pts), match/switch 18 (60 pts), loops 9 (26 pts), boolean chains 2 (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::execution::network::http2::spawn_http2_server_session (cognitive 145) crates/native-sidecar/src/execution/network/http2.rs:2310 — agentos_native_sidecar::execution::network::http2::spawn_http2_server_session has cognitive complexity 145 (threshold 15). Drivers by points: if/else 30 (88 pts), match/switch 20 (56 pts), loops 1 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc (cognitive 116) crates/native-sidecar/src/execution/javascript/rpc.rs:613 — agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc has cognitive complexity 116 (threshold 15). Drivers by points: if/else 40 (70 pts), match/switch 14 (38 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::execution::process::find_socket_state_entry (cognitive 112) crates/native-sidecar/src/execution/process.rs:1994 — agentos_native_sidecar::execution::process::find_socket_state_entry has cognitive complexity 112 (threshold 15). Drivers by points: if/else 21 (88 pts), loops 6 (19 pts), match/switch 2 (5 pts) (nesting depth added 83). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::execution::child_process::apply_posix_spawn_file_actions (cognitive 105) crates/native-sidecar/src/execution/child_process.rs:2014 — agentos_native_sidecar::execution::child_process::apply_posix_spawn_file_actions has cognitive complexity 105 (threshold 15). Drivers by points: if/else 31 (82 pts), loops 6 (14 pts), boolean chains 7, match/switch 1 (2 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.
  • agentos_native_sidecar::execution::network::udp::run_native_udp_owner (cognitive 105) crates/native-sidecar/src/execution/network/udp.rs:579 — agentos_native_sidecar::execution::network::udp::run_native_udp_owner has cognitive complexity 105 (threshold 15). Drivers by points: if/else 15 (62 pts), match/switch 10 (33 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::execution::network::http2::poll_server_http2_streams (cognitive 95) crates/native-sidecar/src/execution/network/http2.rs:599 — agentos_native_sidecar::execution::network::http2::poll_server_http2_streams has cognitive complexity 95 (threshold 15). Drivers by points: if/else 21 (67 pts), match/switch 5 (23 pts), boolean chains 4, loops 1 (nesting depth added 64). 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.
  • agentos_native_sidecar::execution::network::http2::poll_client_http2_streams (cognitive 91) crates/native-sidecar/src/execution/network/http2.rs:342 — agentos_native_sidecar::execution::network::http2::poll_client_http2_streams has cognitive complexity 91 (threshold 15). Drivers by points: if/else 19 (55 pts), match/switch 7 (32 pts), boolean chains 3, loops 1 (nesting depth added 61). 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.
  • agentos_native_sidecar::execution::network::tls::run_native_tls_transport (cognitive 83) crates/native-sidecar/src/execution/network/tls.rs:1016 — agentos_native_sidecar::execution::network::tls::run_native_tls_transport has cognitive complexity 83 (threshold 15). Drivers by points: if/else 16 (60 pts), match/switch 5 (16 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::stdio::route_protocol_frame (cognitive 79) crates/native-sidecar/src/stdio.rs:3164 — agentos_native_sidecar::stdio::route_protocol_frame has cognitive complexity 79 (threshold 15). Drivers by points: match/switch 13 (40 pts), if/else 13 (39 pts) (nesting depth added 53). 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.
  • agentos_native_sidecar::execution::network::http2::spawn_http2_client_session (cognitive 77) crates/native-sidecar/src/execution/network/http2.rs:1867 — agentos_native_sidecar::execution::network::http2::spawn_http2_client_session has cognitive complexity 77 (threshold 15). Drivers by points: if/else 17 (47 pts), match/switch 12 (29 pts), loops 1 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc_response (cognitive 60) crates/native-sidecar/src/execution/javascript/rpc.rs:2558 — agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc_response has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (46 pts), match/switch 4 (9 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.
  • agentos_native_sidecar::stdio::run_async (cognitive 57) crates/native-sidecar/src/stdio.rs:1449 — agentos_native_sidecar::stdio::run_async has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 6 (10 pts), match/switch 4 (10 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.
  • agentos_native_sidecar::execution::javascript::http::decode_stream_body (cognitive 50) crates/native-sidecar/src/execution/javascript/http.rs:378 — agentos_native_sidecar::execution::javascript::http::decode_stream_body has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (47 pts), match/switch 1 (2 pts), loops 1 (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.
  • agentos_native_sidecar::execution::launch::sync_host_directory_tree_to_kernel_inner (cognitive 46) crates/native-sidecar/src/execution/launch.rs:1229 — agentos_native_sidecar::execution::launch::sync_host_directory_tree_to_kernel_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (32 pts), match/switch 4 (10 pts), boolean chains 3, loops 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • agentos_native_sidecar::plugins::host_dir::confine::resolve_impl (cognitive 43) crates/native-sidecar/src/plugins/host_dir.rs:345 — agentos_native_sidecar::plugins::host_dir::confine::resolve_impl has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 6 (13 pts), boolean chains 3, 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.
  • agentos_native_sidecar::execution::process::terminate_child_process_tree (cognitive 42) crates/native-sidecar/src/execution/process.rs:2661 — agentos_native_sidecar::execution::process::terminate_child_process_tree has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 8 (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.
  • agentos_native_sidecar::execution::network::tcp::spawn_tcp_socket_reader (cognitive 40) crates/native-sidecar/src/execution/network/tcp.rs:3043 — agentos_native_sidecar::execution::network::tcp::spawn_tcp_socket_reader has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 5 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar::filesystem::service_owned_python_filesystem_rpc_request (cognitive 39) crates/native-sidecar/src/filesystem.rs:899 — agentos_native_sidecar::filesystem::service_owned_python_filesystem_rpc_request has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 7 (16 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.
  • agentos_native_sidecar::filesystem::mapped_runtime_host_path (cognitive 39) crates/native-sidecar/src/filesystem.rs:3360 — agentos_native_sidecar::filesystem::mapped_runtime_host_path has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 11, 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.
  • agentos_native_sidecar::execution::network::http2::service_javascript_http2_sync_rpc (cognitive 38) crates/native-sidecar/src/execution/network/http2.rs:3099 — agentos_native_sidecar::execution::network::http2::service_javascript_http2_sync_rpc has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 5 (10 pts), boolean chains 2 (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.
  • agentos_native_sidecar::execution::network::unix::spawn_unix_socket_reader (cognitive 32) crates/native-sidecar/src/execution/network/unix.rs:1827 — agentos_native_sidecar::execution::network::unix::spawn_unix_socket_reader has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 5 (8 pts), loops 2 (3 pts), boolean chains 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.
  • agentos_native_sidecar::language_execution::rewrite_static_imports (cognitive 30) crates/native-sidecar/src/language_execution.rs:365 — agentos_native_sidecar::language_execution::rewrite_static_imports has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (8 pts), loops 3 (6 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.
  • + 47 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×56
  • Duplicated block (9 lines × 2) crates/client/src/agent_os.rs:516 — crates/client/src/agent_os.rs:516-524 | crates/client/src/agent_os.rs:617-625 — both copies are in the same file, so extract the 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/client/src/agent_os.rs:2161 — crates/client/src/agent_os.rs:2161-2169 | crates/native-sidecar/src/host_functions.rs:468-476 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/client/src/language_execution.rs:190 — crates/client/src/language_execution.rs:190-198 | crates/client/src/language_execution.rs:214-222 — both copies are in the same file, so extract the 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/execution/src/javascript.rs:196 — crates/execution/src/javascript.rs:196-204 | crates/v8-runtime/src/host_call.rs:74-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/execution/src/python.rs:1163 — crates/execution/src/python.rs:1163-1171 | crates/execution/src/wasm.rs:1129-1137 — before extracting anything, compare `crates/execution/src/python.rs` and `crates/execution/src/wasm.rs` as WHOLE FILES: this scan already matched 9 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 (9 lines × 2) crates/execution/src/python.rs:2736 — crates/execution/src/python.rs:2736-2744 | crates/execution/src/wasm.rs:2306-2314 — before extracting anything, compare `crates/execution/src/python.rs` and `crates/execution/src/wasm.rs` as WHOLE FILES: this scan already matched 9 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 (9 lines × 2) crates/kernel/src/kernel.rs:2806 — crates/kernel/src/kernel.rs:2806-2814 | crates/kernel/src/kernel.rs:2824-2832 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:5064 — crates/kernel/src/kernel.rs:5064-5072 | crates/kernel/src/kernel.rs:5503-5511 — both copies are in the same file, so extract the 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/kernel/src/pipe_manager.rs:610 — crates/kernel/src/pipe_manager.rs:610-618 | crates/kernel/src/pipe_manager.rs:628-636 — both copies are in the same file, so extract the 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/kernel/src/pty.rs:681 — crates/kernel/src/pty.rs:681-689 | crates/kernel/src/pty.rs:700-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/kernel/src/pty.rs:952 — crates/kernel/src/pty.rs:952-960 | crates/kernel/src/pty.rs:966-974 — both copies are in the same file, so extract the 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/native-sidecar-browser/src/service.rs:800 — crates/native-sidecar-browser/src/service.rs:800-808 | crates/native-sidecar-browser/src/service.rs:832-840 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:4136 — crates/native-sidecar/src/execution/child_process.rs:4136-4144 | crates/native-sidecar/src/execution/child_process.rs:4285-4293 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:4975 — crates/native-sidecar/src/execution/child_process.rs:4975-4983 | crates/native-sidecar/src/execution/child_process.rs:5639-5647 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:10147 — crates/native-sidecar/src/execution/child_process.rs:10147-10155 | crates/native-sidecar/src/execution/child_process.rs:10179-10187 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/crypto.rs:2263 — crates/native-sidecar/src/execution/javascript/crypto.rs:2263-2271 | crates/native-sidecar/src/execution/javascript/crypto.rs:2292-2300 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/launch.rs:256 — crates/native-sidecar/src/execution/launch.rs:256-264 | crates/native-sidecar/src/execution/launch.rs:303-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.
  • Duplicated block (9 lines × 2) crates/native-sidecar/src/execution/launch.rs:2192 — crates/native-sidecar/src/execution/launch.rs:2192-2200 | crates/native-sidecar/src/execution/launch.rs:2208-2216 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tcp.rs:2809 — crates/native-sidecar/src/execution/network/tcp.rs:2809-2817 | crates/native-sidecar/src/execution/network/tcp.rs:2843-2851 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process.rs:1273 — crates/native-sidecar/src/execution/process.rs:1273-1281 | crates/native-sidecar/src/execution/process.rs:1307-1315 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:2580 — crates/native-sidecar/src/filesystem.rs:2580-2588 | crates/native-sidecar/src/filesystem.rs:2618-2626 — both copies are in the same file, so extract the 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/native-sidecar/src/process_event_broker.rs:576 — crates/native-sidecar/src/process_event_broker.rs:576-584 | crates/native-sidecar/src/process_event_broker.rs:749-757 — both copies are in the same file, so extract the 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/runtime/src/lib.rs:1490 — crates/runtime/src/lib.rs:1490-1498 | crates/runtime/src/lib.rs:1518-1526 — both copies are in the same file, so extract the 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/sidecar-protocol/src/protocol.rs:2499 — crates/sidecar-protocol/src/protocol.rs:2499-2507 | crates/sidecar-protocol/src/protocol.rs:2591-2599 — both copies are in the same file, so extract the 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/vfs-store/src/s3/block_store.rs:168 — crates/vfs-store/src/s3/block_store.rs:168-176 | crates/vfs-store/src/s3/object_backend.rs:271-279 — 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.
  • + 31 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×46
  • MethodTooLong: OwnedLanguageSidecar.execute_language_operation_owned crates/native-sidecar/src/language_execution.rs:1235 — MethodTooLong — execute_language_operation_owned runs 476 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 376 over it, 4.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.
  • MethodTooLong: OwnedLanguageSidecar.handle_execution_lifecycle_owned crates/native-sidecar/src/language_execution.rs:1888 — MethodTooLong — handle_execution_lifecycle_owned runs 403 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 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OwnedPythonSocketService.python_socket_op crates/native-sidecar/src/execution/python/sockets.rs:470 — MethodTooLong — python_socket_op runs 398 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 298 over it, 3.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.
  • MethodTooLong: AgentOs.create_vm crates/client/src/agent_os.rs:282 — MethodTooLong — create_vm runs 394 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 294 over it, 3.94× 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: NativeSidecarKernelProxy.openShell REDACTED:813 — MethodTooLong — openShell runs 310 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 210 over it, 3.10× 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: NativeSidecar.create_vm_legacy_impl crates/native-sidecar/src/vm.rs:711 — MethodTooLong — create_vm_legacy_impl runs 305 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 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: JavascriptBenchmarkReport.render_markdown_with_comparison crates/execution/src/benchmark.rs:193 — MethodTooLong — render_markdown_with_comparison 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: PreparedCreateVm.execute crates/native-sidecar/src/vm.rs:1653 — MethodTooLong — execute runs 286 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 186 over it, 2.86× 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: AgentOs.create packages/core/src/agent-os.ts:2935 — MethodTooLong — create runs 280 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 180 over it, 2.80× 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: ChildProcess.constructor packages/build-tools/bridge-src/builtins/child-process.ts:696 — MethodTooLong — constructor runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: VmLimitsConfig.validate crates/vm-config/src/lib.rs:981 — MethodTooLong — validate runs 228 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 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _NetSocket._pumpBridgeReads packages/build-tools/bridge-src/builtins/net.ts:2735 — MethodTooLong — _pumpBridgeReads runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WASI._pollOneoff crates/execution/assets/runners/wasi-module.js:2495 — MethodTooLong — _pollOneoff runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NativeSidecar.pump_process_events_nowait crates/native-sidecar/src/execution/process_events.rs:702 — MethodTooLong — pump_process_events_nowait runs 207 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 107 over it, 2.07× 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: NativeSidecar.kill_process_in_vm crates/native-sidecar/src/execution/signals.rs:627 — MethodTooLong — kill_process_in_vm runs 171 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 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NativeSidecarKernelProxy.createFilesystemView REDACTED:1920 — MethodTooLong — createFilesystemView runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.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: NativeSidecar.vm_fetch_legacy crates/native-sidecar/src/execution/coordinator.rs:847 — MethodTooLong — vm_fetch_legacy runs 169 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 69 over it, 1.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.
  • MethodTooLong: NativeSidecar.dispose_vm_internal crates/native-sidecar/src/vm.rs:1233 — MethodTooLong — dispose_vm_internal runs 160 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 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentOs.exec_argv_process crates/client/src/process.rs:555 — MethodTooLong — exec_argv_process runs 158 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 58 over it, 1.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: ChunkedFs.write_chunked_range crates/vfs/src/engine/engines/chunked.rs:302 — MethodTooLong — write_chunked_range runs 154 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 54 over it, 1.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.
  • MethodTooLong: AgentOs.read_process_output crates/client/src/process.rs:1027 — MethodTooLong — read_process_output runs 153 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 53 over it, 1.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.
  • MethodTooLong: AgentOs.open_shell crates/client/src/shell.rs:380 — MethodTooLong — open_shell runs 146 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 46 over it, 1.46× 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: WASI._fdRead crates/execution/assets/runners/wasi-module.js:1677 — MethodTooLong — _fdRead runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: ActiveTcpSocket.upgrade_tls crates/native-sidecar/src/execution/network/tcp.rs:783 — MethodTooLong — upgrade_tls runs 144 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 44 over it, 1.44× 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: ActiveTcpSocket.poll crates/native-sidecar/src/execution/network/tcp.rs:497 — MethodTooLong — poll runs 143 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 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×46
  • Duplicated block (10 lines × 2) crates/execution/src/javascript.rs:7430 — crates/execution/src/javascript.rs:7430-7439 | crates/execution/src/javascript.rs:7493-7502 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:3860 — crates/kernel/src/kernel.rs:3860-3869 | crates/kernel/src/kernel.rs:3923-3932 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:4136 — crates/kernel/src/kernel.rs:4136-4145 | crates/kernel/src/kernel.rs:4372-4381 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:4219 — crates/kernel/src/kernel.rs:4219-4228 | crates/kernel/src/kernel.rs:4242-4251 — both copies are in the same file, so extract the 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/kernel/src/pipe_manager.rs:620 — crates/kernel/src/pipe_manager.rs:620-629 | crates/kernel/src/pty.rs:691-700 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 (10 lines × 2) crates/kernel/src/pipe_manager.rs:720 — crates/kernel/src/pipe_manager.rs:720-729 | crates/kernel/src/pipe_manager.rs:736-745 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:2964 — crates/native-sidecar/src/execution/child_process.rs:2964-2973 | crates/native-sidecar/src/execution/child_process.rs:8635-8644 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:9667 — crates/native-sidecar/src/execution/child_process.rs:9667-9676 | crates/native-sidecar/src/execution/child_process.rs:9715-9724 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:10026 — crates/native-sidecar/src/execution/child_process.rs:10026-10035 | crates/native-sidecar/src/execution/child_process.rs:10082-10091 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/http.rs:859 — crates/native-sidecar/src/execution/javascript/http.rs:859-868 | crates/native-sidecar/src/execution/javascript/http.rs:2626-2635 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/http.rs:1952 — crates/native-sidecar/src/execution/javascript/http.rs:1952-1961 | crates/native-sidecar/src/execution/javascript/http.rs:2567-2576 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/launch.rs:967 — crates/native-sidecar/src/execution/launch.rs:967-976 | crates/native-sidecar/src/execution/launch.rs:997-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 (10 lines × 2) crates/native-sidecar/src/execution/network/tcp.rs:473 — crates/native-sidecar/src/execution/network/tcp.rs:473-482 | crates/native-sidecar/src/execution/network/unix.rs:702-711 — before extracting anything, compare `crates/native-sidecar/src/execution/network/tcp.rs` and `crates/native-sidecar/src/execution/network/unix.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 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 (10 lines × 2) crates/native-sidecar/src/execution/process.rs:696 — crates/native-sidecar/src/execution/process.rs:696-705 | crates/native-sidecar/src/execution/process.rs:735-744 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process.rs:1883 — crates/native-sidecar/src/execution/process.rs:1883-1892 | crates/native-sidecar/src/execution/process.rs:1960-1969 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process.rs:1903 — crates/native-sidecar/src/execution/process.rs:1903-1912 | crates/native-sidecar/src/execution/process.rs:1979-1988 — both copies are in the same file, so extract the 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/native-sidecar/src/ownership_coordinator.rs:938 — crates/native-sidecar/src/ownership_coordinator.rs:938-947 | crates/native-sidecar/src/ownership_coordinator.rs:985-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.
  • Duplicated block (10 lines × 2) crates/native-sidecar/src/process_event_broker.rs:403 — crates/native-sidecar/src/process_event_broker.rs:403-412 | crates/native-sidecar/src/process_event_broker.rs:451-460 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:3247 — crates/native-sidecar/src/service.rs:3247-3256 | crates/native-sidecar/src/service.rs:3333-3342 — both copies are in the same file, so extract the 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/native-sidecar/src/vm.rs:966 — crates/native-sidecar/src/vm.rs:966-975 | crates/native-sidecar/src/vm.rs:1869-1878 — both copies are in the same file, so extract the 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/runtime/src/lib.rs:1429 — crates/runtime/src/lib.rs:1429-1438 | crates/runtime/src/lib.rs:1455-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.
  • Duplicated block (10 lines × 2) crates/v8-runtime/src/embedded_runtime.rs:245 — crates/v8-runtime/src/embedded_runtime.rs:245-254 | crates/v8-runtime/src/embedded_runtime.rs:325-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.
  • Duplicated block (10 lines × 2) crates/v8-runtime/src/execution.rs:1402 — crates/v8-runtime/src/execution.rs:1402-1411 | crates/v8-runtime/src/execution.rs:1415-1424 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:2473 — crates/v8-runtime/src/execution.rs:2473-2482 | crates/v8-runtime/src/execution.rs:2515-2524 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:2838 — crates/v8-runtime/src/execution.rs:2838-2847 | crates/v8-runtime/src/execution.rs:2871-2880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×45
  • Duplicated block (7 lines × 2) crates/client/src/software.rs:1458 — crates/client/src/software.rs:1458-1464 | crates/client/src/software.rs:1487-1493 — both copies are in the same file, so extract the 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/execution/src/javascript.rs:7422 — crates/execution/src/javascript.rs:7422-7428 | crates/execution/src/javascript.rs:7485-7491 — both copies are in the same file, so extract the 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/execution/src/python.rs:2747 — crates/execution/src/python.rs:2747-2753 | crates/execution/src/wasm.rs:2317-2323 — before extracting anything, compare `crates/execution/src/python.rs` and `crates/execution/src/wasm.rs` as WHOLE FILES: this scan already matched 9 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 (7 lines × 2) crates/execution/src/wasm.rs:3043 — crates/execution/src/wasm.rs:3043-3049 | crates/execution/src/wasm.rs:3075-3081 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:3978 — crates/kernel/src/kernel.rs:3978-3984 | crates/kernel/src/kernel.rs:5088-5094 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:5514 — crates/kernel/src/kernel.rs:5514-5520 | crates/kernel/src/kernel.rs:5563-5569 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:7338 — crates/kernel/src/kernel.rs:7338-7344 | crates/kernel/src/kernel.rs:7376-7382 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:12498 — crates/native-sidecar/src/execution/child_process.rs:12498-12504 | crates/native-sidecar/src/execution/stdio.rs:269-275 — 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/native-sidecar/src/execution/javascript/rpc.rs:2520 — crates/native-sidecar/src/execution/javascript/rpc.rs:2520-2526 | crates/native-sidecar/src/execution/javascript/rpc.rs:4739-4745 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/launch.rs:4196 — crates/native-sidecar/src/execution/launch.rs:4196-4202 | crates/native-sidecar/src/execution/launch.rs:4260-4266 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tcp.rs:442 — crates/native-sidecar/src/execution/network/tcp.rs:442-448 | crates/native-sidecar/src/execution/network/unix.rs:672-678 — before extracting anything, compare `crates/native-sidecar/src/execution/network/tcp.rs` and `crates/native-sidecar/src/execution/network/unix.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 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 (7 lines × 2) crates/native-sidecar/src/execution/network/tcp.rs:2588 — crates/native-sidecar/src/execution/network/tcp.rs:2588-2594 | crates/native-sidecar/src/execution/network/unix.rs:1729-1735 — before extracting anything, compare `crates/native-sidecar/src/execution/network/tcp.rs` and `crates/native-sidecar/src/execution/network/unix.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 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 (7 lines × 2) crates/native-sidecar/src/execution/network/tls.rs:1339 — crates/native-sidecar/src/execution/network/tls.rs:1339-1345 | crates/native-sidecar/src/execution/network/tls.rs:1596-1602 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process_events.rs:1043 — crates/native-sidecar/src/execution/process_events.rs:1043-1049 | crates/native-sidecar/src/execution/process_events.rs:1590-1596 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/python/rpc.rs:413 — crates/native-sidecar/src/execution/python/rpc.rs:413-419 | crates/native-sidecar/src/execution/python/rpc.rs:570-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.
  • Duplicated block (7 lines × 2) crates/native-sidecar/src/execution/python/sockets.rs:981 — crates/native-sidecar/src/execution/python/sockets.rs:981-987 | crates/native-sidecar/src/execution/python/sockets.rs:1095-1101 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:1000 — crates/native-sidecar/src/filesystem.rs:1000-1006 | crates/native-sidecar/src/filesystem.rs:1009-1015 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:3847 — crates/native-sidecar/src/filesystem.rs:3847-3853 | crates/native-sidecar/src/plugins/host_dir.rs:1052-1058 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) crates/native-sidecar/src/language_execution.rs:277 — crates/native-sidecar/src/language_execution.rs:277-283 | crates/native-sidecar/src/language_execution.rs:370-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/native-sidecar/src/service.rs:1848 — crates/native-sidecar/src/service.rs:1848-1854 | crates/native-sidecar/src/service.rs:1892-1898 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:956 — crates/native-sidecar/src/stdio.rs:956-962 | crates/native-sidecar/src/stdio.rs:1001-1007 — both copies are in the same file, so extract the 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/native-sidecar/src/vm_sqlite.rs:407 — crates/native-sidecar/src/vm_sqlite.rs:407-413 | crates/native-sidecar/src/vm_sqlite.rs:490-496 — both copies are in the same file, so extract the 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/sidecar-protocol/src/protocol.rs:2482 — crates/sidecar-protocol/src/protocol.rs:2482-2488 | crates/sidecar-protocol/src/protocol.rs:2574-2580 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:1109 — crates/v8-runtime/src/execution.rs:1109-1115 | crates/v8-runtime/src/execution.rs:1266-1272 — both copies are in the same file, so extract the 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/vfs/src/engine/cache.rs:102 — crates/vfs/src/engine/cache.rs:102-108 | crates/vfs/src/engine/cache.rs:130-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 20 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×44
  • Duplicated block (8 lines × 2) crates/client/src/agent_os.rs:2336 — crates/client/src/agent_os.rs:2336-2343 | crates/client/src/agent_os.rs:2366-2373 — both copies are in the same file, so extract the 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/execution/src/node_import_cache.rs:2570 — crates/execution/src/node_import_cache.rs:2570-2577 | crates/execution/src/node_import_cache.rs:2614-2621 — both copies are in the same file, so extract the 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/execution/src/v8_ipc.rs:128 — crates/execution/src/v8_ipc.rs:128-135 | crates/v8-runtime/src/ipc_binary.rs:168-175 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 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 (8 lines × 2) crates/execution/src/v8_ipc.rs:159 — crates/execution/src/v8_ipc.rs:159-166 | crates/v8-runtime/src/ipc_binary.rs:432-439 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 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 (8 lines × 2) crates/kernel/src/kernel.rs:276 — crates/kernel/src/kernel.rs:276-283 | crates/kernel/src/kernel.rs:293-300 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:4842 — crates/kernel/src/kernel.rs:4842-4849 | crates/kernel/src/kernel.rs:5751-5758 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:9559 — crates/kernel/src/kernel.rs:9559-9566 | crates/kernel/src/kernel.rs:9576-9583 — both copies are in the same file, so extract the 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/kernel/src/pipe_manager.rs:654 — crates/kernel/src/pipe_manager.rs:654-661 | crates/kernel/src/pipe_manager.rs:664-671 — both copies are in the same file, so extract the 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/kernel/src/pty.rs:580 — crates/kernel/src/pty.rs:580-587 | crates/kernel/src/pty.rs:609-616 — both copies are in the same file, so extract the 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/kernel/src/socket_table.rs:1467 — crates/kernel/src/socket_table.rs:1467-1474 | crates/kernel/src/socket_table.rs:1476-1483 — both copies are in the same file, so extract the 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/kernel/src/socket_table.rs:2222 — crates/kernel/src/socket_table.rs:2222-2229 | crates/kernel/src/socket_table.rs:2365-2372 — both copies are in the same file, so extract the 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/native-sidecar-core/src/vm_fetch.rs:155 — crates/native-sidecar-core/src/vm_fetch.rs:155-162 | crates/native-sidecar/src/execution/javascript/http.rs:234-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/native-sidecar/src/execution/javascript/crypto.rs:461 — crates/native-sidecar/src/execution/javascript/crypto.rs:461-468 | crates/native-sidecar/src/execution/javascript/crypto.rs:1454-1461 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/rpc.rs:3725 — crates/native-sidecar/src/execution/javascript/rpc.rs:3725-3732 | crates/native-sidecar/src/execution/javascript/rpc.rs:4403-4410 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tcp.rs:423 — crates/native-sidecar/src/execution/network/tcp.rs:423-430 | crates/native-sidecar/src/execution/network/unix.rs:655-662 — before extracting anything, compare `crates/native-sidecar/src/execution/network/tcp.rs` and `crates/native-sidecar/src/execution/network/unix.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 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/native-sidecar/src/execution/process_events.rs:758 — crates/native-sidecar/src/execution/process_events.rs:758-765 | crates/native-sidecar/src/execution/process_events.rs:1218-1225 — both copies are in the same file, so extract the 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/native-sidecar/src/language_execution.rs:1216 — crates/native-sidecar/src/language_execution.rs:1216-1223 | crates/native-sidecar/src/language_execution.rs:2627-2634 — both copies are in the same file, so extract the 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/native-sidecar/src/plugins/chunked_sqlite.rs:768 — crates/native-sidecar/src/plugins/chunked_sqlite.rs:768-775 | crates/native-sidecar/src/plugins/chunked_sqlite.rs:790-797 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:2861 — crates/native-sidecar/src/service.rs:2861-2868 | crates/native-sidecar/src/service.rs:2873-2880 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:1010 — crates/native-sidecar/src/stdio.rs:1010-1017 | crates/native-sidecar/src/stdio.rs:1183-1190 — both copies are in the same file, so extract the 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/native-sidecar/src/vm.rs:815 — crates/native-sidecar/src/vm.rs:815-822 | crates/native-sidecar/src/vm.rs:1730-1737 — both copies are in the same file, so extract the 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/runtime/src/lib.rs:1436 — crates/runtime/src/lib.rs:1436-1443 | crates/runtime/src/lib.rs:1496-1503 — both copies are in the same file, so extract the 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/v8-runtime/src/bridge.rs:797 — crates/v8-runtime/src/bridge.rs:797-804 | crates/v8-runtime/src/bridge.rs:872-879 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:1039 — crates/v8-runtime/src/execution.rs:1039-1046 | crates/v8-runtime/src/execution.rs:1050-1057 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:1666 — crates/v8-runtime/src/execution.rs:1666-1673 | crates/v8-runtime/src/execution.rs:1702-1709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 19 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file crates/execution/assets/runners/wasm-runner.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 packages/build-tools/bridge-src/builtins/http.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED: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 packages/build-tools/bridge-src/builtins/net.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file crates/execution/assets/runners/wasi-module.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/execution/assets/runners/python-runner.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 packages/build-tools/bridge-src/builtins/http2.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/child-process.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/global-exposure.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/dgram.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/crypto.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/process.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/builtin-modules.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/shell/src/main.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/misc-stubs.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/playground/frontend/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 packages/build-tools/bridge-src/builtins/timers.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/console.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED: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 packages/build-tools/bridge-src/builtins/stdin.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/tls.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/dns.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/sqlite.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/fetch.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/build-tools/bridge-src/builtins/module-loader.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×39
  • TodoComment software/ssh/test/ssh.nightly.test.ts:241 — // TODO(P6): requires the ssh WASM artifact, intentionally excluded from the — 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.
  • TodoComment software/git/test/git.nightly.test.ts:182 — // TODO(P6): requires git WASM artifact, intentionally excluded from the fast software-build gate. — 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.
  • TodoComment software/duckdb/test/duckdb.nightly.test.ts:85 — // TODO(P6): requires duckdb WASM artifact, intentionally excluded from the fast software-build gate. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-concurrently.nightly.test.ts:51 — // TODO(P6): concurrently E2E depends on registry/network package resolution. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-nextjs-build.nightly.test.ts:55 — // TODO(P6): Next.js build E2E depends on package-install artifacts. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-install.nightly.test.ts:48 — // TODO(P6): npm install E2E depends on registry/network package resolution. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-lifecycle.nightly.test.ts:50 — // TODO(P6): npm lifecycle E2E depends on registry/network package resolution. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-scripts.nightly.test.ts:17 — // TODO(P6): npm script E2E depends on registry command artifacts. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-suite.nightly.test.ts:91 — // TODO(P6): npm command suite depends on registry command/runtime artifacts. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-suite.nightly.test.ts:203 — // TODO(P6): npm install suite depends on registry/network package resolution. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-suite.nightly.test.ts:313 — // TODO(P6): npm error-path suite depends on registry command/runtime artifacts. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npm-version-init.nightly.test.ts:25 — // TODO(P6): npm/npx command E2E depends on registry command artifacts. — 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.
  • TodoComment packages/runtime-core/tests/integration/e2e-npx-and-pipes.nightly.test.ts:37 — // TODO(P6): npx resolution E2E depends on npm registry access. — 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.
  • TodoComment packages/agentos-toolchain/tests/pack.test.ts:141 — // TODO(P6): npm-backed pack flow depends on local npm/package resolution artifacts. — 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.
  • TodoComment crates/native-sidecar/tests/service.rs:4209 — // TODO(clippy-1.98): release the VM RefCell borrow before awaiting; holding it can panic with "already borrowed". — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:246 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:337 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:547 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:628 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:783 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:915 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:925 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/process_event_broker.rs:1022 — // TODO(clippy-1.98): broker API awaiting unified-sidecar-runtime migration callers — 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.
  • TodoComment crates/native-sidecar/src/service.rs:2099 — // TODO(clippy-1.98): unused; wire up or remove. — 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.
  • TodoComment crates/native-sidecar/src/state.rs:1514 — // TODO(clippy-1.98): unused; wire up or remove. — 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×39
  • Duplicated block (11 lines × 2) crates/client/src/agent_os.rs:1853 — crates/client/src/agent_os.rs:1853-1863 | crates/client/src/agent_os.rs:1889-1899 — both copies are in the same file, so extract the 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/client/src/language_execution.rs:1037 — crates/client/src/language_execution.rs:1037-1047 | crates/client/src/language_execution.rs:1060-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.
  • Duplicated block (11 lines × 2) crates/execution/src/javascript.rs:207 — crates/execution/src/javascript.rs:207-217 | crates/v8-runtime/src/host_call.rs:85-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.
  • Duplicated block (11 lines × 2) crates/execution/src/v8_ipc.rs:175 — crates/execution/src/v8_ipc.rs:175-185 | crates/v8-runtime/src/ipc_binary.rs:452-462 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 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 (11 lines × 2) crates/execution/src/v8_ipc.rs:464 — crates/execution/src/v8_ipc.rs:464-474 | crates/v8-runtime/src/ipc_binary.rs:606-616 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 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 (11 lines × 2) crates/execution/src/v8_ipc.rs:477 — crates/execution/src/v8_ipc.rs:477-487 | crates/v8-runtime/src/ipc_binary.rs:619-629 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 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 (11 lines × 2) crates/kernel/src/fd_table.rs:1726 — crates/kernel/src/fd_table.rs:1726-1736 | crates/kernel/src/fd_table.rs:1742-1752 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:126 — crates/kernel/src/kernel.rs:126-136 | crates/native-sidecar/src/execution/launch.rs:2542-2552 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) crates/kernel/src/kernel.rs:2745 — crates/kernel/src/kernel.rs:2745-2755 | crates/kernel/src/kernel.rs:2781-2791 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:9325 — crates/kernel/src/kernel.rs:9325-9335 | crates/vfs/src/posix/vfs.rs:2496-2506 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4703 — crates/native-sidecar/src/execution/child_process.rs:4703-4713 | crates/native-sidecar/src/execution/launch.rs:5014-5024 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (11 lines × 2) crates/native-sidecar/src/execution/child_process.rs:9327 — crates/native-sidecar/src/execution/child_process.rs:9327-9337 | crates/native-sidecar/src/execution/child_process.rs:9354-9364 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:9954 — crates/native-sidecar/src/execution/child_process.rs:9954-9964 | crates/native-sidecar/src/execution/child_process.rs:10316-10326 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/crypto.rs:1044 — crates/native-sidecar/src/execution/javascript/crypto.rs:1044-1054 | crates/native-sidecar/src/execution/javascript/crypto.rs:1095-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.
  • Duplicated block (11 lines × 2) crates/native-sidecar/src/execution/javascript/http.rs:1015 — crates/native-sidecar/src/execution/javascript/http.rs:1015-1025 | crates/native-sidecar/src/execution/javascript/http.rs:2611-2621 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/rpc.rs:3902 — crates/native-sidecar/src/execution/javascript/rpc.rs:3902-3912 | crates/native-sidecar/src/execution/javascript/rpc.rs:3965-3975 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process.rs:1865 — crates/native-sidecar/src/execution/process.rs:1865-1875 | crates/native-sidecar/src/execution/process.rs:1943-1953 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/python/sockets.rs:477 — crates/native-sidecar/src/execution/python/sockets.rs:477-487 | crates/native-sidecar/src/execution/python/sockets.rs:790-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 (11 lines × 2) crates/native-sidecar/src/execution/python/sockets.rs:595 — crates/native-sidecar/src/execution/python/sockets.rs:595-605 | crates/native-sidecar/src/execution/python/sockets.rs:810-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.
  • Duplicated block (11 lines × 2) crates/native-sidecar/src/plugins/sandbox_agent.rs:344 — crates/native-sidecar/src/plugins/sandbox_agent.rs:344-354 | crates/native-sidecar/src/plugins/sandbox_agent.rs:364-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.
  • Duplicated block (11 lines × 2) crates/native-sidecar/src/service.rs:2107 — crates/native-sidecar/src/service.rs:2107-2117 | crates/native-sidecar/src/service.rs:2147-2157 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:3467 — crates/native-sidecar/src/service.rs:3467-3477 | crates/native-sidecar/src/service.rs:3582-3592 — both copies are in the same file, so extract the 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/v8-runtime/src/session.rs:1461 — crates/v8-runtime/src/session.rs:1461-1471 | crates/v8-runtime/src/session.rs:1476-1486 — both copies are in the same file, so extract the 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/vfs/src/engine/engines/chunked.rs:1222 — crates/vfs/src/engine/engines/chunked.rs:1222-1232 | crates/vfs/src/posix/vfs.rs:2279-2289 — before extracting anything, compare `crates/vfs/src/engine/engines/chunked.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 6 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.
  • Duplicated block (11 lines × 2) crates/vfs/src/engine/mem/metadata_store.rs:515 — crates/vfs/src/engine/mem/metadata_store.rs:515-525 | crates/vfs/src/engine/mem/metadata_store.rs:551-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×38
  • Duplicated block (12 lines × 2) crates/kernel/src/kernel.rs:901 — crates/kernel/src/kernel.rs:901-912 | crates/kernel/src/kernel.rs:965-976 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:2969 — crates/kernel/src/kernel.rs:2969-2980 | crates/kernel/src/kernel.rs:3267-3278 — both copies are in the same file, so extract the 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/kernel/src/pipe_manager.rs:578 — crates/kernel/src/pipe_manager.rs:578-589 | crates/kernel/src/pty.rs:645-656 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 (12 lines × 2) crates/kernel/src/pty.rs:158 — crates/kernel/src/pty.rs:158-169 | crates/kernel/src/pty.rs:184-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/native-sidecar-core/src/guest_net.rs:298 — crates/native-sidecar-core/src/guest_net.rs:298-309 | crates/native-sidecar-core/src/guest_net.rs:409-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4091 — crates/native-sidecar/src/execution/child_process.rs:4091-4102 | crates/native-sidecar/src/execution/launch.rs:124-135 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (12 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:115 — crates/native-sidecar/src/execution/javascript/rpc.rs:115-126 | crates/native-sidecar/src/execution/javascript/rpc.rs:195-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.
  • Duplicated block (12 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:373 — crates/native-sidecar/src/execution/network/http2.rs:373-384 | crates/native-sidecar/src/execution/network/http2.rs:628-639 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/http2.rs:955 — crates/native-sidecar/src/execution/network/http2.rs:955-966 | crates/native-sidecar/src/execution/network/http2.rs:1001-1012 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tcp.rs:1088 — crates/native-sidecar/src/execution/network/tcp.rs:1088-1099 | crates/native-sidecar/src/execution/network/tcp.rs:1138-1149 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:2668 — crates/native-sidecar/src/filesystem.rs:2668-2679 | crates/native-sidecar/src/filesystem.rs:2724-2735 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:4607 — crates/native-sidecar/src/filesystem.rs:4607-4618 | crates/native-sidecar/src/filesystem.rs:4657-4668 — both copies are in the same file, so extract the 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/native-sidecar/src/language_execution.rs:542 — crates/native-sidecar/src/language_execution.rs:542-553 | crates/native-sidecar/src/language_execution.rs:571-582 — both copies are in the same file, so extract the 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/native-sidecar/src/plugins/chunked_local.rs:79 — crates/native-sidecar/src/plugins/chunked_local.rs:79-90 | crates/native-sidecar/src/plugins/chunked_sqlite.rs:328-339 — 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 (12 lines × 2) crates/native-sidecar/src/plugins/google_drive.rs:977 — crates/native-sidecar/src/plugins/google_drive.rs:977-988 | crates/native-sidecar/src/plugins/s3_common.rs:19-30 — 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 (12 lines × 2) crates/native-sidecar/src/process_event_broker.rs:586 — crates/native-sidecar/src/process_event_broker.rs:586-597 | crates/native-sidecar/src/process_event_broker.rs:759-770 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:2935 — crates/native-sidecar/src/service.rs:2935-2946 | crates/native-sidecar/src/service.rs:2969-2980 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:2027 — crates/native-sidecar/src/stdio.rs:2027-2038 | crates/native-sidecar/src/stdio.rs:2042-2053 — both copies are in the same file, so extract the 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/runtime/src/lib.rs:1462 — crates/runtime/src/lib.rs:1462-1473 | crates/runtime/src/lib.rs:1524-1535 — both copies are in the same file, so extract the 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/runtime/src/metrics.rs:621 — crates/runtime/src/metrics.rs:621-632 | crates/runtime/src/metrics.rs:635-646 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:1433 — crates/v8-runtime/src/execution.rs:1433-1444 | crates/v8-runtime/src/execution.rs:1463-1474 — both copies are in the same file, so extract the 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/v8-runtime/src/host_call.rs:1117 — crates/v8-runtime/src/host_call.rs:1117-1128 | crates/v8-runtime/src/host_call.rs:1145-1156 — both copies are in the same file, so extract the 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/v8-runtime/src/session.rs:1610 — crates/v8-runtime/src/session.rs:1610-1621 | crates/v8-runtime/src/session.rs:1704-1715 — both copies are in the same file, so extract the 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/vfs/src/engine/engines/chunked.rs:555 — crates/vfs/src/engine/engines/chunked.rs:555-566 | crates/vfs/src/engine/engines/object.rs:180-191 — 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 (12 lines × 2) crates/vfs/src/engine/engines/chunked.rs:1276 — crates/vfs/src/engine/engines/chunked.rs:1276-1287 | crates/vfs/src/posix/vfs.rs:2405-2416 — before extracting anything, compare `crates/vfs/src/engine/engines/chunked.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 6 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.
  • + 13 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×38
  • Swallowed exception (empty catch) scripts/publish/src/lib/r2.ts:143 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/typescript/src/index.ts:303 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/typescript/src/index.ts:431 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/typescript/src/index.ts:613 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/shell/src/main.ts:211 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/shell/src/main.ts:556 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-sidecar/index.js:35 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/cargo.ts:118 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:415 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1560 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1608 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1611 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1640 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1644 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1666 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1716 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1757 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:1793 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:2144 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/native-client.ts:88 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/native-client.ts:181 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/native-client.ts:188 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/native-client.ts:197 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/native-client.ts:206 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/runtime-core/src/native-client.ts:211 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 13 more in this group — see findings.md.
D1 · Cyclomatic Complexity · agentos_native_sidecar · ×37
  • agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc (cyclomatic 155) crates/native-sidecar/src/filesystem.rs:1564 — agentos_native_sidecar::filesystem::service_javascript_fs_sync_rpc has cyclomatic complexity 155 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc (cyclomatic 154) crates/native-sidecar/src/execution/javascript/rpc.rs:613 — agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc has cyclomatic complexity 154 (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.
  • agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc (cyclomatic 145) crates/native-sidecar/src/execution/javascript/rpc.rs:2997 — agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc has cyclomatic complexity 145 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_native_sidecar::stdio::run_protocol_engine (cyclomatic 79) crates/native-sidecar/src/stdio.rs:1840 — agentos_native_sidecar::stdio::run_protocol_engine has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_native_sidecar::execution::network::http2::spawn_http2_server_session (cyclomatic 60) crates/native-sidecar/src/execution/network/http2.rs:2310 — agentos_native_sidecar::execution::network::http2::spawn_http2_server_session 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.
  • agentos_native_sidecar::execution::network::udp::run_native_udp_owner (cyclomatic 50) crates/native-sidecar/src/execution/network/udp.rs:579 — agentos_native_sidecar::execution::network::udp::run_native_udp_owner 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.
  • agentos_native_sidecar::execution::child_process::apply_posix_spawn_file_actions (cyclomatic 46) crates/native-sidecar/src/execution/child_process.rs:2014 — agentos_native_sidecar::execution::child_process::apply_posix_spawn_file_actions has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_native_sidecar::execution::network::http2::service_javascript_http2_sync_rpc (cyclomatic 39) crates/native-sidecar/src/execution/network/http2.rs:3099 — agentos_native_sidecar::execution::network::http2::service_javascript_http2_sync_rpc has cyclomatic complexity 39 (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.
  • agentos_native_sidecar::execution::network::http2::spawn_http2_client_session (cyclomatic 38) crates/native-sidecar/src/execution/network/http2.rs:1867 — agentos_native_sidecar::execution::network::http2::spawn_http2_client_session 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.
  • agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc_response (cyclomatic 33) crates/native-sidecar/src/execution/javascript/rpc.rs:2558 — agentos_native_sidecar::execution::javascript::rpc::service_javascript_net_sync_rpc_response 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.
  • agentos_native_sidecar::execution::network::http2::poll_client_http2_streams (cyclomatic 33) crates/native-sidecar/src/execution/network/http2.rs:342 — agentos_native_sidecar::execution::network::http2::poll_client_http2_streams 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.
  • agentos_native_sidecar::execution::network::http2::poll_server_http2_streams (cyclomatic 33) crates/native-sidecar/src/execution/network/http2.rs:599 — agentos_native_sidecar::execution::network::http2::poll_server_http2_streams 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.
  • agentos_native_sidecar::execution::network::tls::run_native_tls_transport (cyclomatic 32) crates/native-sidecar/src/execution/network/tls.rs:1016 — agentos_native_sidecar::execution::network::tls::run_native_tls_transport 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.
  • agentos_native_sidecar::language_execution::lower_operation (cyclomatic 32) crates/native-sidecar/src/language_execution.rs:520 — agentos_native_sidecar::language_execution::lower_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.
  • agentos_native_sidecar::execution::process::find_socket_state_entry (cyclomatic 30) crates/native-sidecar/src/execution/process.rs:1994 — agentos_native_sidecar::execution::process::find_socket_state_entry 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.
  • agentos_native_sidecar::execution::launch::sync_host_directory_tree_to_kernel_inner (cyclomatic 28) crates/native-sidecar/src/execution/launch.rs:1229 — agentos_native_sidecar::execution::launch::sync_host_directory_tree_to_kernel_inner 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.
  • agentos_native_sidecar::filesystem::service_owned_python_filesystem_rpc_request (cyclomatic 28) crates/native-sidecar/src/filesystem.rs:899 — agentos_native_sidecar::filesystem::service_owned_python_filesystem_rpc_request 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.
  • agentos_native_sidecar::filesystem::mapped_runtime_host_path (cyclomatic 28) crates/native-sidecar/src/filesystem.rs:3360 — agentos_native_sidecar::filesystem::mapped_runtime_host_path 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.
  • agentos_native_sidecar::stdio::run_async (cyclomatic 28) crates/native-sidecar/src/stdio.rs:1449 — agentos_native_sidecar::stdio::run_async 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.
  • agentos_native_sidecar::stdio::route_protocol_frame (cyclomatic 27) crates/native-sidecar/src/stdio.rs:3164 — agentos_native_sidecar::stdio::route_protocol_frame 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.
  • agentos_native_sidecar::execution::network::dns::dns_resolution_to_node_value (cyclomatic 24) crates/native-sidecar/src/execution/network/dns.rs:146 — agentos_native_sidecar::execution::network::dns::dns_resolution_to_node_value 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.
  • agentos_native_sidecar::execution::process::terminate_child_process_tree (cyclomatic 24) crates/native-sidecar/src/execution/process.rs:2661 — agentos_native_sidecar::execution::process::terminate_child_process_tree 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.
  • agentos_native_sidecar::extension_services::prepare_extension_service_command (cyclomatic 24) crates/native-sidecar/src/extension_services.rs:1505 — agentos_native_sidecar::extension_services::prepare_extension_service_command 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.
  • agentos_native_sidecar::plugins::host_dir::confine::resolve_impl (cyclomatic 24) crates/native-sidecar/src/plugins/host_dir.rs:345 — agentos_native_sidecar::plugins::host_dir::confine::resolve_impl 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.
  • agentos_native_sidecar::execution::network::tcp::spawn_tcp_socket_reader (cyclomatic 22) crates/native-sidecar/src/execution/network/tcp.rs:3043 — agentos_native_sidecar::execution::network::tcp::spawn_tcp_socket_reader 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.
  • + 12 more in this group — see findings.md.
D2 · Cognitive Complexity · NativeSidecar · ×34
  • NativeSidecar::poll_descendant_javascript_child_process (cognitive 394) crates/native-sidecar/src/execution/child_process.rs:8752 — NativeSidecar::poll_descendant_javascript_child_process has cognitive complexity 394 (threshold 15). Drivers by points: if/else 111 (346 pts), match/switch 9 (29 pts), boolean chains 12, loops 3 (7 pts) (nesting depth added 259). 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.
  • NativeSidecar::pump_detached_child_process_events_nowait (cognitive 260) crates/native-sidecar/src/execution/child_process.rs:3245 — NativeSidecar::pump_detached_child_process_events_nowait has cognitive complexity 260 (threshold 15). Drivers by points: if/else 53 (227 pts), match/switch 5 (19 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 191). 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.
  • NativeSidecar::pump_process_events_nowait (cognitive 96) crates/native-sidecar/src/execution/process_events.rs:702 — NativeSidecar::pump_process_events_nowait has cognitive complexity 96 (threshold 15). Drivers by points: if/else 25 (76 pts), match/switch 3 (11 pts), boolean chains 6, loops 2 (3 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.
  • NativeSidecar::handle_javascript_sync_rpc_request (cognitive 96) crates/native-sidecar/src/service.rs:4206 — NativeSidecar::handle_javascript_sync_rpc_request has cognitive complexity 96 (threshold 15). Drivers by points: if/else 39 (71 pts), match/switch 10 (20 pts), boolean chains 5 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeSidecar::resolve_javascript_child_process_execution_with_mode (cognitive 86) crates/native-sidecar/src/execution/child_process.rs:3973 — NativeSidecar::resolve_javascript_child_process_execution_with_mode has cognitive complexity 86 (threshold 15). Drivers by points: if/else 44 (70 pts), boolean chains 16 (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.
  • NativeSidecar::pump_process_events (cognitive 85) crates/native-sidecar/src/execution/process_events.rs:1170 — NativeSidecar::pump_process_events has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (66 pts), match/switch 2 (9 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 56). 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.
  • NativeSidecar::drain_queued_descendant_javascript_child_process_events (cognitive 81) crates/native-sidecar/src/execution/child_process.rs:3817 — NativeSidecar::drain_queued_descendant_javascript_child_process_events has cognitive complexity 81 (threshold 15). Drivers by points: if/else 16 (51 pts), loops 5 (14 pts), match/switch 3 (14 pts), boolean chains 2 (nesting depth added 55). 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.
  • NativeSidecar::build_owned_descendant_javascript_child_process_spawn (cognitive 67) crates/native-sidecar/src/execution/child_process.rs:6004 — NativeSidecar::build_owned_descendant_javascript_child_process_spawn has cognitive complexity 67 (threshold 15). Drivers by points: if/else 32 (47 pts), boolean chains 10, match/switch 6 (10 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.
  • NativeSidecar::pump_child_process_events_nowait (cognitive 56) crates/native-sidecar/src/execution/child_process.rs:2666 — NativeSidecar::pump_child_process_events_nowait has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (41 pts), match/switch 3 (10 pts), loops 3 (4 pts), boolean chains 1 (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.
  • NativeSidecar::kill_process_in_vm (cognitive 56) crates/native-sidecar/src/execution/signals.rs:627 — NativeSidecar::kill_process_in_vm has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 13, match/switch 4 (10 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.
  • NativeSidecar::spawn_javascript_child_process (cognitive 54) crates/native-sidecar/src/execution/child_process.rs:4452 — NativeSidecar::spawn_javascript_child_process has cognitive complexity 54 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 10, match/switch 3 (7 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.
  • NativeSidecar::service_child_kernel_wait_rpc_in_vm (cognitive 46) crates/native-sidecar/src/execution/child_process.rs:8247 — NativeSidecar::service_child_kernel_wait_rpc_in_vm has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 9 (16 pts), boolean chains 5 (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.
  • NativeSidecar::handle_descendant_process_kill_rpc (cognitive 44) crates/native-sidecar/src/execution/child_process.rs:10003 — NativeSidecar::handle_descendant_process_kill_rpc has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (42 pts), boolean chains 1, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeSidecar::expire_public_execution_deadlines (cognitive 41) crates/native-sidecar/src/language_execution.rs:2498 — NativeSidecar::expire_public_execution_deadlines has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 5, boolean chains 3 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • NativeSidecar::prepare_request_wire (cognitive 41) crates/native-sidecar/src/service.rs:2598 — NativeSidecar::prepare_request_wire has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (32 pts), match/switch 5 (8 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.
  • NativeSidecar::route_child_process_bridge_event (cognitive 40) crates/native-sidecar/src/execution/child_process.rs:3002 — NativeSidecar::route_child_process_bridge_event has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 6 (11 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.
  • NativeSidecar::poll_event (cognitive 40) crates/native-sidecar/src/service.rs:3236 — NativeSidecar::poll_event has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 3 (5 pts), match/switch 2 (5 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.
  • NativeSidecar::poll_owned_descendant_javascript_child_process (cognitive 39) crates/native-sidecar/src/execution/child_process.rs:7355 — NativeSidecar::poll_owned_descendant_javascript_child_process has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 4 (8 pts), boolean chains 5, loops 2 (4 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.
  • NativeSidecar::exec_javascript_process_image_owned (cognitive 37) crates/native-sidecar/src/execution/child_process.rs:5332 — NativeSidecar::exec_javascript_process_image_owned has cognitive complexity 37 (threshold 15). Drivers by points: if/else 25 (32 pts), boolean chains 3, match/switch 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • NativeSidecar::dispose_vm_internal (cognitive 35) crates/native-sidecar/src/vm.rs:1233 — NativeSidecar::dispose_vm_internal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (29 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeSidecar::poll_event_nowait (cognitive 32) crates/native-sidecar/src/service.rs:3328 — NativeSidecar::poll_event_nowait has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (5 pts), match/switch 1 (3 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.
  • NativeSidecar::record_public_execution_output (cognitive 28) crates/native-sidecar/src/language_execution.rs:2665 — NativeSidecar::record_public_execution_output has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeSidecar::handle_process_event_envelope (cognitive 26) crates/native-sidecar/src/service.rs:3428 — NativeSidecar::handle_process_event_envelope has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeSidecar::prepare_owned_javascript_process_event_service (cognitive 24) crates/native-sidecar/src/execution/child_process.rs:7012 — NativeSidecar::prepare_owned_javascript_process_event_service has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 4 (7 pts), boolean chains 2 (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.
  • NativeSidecar::recover_descendant_runtime_child_process_event (cognitive 23) crates/native-sidecar/src/execution/child_process.rs:9792 — NativeSidecar::recover_descendant_runtime_child_process_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 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.
  • + 9 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×32
  • Sync-over-async blocking REDACTED:137 — `readSync` in `read` 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 REDACTED:143 — `closeSync` in `close` 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 REDACTED:380 — `fs.closeSync` in `close` 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 REDACTED:393 — `fs.fstatSync` in `stat` 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 REDACTED:397 — `fs.fsyncSync` in `sync` 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 REDACTED:404 — `fs.ftruncateSync` in `truncate` 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 REDACTED:412 — `fs.chmodSync` in `chmod` 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 REDACTED:420 — `fs.chownSync` in `chown` 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 REDACTED:424 — `fs.futimesSync` in `utimes` 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 REDACTED:446 — `fs.readSync` in `read` 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 REDACTED:462 — `fs.writeSync` in `write` 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 REDACTED:470 — `fs.writeSync` in `write` 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 REDACTED:1513 — `fs.readSync` in `_readAllContent` 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 REDACTED:1809 — `fs.writevSync` in `callback to void` 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 REDACTED:1819 — `fs.readFileSync` in `callback to void` 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 REDACTED:1831 — `fs.writeFileSync` in `callback to void` 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 REDACTED:1833 — `fs.writeFileSync` in `callback to void` 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 REDACTED:2410 — `fs.openSync` in `fsReadFileAsync` 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 REDACTED:3905 — `fs.cpSync` in `cp` 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 REDACTED:3908 — `fs.mkdtempSync` in `mkdtemp` 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 REDACTED:3911 — `fs.opendirSync` in `opendir` 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 REDACTED:3914 — `fs.openSync` in `open` 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 REDACTED:3917 — `fs.statfsSync` in `statfs` 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 REDACTED:3920 — `fs.globSync` in `glob` 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 REDACTED:3926 — `fs.rmSync` in `rm` 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.
  • + 7 more in this group — see findings.md.
D1 · Cyclomatic Complexity · NativeSidecar · ×29
  • NativeSidecar::poll_descendant_javascript_child_process (cyclomatic 141) crates/native-sidecar/src/execution/child_process.rs:8752 — NativeSidecar::poll_descendant_javascript_child_process has cyclomatic complexity 141 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeSidecar::pump_detached_child_process_events_nowait (cyclomatic 82) crates/native-sidecar/src/execution/child_process.rs:3245 — NativeSidecar::pump_detached_child_process_events_nowait has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeSidecar::handle_javascript_sync_rpc_request (cyclomatic 70) crates/native-sidecar/src/service.rs:4206 — NativeSidecar::handle_javascript_sync_rpc_request has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeSidecar::prepare_request_wire (cyclomatic 61) crates/native-sidecar/src/service.rs:2598 — NativeSidecar::prepare_request_wire has cyclomatic complexity 61 (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.
  • NativeSidecar::kill_process_in_vm (cyclomatic 52) crates/native-sidecar/src/execution/signals.rs:627 — NativeSidecar::kill_process_in_vm has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeSidecar::resolve_javascript_child_process_execution_with_mode (cyclomatic 47) crates/native-sidecar/src/execution/child_process.rs:3973 — NativeSidecar::resolve_javascript_child_process_execution_with_mode has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NativeSidecar::dispatch (cyclomatic 47) crates/native-sidecar/src/service.rs:2441 — NativeSidecar::dispatch has cyclomatic complexity 47 (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.
  • NativeSidecar::build_owned_descendant_javascript_child_process_spawn (cyclomatic 42) crates/native-sidecar/src/execution/child_process.rs:6004 — NativeSidecar::build_owned_descendant_javascript_child_process_spawn 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.
  • NativeSidecar::pump_process_events_nowait (cyclomatic 41) crates/native-sidecar/src/execution/process_events.rs:702 — NativeSidecar::pump_process_events_nowait 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.
  • NativeSidecar::service_child_kernel_wait_rpc_in_vm (cyclomatic 39) crates/native-sidecar/src/execution/child_process.rs:8247 — NativeSidecar::service_child_kernel_wait_rpc_in_vm has cyclomatic complexity 39 (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.
  • NativeSidecar::spawn_javascript_child_process (cyclomatic 35) crates/native-sidecar/src/execution/child_process.rs:4452 — NativeSidecar::spawn_javascript_child_process 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.
  • NativeSidecar::handle_descendant_process_kill_rpc (cyclomatic 31) crates/native-sidecar/src/execution/child_process.rs:10003 — NativeSidecar::handle_descendant_process_kill_rpc 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.
  • NativeSidecar::pump_process_events (cyclomatic 29) crates/native-sidecar/src/execution/process_events.rs:1170 — NativeSidecar::pump_process_events 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.
  • NativeSidecar::pump_child_process_events_nowait (cyclomatic 28) crates/native-sidecar/src/execution/child_process.rs:2666 — NativeSidecar::pump_child_process_events_nowait 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.
  • NativeSidecar::drain_queued_descendant_javascript_child_process_events (cyclomatic 28) crates/native-sidecar/src/execution/child_process.rs:3817 — NativeSidecar::drain_queued_descendant_javascript_child_process_events 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.
  • NativeSidecar::exec_javascript_process_image_owned (cyclomatic 28) crates/native-sidecar/src/execution/child_process.rs:5332 — NativeSidecar::exec_javascript_process_image_owned 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.
  • NativeSidecar::route_child_process_bridge_event (cyclomatic 26) crates/native-sidecar/src/execution/child_process.rs:3002 — NativeSidecar::route_child_process_bridge_event 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.
  • NativeSidecar::poll_owned_descendant_javascript_child_process (cyclomatic 26) crates/native-sidecar/src/execution/child_process.rs:7355 — NativeSidecar::poll_owned_descendant_javascript_child_process 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.
  • NativeSidecar::dispose_vm_internal (cyclomatic 25) crates/native-sidecar/src/vm.rs:1233 — NativeSidecar::dispose_vm_internal 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.
  • NativeSidecar::handle_execution_event (cyclomatic 24) crates/native-sidecar/src/execution/process_events.rs:1584 — NativeSidecar::handle_execution_event 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.
  • NativeSidecar::service_deferrable_kernel_wait_rpc (cyclomatic 24) crates/native-sidecar/src/service.rs:4043 — NativeSidecar::service_deferrable_kernel_wait_rpc 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.
  • NativeSidecar::prepare_owned_javascript_process_event_service (cyclomatic 22) crates/native-sidecar/src/execution/child_process.rs:7012 — NativeSidecar::prepare_owned_javascript_process_event_service 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.
  • NativeSidecar::expire_public_execution_deadlines (cyclomatic 21) crates/native-sidecar/src/language_execution.rs:2498 — NativeSidecar::expire_public_execution_deadlines 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.
  • NativeSidecar::complete_public_execution (cyclomatic 21) crates/native-sidecar/src/language_execution.rs:2759 — NativeSidecar::complete_public_execution 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.
  • NativeSidecar::poll_event (cyclomatic 19) crates/native-sidecar/src/service.rs:3236 — NativeSidecar::poll_event 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.
  • + 4 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×28
  • ClassTooLong: KernelVm crates/kernel/src/kernel.rs:446 — ClassTooLong — 6188 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 363 methods, 4 blocks, lines 446-9946. The bar is 400 significant lines; this is 5788 over it, 15.47× 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: AgentOs packages/core/src/agent-os.ts:2706 — ClassTooLong — 2305 significant lines (blank, comment-only and punctuation-only lines excluded), 147 methods. The bar is 400 significant lines; this is 1905 over it, 5.76× 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: NativeSidecarKernelProxy REDACTED:358 — ClassTooLong — 1424 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 1024 over it, 3.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: OverlayFileSystem crates/vfs/src/posix/overlay_fs.rs:20 — ClassTooLong — 1376 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 72 methods, 3 blocks, lines 20-2141. The bar is 400 significant lines; this is 976 over it, 3.44× 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: fs REDACTED:1 — ClassTooLong — 1271 significant lines (blank, comment-only and punctuation-only lines excluded), 98 methods. The bar is 400 significant lines; this is 871 over it, 3.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: SocketTable crates/kernel/src/socket_table.rs:834 — ClassTooLong — 1236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 2 blocks, lines 834-2492. The bar is 400 significant lines; this is 836 over it, 3.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SidecarProcess packages/runtime-core/src/sidecar-process.ts:349 — ClassTooLong — 1159 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 759 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: OwnedLanguageSidecar crates/native-sidecar/src/language_execution.rs:897 — ClassTooLong — 1138 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 897-2401. The bar is 400 significant lines; this is 738 over it, 2.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: BrowserSidecar crates/native-sidecar-browser/src/service.rs:334 — ClassTooLong — 1135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 3 blocks, lines 334-1899. The bar is 400 significant lines; this is 735 over it, 2.84× 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: MemoryFileSystem crates/vfs/src/posix/vfs.rs:784 — ClassTooLong — 1041 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 4 blocks, lines 784-2194. The bar is 400 significant lines; this is 641 over it, 2.60× 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: MountTable crates/vfs/src/posix/mount_table.rs:1192 — ClassTooLong — 1004 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 4 blocks, lines 1192-2588. The bar is 400 significant lines; this is 604 over it, 2.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ChunkedFs crates/vfs/src/engine/engines/chunked.rs:40 — ClassTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 5 blocks, lines 40-1198. The bar is 400 significant lines; this is 480 over it, 2.20× 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: BrowserWireDispatcher crates/native-sidecar-browser/src/wire_dispatch.rs:55 — ClassTooLong — 763 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 2 blocks, lines 55-1126. The bar is 400 significant lines; this is 363 over it, 1.91× 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: AgentOs crates/client/src/agent_os.rs:128 — ClassTooLong — 704 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 165 methods, 2 blocks, lines 128-1197. The bar is 400 significant lines; this is 304 over it, 1.76× 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: OwnedPythonSocketService crates/native-sidecar/src/execution/python/sockets.rs:346 — ClassTooLong — 645 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 346-1219. The bar is 400 significant lines; this is 245 over it, 1.61× 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: HostDirFilesystem crates/native-sidecar/src/plugins/host_dir.rs:659 — ClassTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 3 blocks, lines 659-1538. The bar is 400 significant lines; this is 210 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: JavascriptBenchmarkReport crates/execution/src/benchmark.rs:126 — ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 2 blocks, lines 126-937. The bar is 400 significant lines; this is 191 over it, 1.48× 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: DgramSocket packages/build-tools/bridge-src/builtins/dgram.ts:529 — ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 182 over it, 1.46× 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: PtyManager crates/kernel/src/pty.rs:294 — ClassTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 3 blocks, lines 294-1042. The bar is 400 significant lines; this is 127 over it, 1.32× 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: ClientRequest packages/build-tools/bridge-src/builtins/http.ts:388 — ClassTooLong — 507 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 107 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.
  • ClassTooLong: PipeManager crates/kernel/src/pipe_manager.rs:161 — ClassTooLong — 476 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 161-828. The bar is 400 significant lines; this is 76 over it, 1.19× 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: BrowserRuntimeDriver packages/runtime-browser/src/runtime-driver.ts:499 — ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 64 over it, 1.16× 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: ServerResponseBridge packages/build-tools/bridge-src/builtins/http.ts:2953 — ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 48 over it, 1.12× 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: SandboxAgentFilesystem crates/native-sidecar/src/plugins/sandbox_agent.rs:52 — ClassTooLong — 439 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 3 blocks, lines 52-637. The bar is 400 significant lines; this is 39 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.
  • ClassTooLong: BridgeCallRegistry crates/v8-runtime/src/host_call.rs:399 — ClassTooLong — 424 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, 2 blocks, lines 399-984. The bar is 400 significant lines; this is 24 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 3 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×27
  • Hotspot: crates/native-sidecar/src/execution/child_process.rs crates/native-sidecar/src/execution/child_process.rs:8752 — crates/native-sidecar/src/execution/child_process.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in NativeSidecar::poll_descendant_javascript_child_process at line 8752. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/child_process.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/native-sidecar/src/execution/javascript/rpc.rs crates/native-sidecar/src/execution/javascript/rpc.rs:613 — crates/native-sidecar/src/execution/javascript/rpc.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 154 in agentos_native_sidecar::execution::javascript::rpc::service_javascript_sync_rpc at line 613. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/javascript/rpc.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/v8-runtime/src/session.rs crates/v8-runtime/src/session.rs:2238 — crates/v8-runtime/src/session.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in agentos_v8_runtime::session::session_thread at line 2238. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/v8-runtime/src/session.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/native-sidecar/src/language_execution.rs crates/native-sidecar/src/language_execution.rs:1235 — crates/native-sidecar/src/language_execution.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in OwnedLanguageSidecar::execute_language_operation_owned at line 1235. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/language_execution.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/native-sidecar/src/service.rs crates/native-sidecar/src/service.rs:4206 — crates/native-sidecar/src/service.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in NativeSidecar::handle_javascript_sync_rpc_request at line 4206. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/service.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/native-sidecar/src/stdio.rs crates/native-sidecar/src/stdio.rs:1840 — crates/native-sidecar/src/stdio.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in agentos_native_sidecar::stdio::run_protocol_engine at line 1840. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/stdio.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: packages/core/src/agent-os.ts packages/core/src/agent-os.ts:2935 — packages/core/src/agent-os.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in AgentOs.create at line 2935. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- packages/core/src/agent-os.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/execution/src/javascript.rs crates/execution/src/javascript.rs:3921 — crates/execution/src/javascript.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in agentos_execution::javascript::spawn_v8_event_bridge at line 3921. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/execution/src/javascript.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/native-sidecar/src/execution/launch.rs crates/native-sidecar/src/execution/launch.rs:4939 — crates/native-sidecar/src/execution/launch.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in agentos_native_sidecar::execution::launch::execute_owned at line 4939. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/launch.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/native-sidecar/src/execution/signals.rs crates/native-sidecar/src/execution/signals.rs:627 — crates/native-sidecar/src/execution/signals.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in NativeSidecar::kill_process_in_vm at line 627. 2 of those changes were fix/bug commits, and the other 2 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/signals.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/native-sidecar/src/execution/process_events.rs crates/native-sidecar/src/execution/process_events.rs:1584 — crates/native-sidecar/src/execution/process_events.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in NativeSidecar::handle_execution_event at line 1584. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/process_events.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/client/src/agent_os.rs crates/client/src/agent_os.rs:282 — crates/client/src/agent_os.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in AgentOs::create_vm at line 282. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/client/src/agent_os.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: packages/runtime-core/src/request-payloads.ts packages/runtime-core/src/request-payloads.ts:405 — packages/runtime-core/src/request-payloads.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in request-payloads.toGeneratedRequestPayload at line 405. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- packages/runtime-core/src/request-payloads.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/native-sidecar/src/filesystem.rs crates/native-sidecar/src/filesystem.rs:899 — crates/native-sidecar/src/filesystem.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in agentos_native_sidecar::filesystem::service_owned_python_filesystem_rpc_request at line 899. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/filesystem.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/client/src/process.rs crates/client/src/process.rs:555 — crates/client/src/process.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in AgentOs::exec_argv_process at line 555. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/client/src/process.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/native-sidecar/src/vm.rs crates/native-sidecar/src/vm.rs:1233 — crates/native-sidecar/src/vm.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in NativeSidecar::dispose_vm_internal at line 1233. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/vm.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/native-sidecar/src/execution/javascript/http.rs crates/native-sidecar/src/execution/javascript/http.rs:2181 — crates/native-sidecar/src/execution/javascript/http.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in agentos_native_sidecar::execution::javascript::http::read_owned_kernel_http_fetch_stream at line 2181. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/javascript/http.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/native-sidecar/src/execution/process.rs crates/native-sidecar/src/execution/process.rs:1840 — crates/native-sidecar/src/execution/process.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in ActiveExecution::poll_event at line 1840. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/process.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/native-sidecar/src/execution/python/sockets.rs crates/native-sidecar/src/execution/python/sockets.rs:470 — crates/native-sidecar/src/execution/python/sockets.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in OwnedPythonSocketService::python_socket_op at line 470. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/python/sockets.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: REDACTED REDACTED:863 — REDACTED changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in NativeSidecarKernelProxy.spawn at line 863. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/runtime-core/src/host-functions-zod.ts packages/runtime-core/src/host-functions-zod.ts:151 — packages/runtime-core/src/host-functions-zod.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in host-functions-zod.validateSchema at line 151. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- packages/runtime-core/src/host-functions-zod.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/bridge/src/queue_tracker.rs crates/bridge/src/queue_tracker.rs:109 — crates/bridge/src/queue_tracker.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in TrackedLimit::as_str at line 109. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/bridge/src/queue_tracker.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/native-sidecar-core/src/limits.rs crates/native-sidecar-core/src/limits.rs:1134 — crates/native-sidecar-core/src/limits.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in agentos_native_sidecar_core::limits::validate_vm_limits at line 1134. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar-core/src/limits.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/runtime/src/lib.rs crates/runtime/src/lib.rs:503 — crates/runtime/src/lib.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in RuntimeConfig::validate at line 503. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/runtime/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: crates/vm-config/src/lib.rs crates/vm-config/src/lib.rs:981 — crates/vm-config/src/lib.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in VmLimitsConfig::validate at line 981. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/vm-config/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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×27
  • Duplicated block (5 lines × 2) crates/execution/src/python.rs:1550 — crates/execution/src/python.rs:1550-1554 | crates/execution/src/wasm.rs:2859-2863 — before extracting anything, compare `crates/execution/src/python.rs` and `crates/execution/src/wasm.rs` as WHOLE FILES: this scan already matched 9 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 (5 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4928 — crates/native-sidecar/src/execution/child_process.rs:4928-4932 | crates/native-sidecar/src/execution/child_process.rs:5605-5609 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/execution/javascript/http.rs:1072 — crates/native-sidecar/src/execution/javascript/http.rs:1072-1077 | crates/native-sidecar/src/execution/javascript/http.rs:2275-2279 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/execution/process.rs:2510 — crates/native-sidecar/src/execution/process.rs:2510-2514 | crates/native-sidecar/src/execution/process.rs:2554-2558 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/plugins/sandbox_agent.rs:432 — crates/native-sidecar/src/plugins/sandbox_agent.rs:432-436 | crates/native-sidecar/src/plugins/sandbox_agent.rs:521-525 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/stdio.rs:4238 — crates/native-sidecar/src/stdio.rs:4238-4242 | crates/native-sidecar/src/stdio.rs:4325-4329 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/stdio.rs:4251 — crates/native-sidecar/src/stdio.rs:4251-4255 | crates/native-sidecar/src/stdio.rs:4338-4342 — both copies are in the same file, so extract the 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) crates/v8-runtime/src/bridge.rs:1324 — crates/v8-runtime/src/bridge.rs:1324-1328 | crates/v8-runtime/src/bridge.rs:1330-1334 — both copies are in the same file, so extract the 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) crates/v8-runtime/src/execution.rs:2248 — crates/v8-runtime/src/execution.rs:2248-2252 | crates/v8-runtime/src/execution.rs:2301-2305 — both copies are in the same file, so extract the 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) crates/vfs/src/posix/overlay_fs.rs:442 — crates/vfs/src/posix/overlay_fs.rs:442-446 | crates/vfs/src/posix/overlay_fs.rs:482-486 — both copies are in the same file, so extract the 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) crates/vfs/src/posix/overlay_fs.rs:1112 — crates/vfs/src/posix/overlay_fs.rs:1112-1116 | crates/vfs/src/posix/overlay_fs.rs:1334-1338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) software/coreutils/native/crates/cmd-df/src/main.rs:134 — software/coreutils/native/crates/cmd-df/src/main.rs:134-138 | software/coreutils/native/crates/cmd-findmnt/src/main.rs:206-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) software/coreutils/native/crates/cmd-df/src/main.rs:153 — software/coreutils/native/crates/cmd-df/src/main.rs:153-157 | software/coreutils/native/crates/cmd-findmnt/src/main.rs:226-230 — 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) toolchain/crates/libs/wasi-pty/src/lib.rs:155 — toolchain/crates/libs/wasi-pty/src/lib.rs:155-159 | toolchain/crates/libs/wasi-spawn/src/lib.rs:159-163 — before extracting anything, compare `toolchain/crates/libs/wasi-pty/src/lib.rs` and `toolchain/crates/libs/wasi-spawn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 120 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/native-sidecar-core/src/guest_net.rs:525 — crates/native-sidecar-core/src/guest_net.rs:525-531 | crates/native-sidecar-core/src/guest_pty.rs:125-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 both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/v8-runtime/src/execution.rs:115 — crates/v8-runtime/src/execution.rs:115-120 | crates/v8-runtime/src/execution.rs:128-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/client/src/config.rs:413 — crates/client/src/config.rs:413-418 | crates/client/src/config.rs:425-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.
  • Duplicated block (5 lines × 2) crates/v8-runtime/src/execution.rs:703 — crates/v8-runtime/src/execution.rs:703-707 | crates/v8-runtime/src/execution.rs:729-734 — both copies are in the same file, so extract the 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) crates/execution/src/wasm.rs:1653 — crates/execution/src/wasm.rs:1653-1657 | crates/execution/src/wasm.rs:1691-1695 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/package_projection.rs:226 — crates/native-sidecar/src/package_projection.rs:226-230 | crates/native-sidecar/src/package_projection.rs:247-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.
  • Duplicated block (5 lines × 2) crates/native-baseline/src/main.rs:447 — crates/native-baseline/src/main.rs:447-451 | crates/native-baseline/src/main.rs:462-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/v8-runtime/src/execution.rs:2795 — crates/v8-runtime/src/execution.rs:2795-2799 | crates/v8-runtime/src/execution.rs:2859-2863 — both copies are in the same file, so extract the 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) crates/kernel/src/kernel.rs:8135 — crates/kernel/src/kernel.rs:8135-8139 | crates/vfs/src/package_format/pack.rs:382-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 (5 lines × 2) crates/native-sidecar/src/plugins/host_dir.rs:1255 — crates/native-sidecar/src/plugins/host_dir.rs:1255-1259 | crates/native-sidecar/src/plugins/host_dir.rs:1267-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.
  • Duplicated block (5 lines × 2) crates/native-sidecar/src/state.rs:922 — crates/native-sidecar/src/state.rs:922-926 | crates/native-sidecar/src/state.rs:948-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×25
  • Duplicated block (13 lines × 2) crates/client/src/agent_os.rs:2003 — crates/client/src/agent_os.rs:2003-2015 | crates/client/src/agent_os.rs:2029-2041 — both copies are in the same file, so extract the 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/client/src/process.rs:1526 — crates/client/src/process.rs:1526-1538 | crates/client/src/process.rs:1657-1669 — both copies are in the same file, so extract the 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/execution/src/javascript.rs:139 — crates/execution/src/javascript.rs:139-151 | crates/native-sidecar/src/execution/process_events.rs:430-442 — before extracting anything, compare `crates/execution/src/javascript.rs` and `crates/native-sidecar/src/execution/process_events.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. 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 (13 lines × 2) crates/kernel/src/kernel.rs:2398 — crates/kernel/src/kernel.rs:2398-2410 | crates/kernel/src/kernel.rs:2462-2474 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:2952 — crates/kernel/src/kernel.rs:2952-2964 | crates/kernel/src/kernel.rs:3253-3265 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:3885 — crates/kernel/src/kernel.rs:3885-3897 | crates/kernel/src/kernel.rs:5211-5223 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:6580 — crates/kernel/src/kernel.rs:6580-6592 | crates/kernel/src/kernel.rs:6598-6610 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:3518 — crates/native-sidecar/src/execution/child_process.rs:3518-3530 | crates/native-sidecar/src/execution/child_process.rs:3550-3562 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:9892 — crates/native-sidecar/src/execution/child_process.rs:9892-9904 | crates/native-sidecar/src/execution/child_process.rs:9923-9935 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/python/sockets.rs:588 — crates/native-sidecar/src/execution/python/sockets.rs:588-600 | crates/native-sidecar/src/execution/python/sockets.rs:656-668 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:409 — crates/native-sidecar/src/filesystem.rs:409-421 | crates/native-sidecar/src/filesystem.rs:452-464 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:4636 — crates/native-sidecar/src/filesystem.rs:4636-4648 | crates/native-sidecar/src/filesystem.rs:4678-4690 — both copies are in the same file, so extract the 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/native-sidecar/src/language_execution.rs:854 — crates/native-sidecar/src/language_execution.rs:854-866 | crates/native-sidecar/src/language_execution.rs:1855-1867 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:3453 — crates/native-sidecar/src/service.rs:3453-3465 | crates/native-sidecar/src/service.rs:3569-3581 — both copies are in the same file, so extract the 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/native-sidecar/src/state.rs:928 — crates/native-sidecar/src/state.rs:928-940 | crates/native-sidecar/src/state.rs:954-966 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:4284 — crates/native-sidecar/src/stdio.rs:4284-4296 | crates/native-sidecar/src/stdio.rs:4362-4374 — both copies are in the same file, so extract the 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/native-sidecar/src/vm.rs:4787 — crates/native-sidecar/src/vm.rs:4787-4799 | crates/vfs/src/posix/root_fs.rs:857-869 — 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 (13 lines × 2) crates/vfs/src/posix/mount_table.rs:259 — crates/vfs/src/posix/mount_table.rs:259-271 | crates/vfs/src/posix/vfs.rs:648-660 — before extracting anything, compare `crates/vfs/src/posix/mount_table.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 × 2) crates/vfs/src/posix/overlay_fs.rs:464 — crates/vfs/src/posix/overlay_fs.rs:464-476 | crates/vfs/src/posix/overlay_fs.rs:501-513 — both copies are in the same file, so extract the 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/vfs/src/posix/overlay_fs.rs:1866 — crates/vfs/src/posix/overlay_fs.rs:1866-1878 | crates/vfs/src/posix/overlay_fs.rs:1891-1903 — both copies are in the same file, so extract the 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) software/tar/native/crates/tar/src/lib.rs:808 — software/tar/native/crates/tar/src/lib.rs:808-820 | software/tar/native/crates/tar/src/lib.rs:823-835 — both copies are in the same file, so extract the 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) toolchain/crates/libs/wasi-spawn/src/lib.rs:302 — toolchain/crates/libs/wasi-spawn/src/lib.rs:302-314 | toolchain/crates/libs/wasi-spawn/src/lib.rs:315-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) toolchain/crates/wasi-ext/src/lib.rs:1531 — toolchain/crates/wasi-ext/src/lib.rs:1531-1543 | toolchain/crates/wasi-ext/src/lib.rs:1573-1585 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/python/sockets.rs:1046 — crates/native-sidecar/src/execution/python/sockets.rs:1046-1058 | crates/native-sidecar/src/execution/python/sockets.rs:1130-1142 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/rpc.rs:3048 — crates/native-sidecar/src/execution/javascript/rpc.rs:3048-3060 | crates/native-sidecar/src/execution/network/http2.rs:3243-3255 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×23
  • Duplicated block (14 lines × 2) crates/kernel/src/kernel.rs:4832 — crates/kernel/src/kernel.rs:4832-4845 | crates/kernel/src/kernel.rs:5683-5696 — both copies are in the same file, so extract the 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/kernel/src/socket_table.rs:2129 — crates/kernel/src/socket_table.rs:2129-2142 | crates/kernel/src/socket_table.rs:2196-2209 — both copies are in the same file, so extract the 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/native-sidecar-core/src/vm_fetch.rs:140 — crates/native-sidecar-core/src/vm_fetch.rs:140-153 | crates/native-sidecar/src/execution/javascript/http.rs:219-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.
  • Duplicated block (14 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4162 — crates/native-sidecar/src/execution/child_process.rs:4162-4175 | crates/native-sidecar/src/execution/launch.rs:143-156 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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/native-sidecar/src/execution/child_process.rs:4219 — crates/native-sidecar/src/execution/child_process.rs:4219-4232 | crates/native-sidecar/src/execution/launch.rs:200-213 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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/native-sidecar/src/execution/javascript/crypto.rs:2131 — crates/native-sidecar/src/execution/javascript/crypto.rs:2131-2144 | crates/native-sidecar/src/execution/javascript/crypto.rs:2177-2190 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/http2.rs:819 — crates/native-sidecar/src/execution/network/http2.rs:819-832 | crates/native-sidecar/src/execution/network/http2.rs:872-885 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tcp.rs:2753 — crates/native-sidecar/src/execution/network/tcp.rs:2753-2766 | crates/native-sidecar/src/execution/network/tcp.rs:2928-2941 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process_events.rs:1148 — crates/native-sidecar/src/execution/process_events.rs:1148-1161 | crates/native-sidecar/src/execution/process_events.rs:1735-1748 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:2400 — crates/native-sidecar/src/filesystem.rs:2400-2413 | crates/native-sidecar/src/filesystem.rs:2415-2428 — both copies are in the same file, so extract the 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/native-sidecar/src/plugins/host_dir.rs:741 — crates/native-sidecar/src/plugins/host_dir.rs:741-754 | crates/native-sidecar/src/plugins/host_dir.rs:775-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.
  • Duplicated block (14 lines × 2) crates/native-sidecar/src/plugins/host_dir.rs:1662 — crates/native-sidecar/src/plugins/host_dir.rs:1662-1675 | crates/native-sidecar/src/plugins/host_dir.rs:1697-1710 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:5177 — crates/native-sidecar/src/service.rs:5177-5190 | crates/native-sidecar/src/service.rs:5212-5225 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:5938 — crates/native-sidecar/src/service.rs:5938-5951 | crates/vfs/src/posix/mount_table.rs:2636-2649 — 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 (14 lines × 2) crates/native-sidecar/src/vm.rs:791 — crates/native-sidecar/src/vm.rs:791-804 | crates/native-sidecar/src/vm.rs:1714-1727 — both copies are in the same file, so extract the 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/native-sidecar/src/vm.rs:3763 — crates/native-sidecar/src/vm.rs:3763-3776 | crates/native-sidecar/src/vm.rs:3906-3919 — both copies are in the same file, so extract the 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/native-sidecar/src/vm_sqlite.rs:177 — crates/native-sidecar/src/vm_sqlite.rs:177-190 | crates/native-sidecar/src/vm_sqlite.rs:267-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/v8-runtime/src/execution.rs:617 — crates/v8-runtime/src/execution.rs:617-630 | crates/v8-runtime/src/execution.rs:632-645 — both copies are in the same file, so extract the 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) software/coreutils/native/crates/cmd-df/src/main.rs:159 — software/coreutils/native/crates/cmd-df/src/main.rs:159-172 | software/coreutils/native/crates/cmd-findmnt/src/main.rs:232-245 — 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 (14 lines × 2) toolchain/crates/wasi-ext/src/lib.rs:518 — toolchain/crates/wasi-ext/src/lib.rs:518-531 | toolchain/crates/wasi-ext/src/lib.rs:544-557 — both copies are in the same file, so extract the 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/native-sidecar/src/extension_services.rs:506 — crates/native-sidecar/src/extension_services.rs:506-519 | crates/native-sidecar/src/extension_services.rs:696-709 — both copies are in the same file, so extract the 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/native-sidecar/src/filesystem.rs:2186 — crates/native-sidecar/src/filesystem.rs:2186-2199 | crates/native-sidecar/src/filesystem.rs:2773-2786 — both copies are in the same file, so extract the 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/client/src/process.rs:718 — crates/client/src/process.rs:718-731 | crates/client/src/process.rs:740-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×23
  • Duplicated block (6 lines × 2) crates/execution/src/javascript.rs:2301 — crates/execution/src/javascript.rs:2301-2306 | crates/native-sidecar/src/filesystem.rs:1357-1363 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/kernel/src/fd_table.rs:346 — crates/kernel/src/fd_table.rs:346-351 | crates/kernel/src/fd_table.rs:357-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/kernel/src/kernel.rs:4950 — crates/kernel/src/kernel.rs:4950-4955 | crates/kernel/src/kernel.rs:5691-5696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/kernel/src/pty.rs:1252 — crates/kernel/src/pty.rs:1252-1260 | crates/kernel/src/pty.rs:1299-1304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/execution/launch.rs:3471 — crates/native-sidecar/src/execution/launch.rs:3471-3476 | crates/native-sidecar/src/execution/launch.rs:3493-3498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/execution/network/tcp.rs:967 — crates/native-sidecar/src/execution/network/tcp.rs:967-972 | crates/native-sidecar/src/execution/network/tcp.rs:1346-1351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/filesystem.rs:382 — crates/native-sidecar/src/filesystem.rs:382-387 | crates/native-sidecar/src/plugins/host_dir.rs:972-977 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/sidecar-protocol/src/wire.rs:984 — crates/sidecar-protocol/src/wire.rs:984-989 | crates/sidecar-protocol/src/wire.rs:1013-1018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/vfs/src/posix/overlay_fs.rs:1881 — crates/vfs/src/posix/overlay_fs.rs:1881-1886 | crates/vfs/src/posix/overlay_fs.rs:1906-1911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/vfs/src/posix/vfs.rs:2098 — crates/vfs/src/posix/vfs.rs:2098-2103 | crates/vfs/src/posix/vfs.rs:2113-2118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/execution/src/v8_host.rs:219 — crates/execution/src/v8_host.rs:219-224 | crates/execution/src/wasm.rs:4395-4400 — 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/kernel/src/pipe_manager.rs:822 — crates/kernel/src/pipe_manager.rs:822-827 | crates/kernel/src/pty.rs:1036-1041 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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) toolchain/crates/commands/http-test/src/lib.rs:14 — software/curl/native/crates/cmd-curl/src/main.rs:153-158 | toolchain/crates/commands/http-test/src/lib.rs:14-19 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) toolchain/crates/libs/wasi-pty/src/lib.rs:59 — toolchain/crates/libs/wasi-pty/src/lib.rs:59-64 | toolchain/crates/libs/wasi-spawn/src/lib.rs:70-75 — before extracting anything, compare `toolchain/crates/libs/wasi-pty/src/lib.rs` and `toolchain/crates/libs/wasi-spawn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 120 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) toolchain/crates/libs/wasi-pty/src/lib.rs:132 — toolchain/crates/libs/wasi-pty/src/lib.rs:132-137 | toolchain/crates/libs/wasi-spawn/src/lib.rs:136-141 — before extracting anything, compare `toolchain/crates/libs/wasi-pty/src/lib.rs` and `toolchain/crates/libs/wasi-spawn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 120 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/native-sidecar/src/execution/child_process.rs:130 — crates/native-sidecar/src/execution/child_process.rs:130-137 | crates/native-sidecar/src/execution/python/sockets.rs:417-422 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/v8-runtime/src/snapshot.rs:541 — crates/v8-runtime/src/snapshot.rs:541-547 | crates/v8-runtime/src/snapshot.rs:560-565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/kernel/src/kernel.rs:2641 — crates/kernel/src/kernel.rs:2641-2646 | crates/kernel/src/kernel.rs:2707-2712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/plugins/google_drive.rs:476 — crates/native-sidecar/src/plugins/google_drive.rs:476-481 | crates/native-sidecar/src/plugins/google_drive.rs:497-502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/execution/network/udp.rs:1995 — crates/native-sidecar/src/execution/network/udp.rs:1995-2000 | crates/native-sidecar/src/execution/network/udp.rs:2024-2029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/execution/python/sockets.rs:1066 — crates/native-sidecar/src/execution/python/sockets.rs:1066-1071 | crates/native-sidecar/src/execution/python/sockets.rs:1085-1090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) software/diffutils/native/crates/diff/src/lib.rs:308 — software/diffutils/native/crates/diff/src/lib.rs:308-313 | software/diffutils/native/crates/diff/src/lib.rs:318-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/native-sidecar/src/execution/network/tcp.rs:269 — crates/native-sidecar/src/execution/network/tcp.rs:269-274 | crates/native-sidecar/src/execution/network/unix.rs:565-570 — before extracting anything, compare `crates/native-sidecar/src/execution/network/tcp.rs` and `crates/native-sidecar/src/execution/network/unix.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 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.
D3 · God Classes · TooManyMethods · ×22
  • TooManyMethods: KernelVm crates/kernel/src/kernel.rs:446 — TooManyMethods — 363 methods. The bar is 30 methods; this is 333 over it, 12.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: NativeSidecar crates/native-sidecar/src/service.rs:1369 — TooManyMethods — 248 methods, declared across 12 files: src/service.rs (102), execution/child_process.rs (47), src/vm.rs (33), execution/process_events.rs (27), +8 more file(s). The bar is 30 methods; this is 218 over it, 8.27× 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: AgentOs crates/client/src/agent_os.rs:128 — TooManyMethods — 165 methods, declared across 8 files: src/fs.rs (39), src/process.rs (37), src/language_execution.rs (35), src/shell.rs (23), +4 more file(s). The bar is 30 methods; this is 135 over it, 5.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgentOs packages/core/src/agent-os.ts:2706 — TooManyMethods — 147 methods. The bar is 30 methods; this is 117 over it, 4.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.
  • TooManyMethods: WASI crates/execution/assets/runners/wasi-module.js:94 — TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.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.
  • TooManyMethods: OverlayFileSystem crates/vfs/src/posix/overlay_fs.rs:20 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× 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: SidecarProcess packages/runtime-core/src/sidecar-process.ts:349 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.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.
  • TooManyMethods: NativeSidecarKernelProxy REDACTED:482 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.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: BrowserSidecar crates/native-sidecar-browser/src/service.rs:334 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.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: NativeSidecarKernelProxy REDACTED:358 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 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.
  • TooManyMethods: ActiveProcess crates/native-sidecar/src/state.rs:2039 — 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: SocketTable crates/kernel/src/socket_table.rs:834 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: _NetSocket packages/build-tools/bridge-src/builtins/net.ts:1767 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: DgramSocket packages/build-tools/bridge-src/builtins/dgram.ts:529 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× 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: ClientRequest packages/build-tools/bridge-src/builtins/http.ts:388 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× 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: ProcessFdTable crates/kernel/src/fd_table.rs:721 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: BrowserWireDispatcher crates/native-sidecar-browser/src/wire_dispatch.rs:55 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: SessionManager crates/v8-runtime/src/session.rs:1225 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: ServerResponseBridge packages/build-tools/bridge-src/builtins/http.ts:2953 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: WasmExecution crates/execution/src/wasm.rs:452 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: JavascriptExecution crates/execution/src/javascript.rs:1821 — 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: ProcessTable crates/kernel/src/process_table.rs:311 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×21
  • Duplicated block (16 lines × 2) crates/client/src/agent_os.rs:2123 — crates/client/src/agent_os.rs:2123-2138 | crates/client/src/agent_os.rs:2753-2768 — both copies are in the same file, so extract the 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/client/src/shell.rs:971 — crates/client/src/shell.rs:971-986 | crates/client/src/shell.rs:1034-1049 — both copies are in the same file, so extract the 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/execution/src/python.rs:1236 — crates/execution/src/python.rs:1236-1251 | crates/execution/src/python.rs:1290-1305 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:9799 — crates/kernel/src/kernel.rs:9799-9814 | crates/native-sidecar/src/plugins/sandbox_agent.rs:143-158 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) crates/kernel/src/socket_table.rs:1147 — crates/kernel/src/socket_table.rs:1147-1162 | crates/kernel/src/socket_table.rs:1182-1197 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:5255 — crates/native-sidecar/src/execution/child_process.rs:5255-5270 | crates/native-sidecar/src/execution/child_process.rs:8073-8088 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/http.rs:675 — crates/native-sidecar/src/execution/javascript/http.rs:675-690 | crates/native-sidecar/src/execution/javascript/http.rs:755-770 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/http.rs:870 — crates/native-sidecar/src/execution/javascript/http.rs:870-885 | crates/native-sidecar/src/execution/javascript/http.rs:2637-2652 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/rpc.rs:1250 — crates/native-sidecar/src/execution/javascript/rpc.rs:1250-1265 | crates/native-sidecar/src/execution/javascript/rpc.rs:1274-1289 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/http2.rs:461 — crates/native-sidecar/src/execution/network/http2.rs:461-476 | crates/native-sidecar/src/execution/network/http2.rs:662-677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/native-sidecar/src/execution/network/tls.rs:391 — crates/native-sidecar/src/execution/network/tls.rs:391-406 | crates/native-sidecar/src/execution/network/tls.rs:545-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.
  • Duplicated block (16 lines × 2) crates/native-sidecar/src/execution/network/unix.rs:1250 — crates/native-sidecar/src/execution/network/unix.rs:1250-1265 | crates/native-sidecar/src/execution/network/unix.rs:1284-1299 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/process_events.rs:1122 — crates/native-sidecar/src/execution/process_events.rs:1122-1137 | crates/native-sidecar/src/execution/process_events.rs:1703-1718 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:3520 — crates/native-sidecar/src/service.rs:3520-3535 | crates/native-sidecar/src/service.rs:3619-3634 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:2205 — crates/native-sidecar/src/stdio.rs:2205-2220 | crates/native-sidecar/src/stdio.rs:2238-2253 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:2273 — crates/native-sidecar/src/stdio.rs:2273-2288 | crates/native-sidecar/src/stdio.rs:2321-2336 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:10210 — crates/native-sidecar/src/stdio.rs:10210-10225 | crates/native-sidecar/src/stdio.rs:10241-10256 — both copies are in the same file, so extract the 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/v8-runtime/src/bridge.rs:1256 — crates/v8-runtime/src/bridge.rs:1256-1271 | crates/v8-runtime/src/bridge.rs:1284-1299 — both copies are in the same file, so extract the 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/v8-runtime/src/session.rs:2782 — crates/v8-runtime/src/session.rs:2782-2797 | crates/v8-runtime/src/session.rs:2829-2844 — both copies are in the same file, so extract the 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/vfs/src/engine/engines/chunked.rs:1290 — crates/vfs/src/engine/engines/chunked.rs:1290-1305 | crates/vfs/src/posix/vfs.rs:2419-2434 — before extracting anything, compare `crates/vfs/src/engine/engines/chunked.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 6 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.
  • Duplicated block (16 lines × 2) toolchain/crates/libs/wasi-pty/src/lib.rs:82 — toolchain/crates/libs/wasi-pty/src/lib.rs:82-97 | toolchain/crates/libs/wasi-spawn/src/lib.rs:86-101 — before extracting anything, compare `toolchain/crates/libs/wasi-pty/src/lib.rs` and `toolchain/crates/libs/wasi-spawn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 120 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.
R11 · Import Boundaries · Boundary violation [package · ×17
  • Boundary violation [package:third-party-deep-import] REDACTED:18 — REDACTED:18 imports undici/lib/api/index.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:19 — REDACTED:19 imports undici/lib/dispatcher/agent.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:20 — REDACTED:20 imports undici/lib/dispatcher/client.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:21 — REDACTED:21 imports undici/lib/web/fetch/index.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:22 — REDACTED:22 imports undici/lib/web/fetch/formdata.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:23 — REDACTED:23 imports undici/lib/global.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:24 — REDACTED:24 imports undici/lib/web/fetch/headers.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:25 — REDACTED:25 imports undici/lib/web/fetch/request.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:26 — REDACTED:26 imports undici/lib/web/fetch/response.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:27 — REDACTED:27 imports undici/lib/web/webidl/index.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:78 — REDACTED:78 imports undici/lib/util/runtime-features.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:test-cross-package-internals] packages/core/tests/sandbox-integration.test.ts:3 — packages/core/tests/sandbox-integration.test.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../../agentos-sandbox/src/index.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/vm-test-harness/src/index.ts:63 — packages/vm-test-harness/src/index.ts:63 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/vm-test-harness/src/index.ts:72 — packages/vm-test-harness/src/index.ts:72 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/vm-test-harness/src/index.ts:88 — packages/vm-test-harness/src/index.ts:88 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/vm-test-harness/src/index.ts:95 — packages/vm-test-harness/src/index.ts:95 reaches past another workspace package's public entry into its internals with a relative path (../../runtime-core/src/test-runtime.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:relative-cross-package] scripts/publish/verify-common-software.mjs:12 — scripts/publish/verify-common-software.mjs:12 reaches into another package with a relative path (../../software/common/package.json) — import the package by name instead.
D30 · Dependency Vulnerabilities · Medium CVE · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×16
  • Duplicated block (15 lines × 2) crates/execution/src/javascript.rs:1413 — crates/execution/src/javascript.rs:1413-1427 | crates/execution/src/javascript.rs:1433-1447 — both copies are in the same file, so extract the 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/execution/src/python.rs:1076 — crates/execution/src/python.rs:1076-1090 | crates/execution/src/wasm.rs:1069-1083 — before extracting anything, compare `crates/execution/src/python.rs` and `crates/execution/src/wasm.rs` as WHOLE FILES: this scan already matched 9 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 (15 lines × 2) crates/execution/src/v8_ipc.rs:228 — crates/execution/src/v8_ipc.rs:228-242 | crates/v8-runtime/src/ipc_binary.rs:520-534 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 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 (15 lines × 2) crates/kernel/src/kernel.rs:8431 — crates/kernel/src/kernel.rs:8431-8445 | crates/kernel/src/kernel.rs:8472-8486 — both copies are in the same file, so extract the 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/kernel/src/pipe_manager.rs:537 — crates/kernel/src/pipe_manager.rs:537-551 | crates/kernel/src/pty.rs:547-561 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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/kernel/src/socket_table.rs:2117 — crates/kernel/src/socket_table.rs:2117-2131 | crates/kernel/src/socket_table.rs:2229-2243 — both copies are in the same file, so extract the 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/native-sidecar-browser/src/service.rs:1802 — crates/native-sidecar-browser/src/service.rs:1802-1816 | crates/native-sidecar/src/execution/network/tcp.rs:2222-2236 — 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 (15 lines × 2) crates/native-sidecar/src/execution/child_process.rs:3306 — crates/native-sidecar/src/execution/child_process.rs:3306-3320 | crates/native-sidecar/src/execution/child_process.rs:3639-3653 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/rpc.rs:2373 — crates/native-sidecar/src/execution/javascript/rpc.rs:2373-2387 | crates/native-sidecar/src/filesystem.rs:5522-5536 — 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 (15 lines × 2) crates/native-sidecar/src/execution/launch.rs:197 — crates/native-sidecar/src/execution/launch.rs:197-211 | crates/native-sidecar/src/execution/launch.rs:258-272 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tls.rs:1180 — crates/native-sidecar/src/execution/network/tls.rs:1180-1194 | crates/native-sidecar/src/execution/network/tls.rs:1275-1289 — both copies are in the same file, so extract the 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/native-sidecar/src/stdio.rs:4629 — crates/native-sidecar/src/stdio.rs:4629-4643 | crates/native-sidecar/src/stdio.rs:4666-4680 — both copies are in the same file, so extract the 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/v8-runtime/src/execution.rs:1614 — crates/v8-runtime/src/execution.rs:1614-1628 | crates/v8-runtime/src/execution.rs:1737-1751 — both copies are in the same file, so extract the 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/vfs/src/posix/overlay_fs.rs:1324 — crates/vfs/src/posix/overlay_fs.rs:1324-1338 | crates/vfs/src/posix/overlay_fs.rs:1388-1402 — both copies are in the same file, so extract the 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) software/yq/native/crates/yq/src/lib.rs:292 — software/yq/native/crates/yq/src/lib.rs:292-306 | software/yq/native/crates/yq/src/lib.rs:340-354 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/crypto.rs:2052 — crates/native-sidecar/src/execution/javascript/crypto.rs:2052-2068 | crates/native-sidecar/src/execution/javascript/crypto.rs:2196-2210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · agentos_v8_runtime · ×14
  • agentos_v8_runtime::session::session_thread (cognitive 365) crates/v8-runtime/src/session.rs:2238 — agentos_v8_runtime::session::session_thread has cognitive complexity 365 (threshold 15). Drivers by points: if/else 72 (288 pts), match/switch 11 (46 pts), boolean chains 17, loops 3 (14 pts) (nesting depth added 262). 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.
  • agentos_v8_runtime::session::run_event_loop_with_readiness (cognitive 108) crates/v8-runtime/src/session.rs:3463 — agentos_v8_runtime::session::run_event_loop_with_readiness has cognitive complexity 108 (threshold 15). Drivers by points: if/else 27 (68 pts), match/switch 10 (34 pts), loops 3 (6 pts) (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_v8_runtime::execution::has_probable_esm_syntax (cognitive 78) crates/v8-runtime/src/execution.rs:2588 — agentos_v8_runtime::execution::has_probable_esm_syntax has cognitive complexity 78 (threshold 15). Drivers by points: if/else 22 (56 pts), loops 3 (10 pts), boolean chains 7, match/switch 2 (5 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_v8_runtime::execution::collect_object_literal_keys (cognitive 64) crates/v8-runtime/src/execution.rs:3079 — agentos_v8_runtime::execution::collect_object_literal_keys has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (53 pts), boolean chains 5, match/switch 2 (5 pts), loops 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.
  • agentos_v8_runtime::execution::find_code_pattern (cognitive 62) crates/v8-runtime/src/execution.rs:2894 — agentos_v8_runtime::execution::find_code_pattern has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (54 pts), boolean chains 5, match/switch 1 (2 pts), loops 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.
  • agentos_v8_runtime::execution::prefetch_module_imports (cognitive 55) crates/v8-runtime/src/execution.rs:1542 — agentos_v8_runtime::execution::prefetch_module_imports has cognitive complexity 55 (threshold 15). Drivers by points: if/else 9 (31 pts), match/switch 4 (14 pts), loops 4 (8 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.
  • agentos_v8_runtime::execution::execute_script_with_options (cognitive 32) crates/v8-runtime/src/execution.rs:546 — agentos_v8_runtime::execution::execute_script_with_options has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 6 (8 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.
  • agentos_v8_runtime::session::dispatch_ready_batch_callbacks (cognitive 30) crates/v8-runtime/src/session.rs:3797 — agentos_v8_runtime::session::dispatch_ready_batch_callbacks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (6 pts), loops 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.
  • agentos_v8_runtime::stream::dispatch_stream_event (cognitive 30) crates/v8-runtime/src/stream.rs:15 — agentos_v8_runtime::stream::dispatch_stream_event has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 4 (19 pts), if/else 4 (10 pts), loops 1 (nesting depth added 21). 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.
  • agentos_v8_runtime::execution::execute_module (cognitive 26) crates/v8-runtime/src/execution.rs:1301 — agentos_v8_runtime::execution::execute_module has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 7 (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.
  • agentos_v8_runtime::execution::extract_runtime_cjs_export_names_inner (cognitive 24) crates/v8-runtime/src/execution.rs:2464 — agentos_v8_runtime::execution::extract_runtime_cjs_export_names_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 10, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_v8_runtime::execution::require_esm_sync_callback (cognitive 20) crates/v8-runtime/src/execution.rs:136 — agentos_v8_runtime::execution::require_esm_sync_callback has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 1 (3 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.
  • agentos_v8_runtime::bridge::v8_to_cbor_inner (cognitive 17) crates/v8-runtime/src/bridge.rs:169 — agentos_v8_runtime::bridge::v8_to_cbor_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (4 pts) (nesting depth added 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.
  • agentos_v8_runtime::execution::dynamic_import_callback (cognitive 16) crates/v8-runtime/src/execution.rs:1939 — agentos_v8_runtime::execution::dynamic_import_callback has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×13
  • Duplicated block (19 lines × 2) crates/execution/src/python.rs:1688 — crates/execution/src/python.rs:1688-1706 | crates/execution/src/wasm.rs:3608-3626 — before extracting anything, compare `crates/execution/src/python.rs` and `crates/execution/src/wasm.rs` as WHOLE FILES: this scan already matched 9 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 (19 lines × 2) crates/kernel/src/kernel.rs:1968 — crates/kernel/src/kernel.rs:1968-1986 | crates/kernel/src/kernel.rs:2077-2095 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:2993 — crates/kernel/src/kernel.rs:2993-3011 | crates/kernel/src/kernel.rs:3291-3309 — both copies are in the same file, so extract the 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/kernel/src/kernel.rs:4337 — crates/kernel/src/kernel.rs:4337-4355 | crates/kernel/src/kernel.rs:4401-4419 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/child_process.rs:9646 — crates/native-sidecar/src/execution/child_process.rs:9646-9664 | crates/native-sidecar/src/execution/child_process.rs:9694-9712 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/javascript/crypto.rs:2027 — crates/native-sidecar/src/execution/javascript/crypto.rs:2027-2045 | crates/native-sidecar/src/execution/javascript/crypto.rs:2047-2065 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:3479 — crates/native-sidecar/src/service.rs:3479-3497 | crates/native-sidecar/src/service.rs:3593-3611 — both copies are in the same file, so extract the 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/native-sidecar/src/service.rs:4404 — crates/native-sidecar/src/service.rs:4404-4422 | crates/native-sidecar/src/service.rs:4440-4458 — both copies are in the same file, so extract the 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/native-sidecar/src/vm.rs:771 — crates/native-sidecar/src/vm.rs:771-789 | crates/native-sidecar/src/vm.rs:1694-1712 — both copies are in the same file, so extract the 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/runtime/src/capability.rs:506 — crates/runtime/src/capability.rs:506-524 | crates/runtime/src/capability.rs:540-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.
  • Duplicated block (19 lines × 2) crates/vfs/src/engine/engines/chunked.rs:1079 — crates/vfs/src/engine/engines/chunked.rs:1079-1097 | crates/vfs/src/engine/engines/chunked.rs:1125-1143 — both copies are in the same file, so extract the 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) toolchain/crates/libs/wasi-pty/src/lib.rs:101 — toolchain/crates/libs/wasi-pty/src/lib.rs:101-119 | toolchain/crates/libs/wasi-spawn/src/lib.rs:105-123 — before extracting anything, compare `toolchain/crates/libs/wasi-pty/src/lib.rs` and `toolchain/crates/libs/wasi-spawn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 120 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 (19 lines × 2) crates/native-sidecar/src/stdio.rs:2740 — crates/native-sidecar/src/stdio.rs:2740-2758 | crates/native-sidecar/src/stdio.rs:2789-2807 — both copies are in the same file, so extract the 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 (17 lines × 2) · ×13
  • Duplicated block (17 lines × 2) crates/kernel/src/pipe_manager.rs:595 — crates/kernel/src/pipe_manager.rs:595-611 | crates/kernel/src/pty.rs:665-681 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 (17 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4181 — crates/native-sidecar/src/execution/child_process.rs:4181-4197 | crates/native-sidecar/src/execution/launch.rs:162-178 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (17 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4200 — crates/native-sidecar/src/execution/child_process.rs:4200-4216 | crates/native-sidecar/src/execution/launch.rs:181-197 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (17 lines × 2) crates/native-sidecar/src/execution/child_process.rs:10047 — crates/native-sidecar/src/execution/child_process.rs:10047-10063 | crates/native-sidecar/src/execution/child_process.rs:10116-10132 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/execution/javascript/http.rs:507 — crates/native-sidecar/src/execution/javascript/http.rs:507-524 | crates/native-sidecar/src/execution/javascript/http.rs:2831-2847 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/execution/launch.rs:1527 — crates/native-sidecar/src/execution/launch.rs:1527-1543 | crates/native-sidecar/src/filesystem.rs:5752-5768 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:3649 — crates/native-sidecar/src/execution/network/http2.rs:3649-3665 | crates/native-sidecar/src/execution/network/http2.rs:3680-3696 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/execution/signals.rs:331 — crates/native-sidecar/src/execution/signals.rs:331-347 | crates/native-sidecar/src/execution/signals.rs:379-395 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/stdio.rs:2723 — crates/native-sidecar/src/stdio.rs:2723-2739 | crates/native-sidecar/src/stdio.rs:2772-2788 — both copies are in the same file, so extract the 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) crates/vfs/src/engine/types.rs:550 — crates/vfs/src/engine/types.rs:550-566 | crates/vfs/src/posix/vfs.rs:188-204 — before extracting anything, compare `crates/vfs/src/engine/types.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 (17 lines × 2) crates/vfs/src/posix/overlay_fs.rs:845 — crates/vfs/src/posix/overlay_fs.rs:845-861 | crates/vfs/src/posix/overlay_fs.rs:1768-1784 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/stdio.rs:2291 — crates/native-sidecar/src/stdio.rs:2291-2308 | crates/native-sidecar/src/stdio.rs:2339-2355 — both copies are in the same file, so extract the 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) crates/runtime/src/lib.rs:1108 — crates/runtime/src/lib.rs:1108-1125 | crates/runtime/src/lib.rs:1145-1161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · agentos_v8_runtime · ×12
  • agentos_v8_runtime::session::session_thread (cyclomatic 98) crates/v8-runtime/src/session.rs:2238 — agentos_v8_runtime::session::session_thread has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_v8_runtime::session::run_event_loop_with_readiness (cyclomatic 43) crates/v8-runtime/src/session.rs:3463 — agentos_v8_runtime::session::run_event_loop_with_readiness has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_v8_runtime::execution::has_probable_esm_syntax (cyclomatic 40) crates/v8-runtime/src/execution.rs:2588 — agentos_v8_runtime::execution::has_probable_esm_syntax 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.
  • agentos_v8_runtime::execution::collect_object_literal_keys (cyclomatic 38) crates/v8-runtime/src/execution.rs:3079 — agentos_v8_runtime::execution::collect_object_literal_keys 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.
  • agentos_v8_runtime::execution::find_code_pattern (cyclomatic 34) crates/v8-runtime/src/execution.rs:2894 — agentos_v8_runtime::execution::find_code_pattern 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.
  • agentos_v8_runtime::execution::execute_script_with_options (cyclomatic 22) crates/v8-runtime/src/execution.rs:546 — agentos_v8_runtime::execution::execute_script_with_options 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.
  • agentos_v8_runtime::execution::execute_module (cyclomatic 20) crates/v8-runtime/src/execution.rs:1301 — agentos_v8_runtime::execution::execute_module 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.
  • agentos_v8_runtime::execution::prefetch_module_imports (cyclomatic 20) crates/v8-runtime/src/execution.rs:1542 — agentos_v8_runtime::execution::prefetch_module_imports 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.
  • agentos_v8_runtime::execution::extract_runtime_cjs_export_names_inner (cyclomatic 20) crates/v8-runtime/src/execution.rs:2464 — agentos_v8_runtime::execution::extract_runtime_cjs_export_names_inner 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.
  • agentos_v8_runtime::ipc_binary::encode_body (cyclomatic 19) crates/v8-runtime/src/ipc_binary.rs:241 — agentos_v8_runtime::ipc_binary::encode_body 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.
  • agentos_v8_runtime::ipc_binary::decode_body (cyclomatic 19) crates/v8-runtime/src/ipc_binary.rs:415 — agentos_v8_runtime::ipc_binary::decode_body 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.
  • agentos_v8_runtime::session::dispatch_ready_batch_callbacks (cyclomatic 16) crates/v8-runtime/src/session.rs:3797 — agentos_v8_runtime::session::dispatch_ready_batch_callbacks 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.
D5 · Coupling · Off the main sequence · ×12
  • Off the main sequence: agentos-diff — agentos-diff: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: agentos-expr — agentos-expr: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: agentos-jq — agentos-jq: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: agentos-runtime — agentos-runtime: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: agentos-tar — agentos-tar: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: agentos-vm-config — agentos-vm-config: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: agentos-yq — agentos-yq: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: wasi-ext — wasi-ext: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
  • Off the main sequence: publish — publish: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: agentos-bridge — agentos-bridge: abstractness 0.15, instability 0.00, distance 0.85 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: agentos-sidecar-protocol — agentos-sidecar-protocol: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: agentos-vfs-core — agentos-vfs-core: abstractness 0.10, instability 0.17, distance 0.73 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
D2 · Cognitive Complexity · agentos_execution · ×11
  • agentos_execution::wasm::handle_internal_wasm_sync_rpc_request (cognitive 143) crates/execution/src/wasm.rs:1468 — agentos_execution::wasm::handle_internal_wasm_sync_rpc_request has cognitive complexity 143 (threshold 15). Drivers by points: if/else 80 (135 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_execution::javascript::spawn_v8_event_bridge (cognitive 112) crates/execution/src/javascript.rs:3921 — agentos_execution::javascript::spawn_v8_event_bridge has cognitive complexity 112 (threshold 15). Drivers by points: if/else 35 (100 pts), boolean chains 6, match/switch 2 (5 pts), loops 1 (nesting depth added 68). 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.
  • agentos_execution::python::python_javascript_sync_rpc_action (cognitive 68) crates/execution/src/python.rs:2248 — agentos_execution::python::python_javascript_sync_rpc_action has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (45 pts), match/switch 11 (22 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.
  • agentos_execution::wasm::translate_wasm_guest_path (cognitive 36) crates/execution/src/wasm.rs:1977 — agentos_execution::wasm::translate_wasm_guest_path has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 2 (4 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • agentos_execution::javascript::sanitize_javascript_code (cognitive 32) crates/execution/src/javascript.rs:3397 — agentos_execution::javascript::sanitize_javascript_code has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_execution::javascript::resolve_exports_target (cognitive 26) crates/execution/src/javascript.rs:7405 — agentos_execution::javascript::resolve_exports_target has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 2, loops 1 (2 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.
  • agentos_execution::wasm::extract_wasm_module_limits (cognitive 23) crates/execution/src/wasm.rs:4486 — agentos_execution::wasm::extract_wasm_module_limits has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_execution::wasm::prewarm_wasm_path (cognitive 22) crates/execution/src/wasm.rs:3634 — agentos_execution::wasm::prewarm_wasm_path has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (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. This shape REPEATS in the file: one other method here (agentos_execution::wasm::prewarm_wasm_path_async) 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.
  • agentos_execution::wasm::prewarm_wasm_path_async (cognitive 22) crates/execution/src/wasm.rs:3777 — agentos_execution::wasm::prewarm_wasm_path_async has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (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. This shape REPEATS in the file: one other method here (agentos_execution::wasm::prewarm_wasm_path) 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.
  • agentos_execution::javascript::resolve_imports_target (cognitive 18) crates/execution/src/javascript.rs:7474 — agentos_execution::javascript::resolve_imports_target has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • agentos_execution::python::python_managed_path_kind (cognitive 16) crates/execution/src/python.rs:2561 — agentos_execution::python::python_managed_path_kind has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×11
  • Duplicated block (18 lines × 2) crates/client/src/software.rs:1466 — crates/client/src/software.rs:1466-1483 | crates/client/src/software.rs:1494-1511 — both copies are in the same file, so extract the 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/execution/src/wasm.rs:643 — crates/execution/src/wasm.rs:643-660 | crates/execution/src/wasm.rs:708-725 — both copies are in the same file, so extract the 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/native-sidecar-core/src/diagnostics.rs:60 — crates/native-sidecar-core/src/diagnostics.rs:60-77 | crates/native-sidecar/src/execution/process.rs:2229-2246 — 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 (18 lines × 2) crates/native-sidecar/src/execution/child_process.rs:3336 — crates/native-sidecar/src/execution/child_process.rs:3336-3353 | crates/native-sidecar/src/execution/process_events.rs:1229-1246 — 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 (18 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:3130 — crates/native-sidecar/src/execution/javascript/rpc.rs:3130-3147 | crates/native-sidecar/src/execution/javascript/rpc.rs:3863-3880 — both copies are in the same file, so extract the 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/native-sidecar/src/execution/network/tcp.rs:2600 — crates/native-sidecar/src/execution/network/tcp.rs:2600-2617 | crates/native-sidecar/src/execution/network/unix.rs:1741-1758 — before extracting anything, compare `crates/native-sidecar/src/execution/network/tcp.rs` and `crates/native-sidecar/src/execution/network/unix.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 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 (18 lines × 2) crates/native-sidecar/src/execution/process_events.rs:1104 — crates/native-sidecar/src/execution/process_events.rs:1104-1121 | crates/native-sidecar/src/execution/process_events.rs:1651-1668 — both copies are in the same file, so extract the 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/sidecar-protocol/src/protocol.rs:2329 — crates/sidecar-protocol/src/protocol.rs:2329-2346 | crates/sidecar-protocol/src/wire.rs:867-884 — before extracting anything, compare `crates/sidecar-protocol/src/protocol.rs` and `crates/sidecar-protocol/src/wire.rs` as WHOLE FILES: this scan already matched 3 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.
  • Duplicated block (18 lines × 2) crates/v8-runtime/src/session.rs:3929 — crates/v8-runtime/src/session.rs:3929-3946 | crates/v8-runtime/src/session.rs:3953-3970 — both copies are in the same file, so extract the 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/vfs/src/posix/overlay_fs.rs:627 — crates/vfs/src/posix/overlay_fs.rs:627-644 | crates/vfs/src/posix/overlay_fs.rs:1683-1700 — both copies are in the same file, so extract the 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/native-sidecar/src/extension_services.rs:599 — crates/native-sidecar/src/extension_services.rs:599-616 | crates/native-sidecar/src/extension_services.rs:666-683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · agentos_execution · ×9
  • agentos_execution::wasm::handle_internal_wasm_sync_rpc_request (cyclomatic 82) crates/execution/src/wasm.rs:1468 — agentos_execution::wasm::handle_internal_wasm_sync_rpc_request has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_execution::python::python_javascript_sync_rpc_action (cyclomatic 46) crates/execution/src/python.rs:2248 — agentos_execution::python::python_javascript_sync_rpc_action has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_execution::javascript::spawn_v8_event_bridge (cyclomatic 43) crates/execution/src/javascript.rs:3921 — agentos_execution::javascript::spawn_v8_event_bridge has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • agentos_execution::v8_ipc::decode_frame (cyclomatic 18) crates/execution/src/v8_ipc.rs:140 — agentos_execution::v8_ipc::decode_frame 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.
  • agentos_execution::v8_ipc::encode_body (cyclomatic 18) crates/execution/src/v8_ipc.rs:306 — agentos_execution::v8_ipc::encode_body 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.
  • agentos_execution::wasm::translate_wasm_guest_path (cyclomatic 17) crates/execution/src/wasm.rs:1977 — agentos_execution::wasm::translate_wasm_guest_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. This is NOT this file's highest cyclomatic complexity: WasmExecutionError::fmt (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • agentos_execution::javascript::sanitize_javascript_code (cyclomatic 16) crates/execution/src/javascript.rs:3397 — agentos_execution::javascript::sanitize_javascript_code 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: agentos_execution::javascript::builtin_named_exports (cyclomatic 41) 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.
  • agentos_execution::wasm::prewarm_wasm_path (cyclomatic 16) crates/execution/src/wasm.rs:3634 — agentos_execution::wasm::prewarm_wasm_path 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 shape REPEATS in the file: one other method here (agentos_execution::wasm::prewarm_wasm_path_async) 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. This is NOT this file's highest cyclomatic complexity: WasmExecutionError::fmt (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • agentos_execution::wasm::prewarm_wasm_path_async (cyclomatic 16) crates/execution/src/wasm.rs:3777 — agentos_execution::wasm::prewarm_wasm_path_async 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 shape REPEATS in the file: one other method here (agentos_execution::wasm::prewarm_wasm_path) 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. This is NOT this file's highest cyclomatic complexity: WasmExecutionError::fmt (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · AgentOs · ×9
  • AgentOs::exec_argv_process (cognitive 64) crates/client/src/process.rs:555 — AgentOs::exec_argv_process has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 10 (26 pts), boolean chains 3, loops 1 (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.
  • AgentOs::read_process_output (cognitive 32) crates/client/src/process.rs:1027 — AgentOs::read_process_output has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 6 (11 pts), loops 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.
  • AgentOs::create_vm (cognitive 31) crates/client/src/agent_os.rs:282 — AgentOs::create_vm has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 5 (7 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentOs::open_shell (cognitive 27) crates/client/src/shell.rs:380 — AgentOs::open_shell has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 5 (9 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.
  • AgentOs::connect_terminal (cognitive 24) crates/client/src/shell.rs:638 — AgentOs::connect_terminal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 4 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentOs::process_tree_records (cognitive 20) crates/client/src/process.rs:1261 — AgentOs::process_tree_records has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 3 (4 pts), loops 2 (nesting depth added 8). 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.
  • AgentOs::shutdown (cognitive 17) crates/client/src/agent_os.rs:993 — AgentOs::shutdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 3 (5 pts), boolean chains 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.
  • AgentOs::posix_normalize (cognitive 17) crates/client/src/fs.rs:326 — AgentOs::posix_normalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentOs::run_spawn (cognitive 17) crates/client/src/process.rs:1836 — AgentOs::run_spawn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 4 (7 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 · OverlayFileSystem · ×9
  • OverlayFileSystem::read_dir_with_types_inner (cognitive 46) crates/vfs/src/posix/overlay_fs.rs:1103 — OverlayFileSystem::read_dir_with_types_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 3 (9 pts), boolean chains 3 (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.
  • OverlayFileSystem::read_dir (cognitive 41) crates/vfs/src/posix/overlay_fs.rs:1323 — OverlayFileSystem::read_dir has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 3 (9 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.
  • OverlayFileSystem::read_dir_limited (cognitive 40) crates/vfs/src/posix/overlay_fs.rs:1387 — OverlayFileSystem::read_dir_limited has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (7 pts), boolean chains 6, match/switch 2 (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.
  • OverlayFileSystem::resolve_merged_path (cognitive 35) crates/vfs/src/posix/overlay_fs.rs:135 — OverlayFileSystem::resolve_merged_path has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • OverlayFileSystem::memory_subtree_released_usage (cognitive 27) crates/vfs/src/posix/overlay_fs.rs:478 — OverlayFileSystem::memory_subtree_released_usage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (4 pts), boolean chains 3 (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.
  • OverlayFileSystem::memory_subtree_usage_limited (cognitive 26) crates/vfs/src/posix/overlay_fs.rs:436 — OverlayFileSystem::memory_subtree_usage_limited has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OverlayFileSystem::collect_destination_parent_copy_up_paths (cognitive 20) crates/vfs/src/posix/overlay_fs.rs:213 — OverlayFileSystem::collect_destination_parent_copy_up_paths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OverlayFileSystem::rename (cognitive 19) crates/vfs/src/posix/overlay_fs.rs:1665 — OverlayFileSystem::rename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OverlayFileSystem::collect_copy_up_usage_limited (cognitive 16) crates/vfs/src/posix/overlay_fs.rs:539 — OverlayFileSystem::collect_copy_up_usage_limited has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D10 · Test Quality · No assertions · ×8
  • No assertions: passes on the current tree scripts/verify-fixed-versions.test.mjs:25 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ignores generated package caches scripts/verify-fixed-versions.test.mjs:29 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: fails when a product package drifts off 0.0.1 scripts/verify-fixed-versions.test.mjs:62 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: fails when Cargo.toml [workspace.package] drifts off 0.0.1 scripts/verify-fixed-versions.test.mjs:80 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: fails when an internal crate dep requirement drifts off 0.0.1 scripts/verify-fixed-versions.test.mjs:93 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: multiple ^C in a row does not crash the shell packages/runtime-core/tests/integration/ctrl-c-shell-behavior.nightly.test.ts:78 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: disposing immediately after kill handles the pending signal request packages/runtime-core/tests/integration/signal-forwarding.nightly.test.ts:87 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: delivers SIGSTOP and SIGCONT through killProcess packages/core/tests/native-sidecar-process.nightly.test.ts:1612 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D15 · Churn × Complexity Hotspots · Repeated repair · ×8
  • Repeated repair: crates/native-sidecar/src/state.rs crates/native-sidecar/src/state.rs:123 — crates/native-sidecar/src/state.rs changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ProcessOutputReplay::read at line 123), 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(native-sidecar): keep guest writes to API-seeded files (#2070)”; “fix(native-sidecar): make interactive terminals work as on Linux (#2053)”; “fix(runtime): give process stdin Linux semantics (#2046)”; “fix(agentos): report V8 limit terminations as typed execution errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/state.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/native-sidecar/src/execution/mod.rs crates/native-sidecar/src/execution/mod.rs:301 — crates/native-sidecar/src/execution/mod.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is agentos_native_sidecar::execution::reactor_io_limits at line 301), 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(native-sidecar): keep guest writes to API-seeded files (#2070)”; “fix(native-sidecar): make interactive terminals work as on Linux (#2053)”; “fix(agentos): run host function calls as async tasks”; “fix: restore clippy and rustfmt on main, restructure secure-exec docs”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/mod.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/native-sidecar/src/execution/coordinator.rs crates/native-sidecar/src/execution/coordinator.rs:847 — crates/native-sidecar/src/execution/coordinator.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is NativeSidecar::vm_fetch_legacy at line 847), 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(native-sidecar): make interactive terminals work as on Linux (#2053)”; “fix(runtime): give process stdin Linux semantics (#2046)”; “fix(native-sidecar): unblock Rust 1.98 clippy”; “chore(clippy): apply machine-applicable Rust 1.98 lint fixes”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar/src/execution/coordinator.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/native-sidecar-core/src/permissions.rs crates/native-sidecar-core/src/permissions.rs:485 — crates/native-sidecar-core/src/permissions.rs 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 12 (its worst body is agentos_native_sidecar_core::permissions::fs_permission_capability at line 485), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(permissions): keep VM-local networking under scalar network deny”; “fix: restore clippy and rustfmt on main, restructure secure-exec docs”; “fix: deny default provider egress”; “fix: allow VM-local networking by default”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/native-sidecar-core/src/permissions.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/v8-runtime/src/embedded_runtime.rs crates/v8-runtime/src/embedded_runtime.rs:838 — crates/v8-runtime/src/embedded_runtime.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is agentos_v8_runtime::embedded_runtime::dispatch_runtime_command at line 838), 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(v8-runtime): stop guest js whose wasm memory passes the heap limit (#2080)”; “fix(runtime): complete a context call when its result settles”; “fix(agentos): report V8 limit terminations as typed execution errors”; “fix(runtime): decouple VM admission from CPU count”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/v8-runtime/src/embedded_runtime.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: packages/runtime-core/src/sidecar-process.ts packages/runtime-core/src/sidecar-process.ts:1382 — packages/runtime-core/src/sidecar-process.ts 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 8 (its worst body is SidecarProcess.execute at line 1382), 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(runtime-core): reject oversized frames before they reach the sidecar”; “fix(client): recover when a shared sidecar exits (#2044)”; “fix(agentos): reject pending executions when the sidecar exits”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- packages/runtime-core/src/sidecar-process.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/v8-runtime/src/isolate.rs crates/v8-runtime/src/isolate.rs:345 — crates/v8-runtime/src/isolate.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is agentos_v8_runtime::isolate::budget_reallocate at line 345), 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(v8-runtime): stop guest js whose wasm memory passes the heap limit (#2080)”; “fix(v8-runtime): cap each isolate's ArrayBuffer memory”; “fix(agentos): raise the heap limit past one oversized allocation”. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/v8-runtime/src/isolate.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/v8-runtime/src/runtime_protocol.rs crates/v8-runtime/src/runtime_protocol.rs:182 — crates/v8-runtime/src/runtime_protocol.rs changed 3 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 RuntimeCommand::try_from at line 182), 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(v8-runtime): stop guest js whose wasm memory passes the heap limit (#2080)”; “fix(runtime): complete a context call when its result settles”; “fix(agentos): report V8 limit terminations as typed execution errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 03:56:04 +05:30' --until='2026-10-28 03:56:04 +05:30' --full-history --no-merges -- crates/v8-runtime/src/runtime_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.
D2 · Cognitive Complexity · agentos_client · ×8
  • agentos_client::process::next_spawn_event (cognitive 34) crates/client/src/process.rs:116 — agentos_client::process::next_spawn_event has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_client::cron::looks_like_one_shot (cognitive 30) crates/client/src/cron.rs:389 — agentos_client::cron::looks_like_one_shot has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 4 (5 pts), loops 2 (4 pts) (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.
  • agentos_client::language_execution::background_submission (cognitive 26) crates/client/src/language_execution.rs:1335 — agentos_client::language_execution::background_submission has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 4 (11 pts), loops 1 (2 pts) (nesting depth added 17). 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.
  • agentos_client::software::recover_package_cache (cognitive 22) crates/client/src/software.rs:405 — agentos_client::software::recover_package_cache has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (4 pts), boolean chains 3, 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.
  • agentos_client::agent_os::parse_host_function_argv (cognitive 19) crates/client/src/agent_os.rs:2122 — agentos_client::agent_os::parse_host_function_argv has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 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.
  • agentos_client::process::confirm_exec_exit (cognitive 19) crates/client/src/process.rs:2011 — agentos_client::process::confirm_exec_exit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 3 (8 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.
  • agentos_client::agent_os::validate_number_host_function_input (cognitive 18) crates/client/src/agent_os.rs:2436 — agentos_client::agent_os::validate_number_host_function_input has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_client::agent_os::validate_host_function_input_at_path (cognitive 16) crates/client/src/agent_os.rs:2286 — agentos_client::agent_os::validate_host_function_input_at_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · KernelVm · ×8
  • KernelVm::fd_open (cognitive 32) crates/kernel/src/kernel.rs:4819 — KernelVm::fd_open has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 3, 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.
  • KernelVm::fd_read_with_timeout_result (cognitive 32) crates/kernel/src/kernel.rs:5053 — KernelVm::fd_read_with_timeout_result has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (25 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KernelVm::fd_socket_recvmsg (cognitive 31) crates/kernel/src/kernel.rs:3908 — KernelVm::fd_socket_recvmsg has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 7, loops 3, match/switch 2 (3 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.
  • KernelVm::fd_socketpair (cognitive 24) crates/kernel/src/kernel.rs:3552 — KernelVm::fd_socketpair has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (3 pts), 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.
  • KernelVm::fd_write_with_mode (cognitive 24) crates/kernel/src/kernel.rs:5192 — KernelVm::fd_write_with_mode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KernelVm::validate_fd_open_flags (cognitive 21) crates/kernel/src/kernel.rs:6479 — KernelVm::validate_fd_open_flags has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, 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, 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.
  • KernelVm::register_process (cognitive 18) crates/kernel/src/kernel.rs:3360 — KernelVm::register_process 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.
  • KernelVm::find_surviving_hard_link (cognitive 17) crates/kernel/src/kernel.rs:6927 — KernelVm::find_surviving_hard_link has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) crates/kernel/src/kernel.rs:2712 — crates/kernel/src/kernel.rs:2712-2718 | crates/kernel/src/kernel.rs:2751-2757 | crates/kernel/src/kernel.rs:2787-2793 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) toolchain/crates/libs/shims/src/grep_alias.rs:25 — toolchain/crates/libs/shims/src/grep_alias.rs:25-31 | toolchain/crates/libs/shims/src/nohup.rs:27-33 | toolchain/crates/libs/shims/src/stdbuf.rs:50-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) crates/native-sidecar/src/filesystem.rs:3650 — crates/native-sidecar/src/filesystem.rs:3650-3656 | crates/vfs/src/posix/mount_table.rs:2691-2697 | crates/vfs/src/posix/tar_fs.rs:767-773 — 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/kernel/src/pipe_manager.rs:781 — crates/kernel/src/pipe_manager.rs:781-787 | crates/kernel/src/pty.rs:1002-1008 | crates/kernel/src/pty.rs:1010-1016 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 (7 lines × 3) crates/execution/src/wasm.rs:1528 — crates/execution/src/wasm.rs:1528-1534 | crates/execution/src/wasm.rs:1858-1864 | crates/execution/src/wasm.rs:1879-1885 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/client/src/shell.rs:787 — crates/client/src/shell.rs:787-793 | crates/client/src/shell.rs:1107-1113 | crates/client/src/shell.rs:1184-1190 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/v8-runtime/src/execution.rs:804 — crates/v8-runtime/src/execution.rs:804-810 | crates/v8-runtime/src/execution.rs:813-819 | crates/v8-runtime/src/execution.rs:822-828 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/execution/src/wasm.rs:1774 — crates/execution/src/wasm.rs:1774-1780 | crates/execution/src/wasm.rs:1812-1818 | crates/execution/src/wasm.rs:1852-1858 — 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.
S1 · Web-Security Posture · Weak hash algorithm · ×8
  • Weak hash algorithm crates/native-sidecar/src/execution/javascript/crypto.rs:268 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm crates/native-sidecar/src/execution/javascript/crypto.rs:269 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm crates/native-sidecar/src/execution/javascript/crypto.rs:279 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm crates/native-sidecar/src/execution/javascript/crypto.rs:280 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm crates/native-sidecar/src/execution/javascript/crypto.rs:1724 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm crates/native-sidecar/src/execution/javascript/crypto.rs:1725 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm toolchain/stubs/uucore/src/lib/features/checksum/mod.rs:352 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm toolchain/stubs/uucore/src/lib/features/checksum/mod.rs:354 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
D2 · Cognitive Complexity · agentos_kernel · ×7
  • agentos_kernel::pty::process_input (cognitive 109) crates/kernel/src/pty.rs:1103 — agentos_kernel::pty::process_input has cognitive complexity 109 (threshold 15). Drivers by points: if/else 29 (94 pts), loops 3 (9 pts), boolean chains 6 (nesting depth added 71). 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.
  • agentos_kernel::kernel::resolve_unix_socket_components (cognitive 35) crates/kernel/src/kernel.rs:8933 — agentos_kernel::kernel::resolve_unix_socket_components has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6, 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.
  • agentos_kernel::permissions::permission_glob_matches::matches (cognitive 26) crates/kernel/src/permissions.rs:197 — agentos_kernel::permissions::permission_glob_matches::matches has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (7 pts), boolean chains 5, 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.
  • agentos_kernel::pty::deliver_output (cognitive 21) crates/kernel/src/pty.rs:1292 — agentos_kernel::pty::deliver_output has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (21 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.
  • agentos_kernel::socket_table::remove_socket (cognitive 21) crates/kernel/src/socket_table.rs:3019 — agentos_kernel::socket_table::remove_socket has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 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.
  • agentos_kernel::process_table::mark_exited_inner (cognitive 20) crates/kernel/src/process_table.rs:992 — agentos_kernel::process_table::mark_exited_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 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.
  • agentos_kernel::socket_table::unregister_bound_socket (cognitive 18) crates/kernel/src/socket_table.rs:3056 — agentos_kernel::socket_table::unregister_bound_socket has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1 (nesting depth added 9). 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) crates/execution/src/javascript.rs:124 — crates/execution/src/javascript.rs:124-131 | crates/native-sidecar/src/execution/process_events.rs:415-422 | crates/v8-runtime/src/session.rs:573-580 — before extracting anything, compare `crates/execution/src/javascript.rs` and `crates/native-sidecar/src/execution/process_events.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. 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 (8 lines × 3) crates/kernel/src/kernel.rs:2599 — crates/kernel/src/kernel.rs:2599-2606 | crates/kernel/src/kernel.rs:5202-5209 | crates/kernel/src/kernel.rs:6371-6378 — 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/native-sidecar/src/execution/child_process.rs:3337 — crates/native-sidecar/src/execution/child_process.rs:3337-3344 | crates/native-sidecar/src/execution/process_events.rs:770-777 | crates/native-sidecar/src/execution/process_events.rs:1230-1237 — 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) crates/native-sidecar/src/execution/network/tcp.rs:742 — crates/native-sidecar/src/execution/network/tcp.rs:742-749 | crates/native-sidecar/src/execution/network/tcp.rs:761-768 | crates/native-sidecar/src/execution/network/tcp.rs:1281-1288 — 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/v8-runtime/src/bridge.rs:1818 — crates/v8-runtime/src/bridge.rs:1818-1826 | crates/v8-runtime/src/bridge.rs:2004-2012 | crates/v8-runtime/src/execution.rs:230-237 — 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) crates/v8-runtime/src/execution.rs:1953 — crates/v8-runtime/src/execution.rs:1953-1960 | crates/v8-runtime/src/execution.rs:1968-1976 | crates/v8-runtime/src/execution.rs:1993-2001 — 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/vfs/src/posix/overlay_fs.rs:1507 — crates/vfs/src/posix/overlay_fs.rs:1507-1514 | crates/vfs/src/posix/overlay_fs.rs:1533-1540 | crates/vfs/src/posix/overlay_fs.rs:1561-1568 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×7
  • Outbound HTTP without resilience crates/native-sidecar/src/plugins/google_drive.rs:375 — `ureq::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/native-sidecar/src/plugins/google_drive.rs:411 — `ureq::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/native-sidecar/src/plugins/google_drive.rs:435 — `ureq::post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/native-sidecar/src/plugins/google_drive.rs:469 — `ureq::request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/native-sidecar/src/plugins/google_drive.rs:492 — `ureq::delete(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/native-sidecar/src/plugins/google_drive.rs:574 — `ureq::post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience packages/runtime-benchmarks/src/families/net.ts:92 — `http.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D1 · Cyclomatic Complexity · KernelVm · ×6
  • KernelVm::fd_socket_recvmsg (cyclomatic 23) crates/kernel/src/kernel.rs:3908 — KernelVm::fd_socket_recvmsg 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.
  • KernelVm::fd_open (cyclomatic 21) crates/kernel/src/kernel.rs:4819 — KernelVm::fd_open 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.
  • KernelVm::validate_fd_open_flags (cyclomatic 19) crates/kernel/src/kernel.rs:6479 — KernelVm::validate_fd_open_flags 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: KernelVm::resolve_proc_node (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • KernelVm::fd_read_with_timeout_result (cyclomatic 18) crates/kernel/src/kernel.rs:5053 — KernelVm::fd_read_with_timeout_result 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: KernelVm::resolve_proc_node (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • KernelVm::fd_socketpair (cyclomatic 16) crates/kernel/src/kernel.rs:3552 — KernelVm::fd_socketpair 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: KernelVm::resolve_proc_node (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • KernelVm::fd_write_with_mode (cyclomatic 16) crates/kernel/src/kernel.rs:5192 — KernelVm::fd_write_with_mode 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: KernelVm::resolve_proc_node (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/execution/src/javascript.rs:122 — crates/execution/src/javascript.rs:122-151 | crates/native-sidecar/src/execution/process_events.rs:410-442 | crates/native-sidecar/src/filesystem.rs:1449-1477 | crates/v8-runtime/src/session.rs:568-600 — 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/native-sidecar/src/filesystem.rs:3637 — crates/native-sidecar/src/filesystem.rs:3637-3648 | crates/native-sidecar/src/service.rs:5993-6004 | crates/vfs/src/posix/mount_table.rs:2678-2689 | crates/vfs/src/posix/tar_fs.rs:754-765 — 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/runtime/src/lib.rs:1428 — crates/runtime/src/lib.rs:1428-1443 | crates/runtime/src/lib.rs:1454-1473 | crates/runtime/src/lib.rs:1489-1503 | crates/runtime/src/lib.rs:1517-1535 — 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/vfs/src/posix/mount_table.rs:233 — crates/vfs/src/posix/mount_table.rs:233-257 | crates/vfs/src/posix/mount_table.rs:258-271 | crates/vfs/src/posix/vfs.rs:620-644 | crates/vfs/src/posix/vfs.rs:647-660 — 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/vfs/src/posix/overlay_fs.rs:140 — crates/vfs/src/posix/overlay_fs.rs:140-203 | crates/vfs/src/posix/overlay_fs.rs:219-275 | crates/vfs/src/posix/vfs.rs:950-1012 | crates/vfs/src/posix/vfs.rs:1481-1526 — 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/vfs/src/posix/overlay_fs.rs:819 — crates/vfs/src/posix/overlay_fs.rs:819-836 | crates/vfs/src/posix/overlay_fs.rs:843-861 | crates/vfs/src/posix/overlay_fs.rs:1766-1784 | crates/vfs/src/posix/overlay_fs.rs:1786-1803 — 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 (11 lines × 3) · ×6
  • Duplicated block (11 lines × 3) crates/execution/src/wasm.rs:627 — crates/execution/src/wasm.rs:627-637 | crates/execution/src/wasm.rs:663-673 | crates/execution/src/wasm.rs:693-703 — 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 (11 lines × 3) crates/kernel/src/kernel.rs:4481 — crates/kernel/src/kernel.rs:4481-4491 | crates/kernel/src/kernel.rs:4519-4529 | crates/kernel/src/kernel.rs:4590-4600 — 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 (11 lines × 3) crates/native-sidecar/src/plugins/chunked_local.rs:84 — crates/native-sidecar/src/plugins/chunked_local.rs:84-94 | crates/native-sidecar/src/plugins/chunked_sqlite.rs:333-343 | crates/native-sidecar/src/plugins/object_s3.rs:69-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (11 lines × 3) crates/vfs/src/posix/overlay_fs.rs:1304 — crates/vfs/src/posix/overlay_fs.rs:1304-1314 | crates/vfs/src/posix/overlay_fs.rs:1580-1590 | crates/vfs/src/posix/overlay_fs.rs:2109-2119 — 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 (11 lines × 3) crates/native-sidecar/src/execution/javascript/rpc.rs:3707 — crates/native-sidecar/src/execution/javascript/rpc.rs:3707-3717 | crates/native-sidecar/src/execution/javascript/rpc.rs:4379-4390 | crates/native-sidecar/src/execution/javascript/rpc.rs:4572-4583 — 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 (11 lines × 3) crates/native-sidecar/src/execution/child_process.rs:1478 — crates/native-sidecar/src/execution/child_process.rs:1478-1488 | crates/native-sidecar/src/execution/child_process.rs:1512-1522 | crates/native-sidecar/src/execution/child_process.rs:1550-1560 — 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.
D1 · Cyclomatic Complexity · AgentOs · ×5
  • AgentOs::exec_argv_process (cyclomatic 32) crates/client/src/process.rs:555 — AgentOs::exec_argv_process 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.
  • AgentOs::create_vm (cyclomatic 23) crates/client/src/agent_os.rs:282 — AgentOs::create_vm 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.
  • AgentOs::read_process_output (cyclomatic 20) crates/client/src/process.rs:1027 — AgentOs::read_process_output 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.
  • AgentOs::open_shell (cyclomatic 18) crates/client/src/shell.rs:380 — AgentOs::open_shell 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.
  • AgentOs::connect_terminal (cyclomatic 17) crates/client/src/shell.rs:638 — AgentOs::connect_terminal 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 · agentos_shims · ×5
  • agentos_shims::xargs::xargs (cognitive 63) toolchain/crates/libs/shims/src/xargs.rs:25 — agentos_shims::xargs::xargs has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (40 pts), match/switch 5 (16 pts), loops 3 (4 pts), boolean chains 3 (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.
  • agentos_shims::xargs::parse_quoted_args (cognitive 22) toolchain/crates/libs/shims/src/xargs.rs:311 — agentos_shims::xargs::parse_quoted_args has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 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.
  • agentos_shims::env::env (cognitive 19) toolchain/crates/libs/shims/src/env.rs:16 — agentos_shims::env::env has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3, boolean chains 2, 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.
  • agentos_shims::timeout::timeout (cognitive 17) toolchain/crates/libs/shims/src/timeout.rs:26 — agentos_shims::timeout::timeout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 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.
  • agentos_shims::which::which (cognitive 17) toolchain/crates/libs/shims/src/which.rs:103 — agentos_shims::which::which has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 4, loops 2 (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.
D2 · Cognitive Complexity · PipeManager · ×5
  • PipeManager::read_with_timeout (cognitive 52) crates/kernel/src/pipe_manager.rs:521 — PipeManager::read_with_timeout has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (50 pts), boolean chains 1, loops 1 (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.
  • PipeManager::close (cognitive 26) crates/kernel/src/pipe_manager.rs:640 — PipeManager::close has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, match/switch 1 (2 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.
  • PipeManager::write_with_mode (cognitive 23) crates/kernel/src/pipe_manager.rs:425 — PipeManager::write_with_mode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), 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.
  • PipeManager::poll (cognitive 18) crates/kernel/src/pipe_manager.rs:371 — PipeManager::poll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • PipeManager::open_named_pipe (cognitive 16) crates/kernel/src/pipe_manager.rs:263 — PipeManager::open_named_pipe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4, boolean chains 3 (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 · Duplicated block (24 lines × 2) · ×5
  • Duplicated block (24 lines × 2) crates/execution/src/wasm.rs:1203 — crates/execution/src/wasm.rs:1203-1226 | crates/execution/src/wasm.rs:1279-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 (24 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:574 — crates/native-sidecar/src/execution/network/http2.rs:574-597 | crates/native-sidecar/src/execution/network/http2.rs:767-790 — both copies are in the same file, so extract the 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 (24 lines × 2) crates/native-sidecar/src/service.rs:1688 — crates/native-sidecar/src/service.rs:1688-1711 | crates/native-sidecar/src/service.rs:1724-1747 — both copies are in the same file, so extract the 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 (24 lines × 2) crates/vfs/src/posix/mount_table.rs:234 — crates/vfs/src/posix/mount_table.rs:234-257 | crates/vfs/src/posix/vfs.rs:621-644 — before extracting anything, compare `crates/vfs/src/posix/mount_table.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 (24 lines × 2) crates/vfs/src/posix/mount_table.rs:1840 — crates/vfs/src/posix/mount_table.rs:1840-1863 | crates/vfs/src/posix/usage.rs:39-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×5
  • Duplicated block (8–9 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4881 — crates/native-sidecar/src/execution/child_process.rs:4881-4889 | crates/native-sidecar/src/execution/child_process.rs:5564-5571 — both copies are in the same file, so extract the 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–9 lines × 2) crates/native-sidecar/src/execution/child_process.rs:9495 — crates/native-sidecar/src/execution/child_process.rs:9495-9503 | crates/native-sidecar/src/service.rs:4712-4719 — 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–9 lines × 2) crates/native-sidecar/src/execution/javascript/sqlite.rs:812 — crates/native-sidecar/src/execution/javascript/sqlite.rs:812-820 | crates/native-sidecar/src/execution/javascript/sqlite.rs:836-843 — both copies are in the same file, so extract the 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–9 lines × 2) crates/native-sidecar/src/plugins/agentos_packages.rs:82 — crates/native-sidecar/src/plugins/agentos_packages.rs:82-89 | crates/native-sidecar/src/plugins/agentos_packages.rs:97-105 — both copies are in the same file, so extract the 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–9 lines × 2) crates/vfs/src/engine/mem/metadata_store.rs:388 — crates/vfs/src/engine/mem/metadata_store.rs:388-395 | crates/vfs/src/engine/mem/metadata_store.rs:406-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) crates/kernel/src/kernel.rs:5453 — crates/kernel/src/kernel.rs:5453-5458 | crates/kernel/src/kernel.rs:5513-5518 | crates/kernel/src/kernel.rs:5562-5567 — 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/native-sidecar/src/execution/child_process.rs:4880 — crates/native-sidecar/src/execution/child_process.rs:4880-4885 | crates/native-sidecar/src/execution/child_process.rs:5563-5568 | crates/native-sidecar/src/execution/launch.rs:5188-5193 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 × 3) software/tar/native/crates/tar/src/lib.rs:808 — software/tar/native/crates/tar/src/lib.rs:808-813 | software/tar/native/crates/tar/src/lib.rs:823-828 | software/tar/native/crates/tar/src/lib.rs:865-871 — 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/v8-runtime/src/execution.rs:2472 — crates/v8-runtime/src/execution.rs:2472-2477 | crates/v8-runtime/src/execution.rs:2502-2507 | crates/v8-runtime/src/execution.rs:2514-2519 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/execution/src/wasm.rs:1740 — crates/execution/src/wasm.rs:1740-1745 | crates/execution/src/wasm.rs:1780-1785 | crates/execution/src/wasm.rs:1818-1823 — 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 (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) crates/native-sidecar/src/execution/child_process.rs:5363 — crates/native-sidecar/src/execution/child_process.rs:5363-5367 | crates/native-sidecar/src/execution/child_process.rs:5894-5898 | crates/native-sidecar/src/execution/child_process.rs:7979-7984 — 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/native-sidecar/src/execution/launch.rs:4915 — crates/native-sidecar/src/execution/launch.rs:4915-4919 | crates/native-sidecar/src/language_execution.rs:853-857 | crates/native-sidecar/src/language_execution.rs:1854-1858 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) crates/native-sidecar/src/filesystem.rs:2226 — crates/native-sidecar/src/filesystem.rs:2226-2230 | crates/native-sidecar/src/filesystem.rs:2252-2256 | crates/native-sidecar/src/filesystem.rs:2483-2487 — 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/native-sidecar/src/execution/javascript/sqlite.rs:307 — crates/native-sidecar/src/execution/javascript/sqlite.rs:307-311 | crates/native-sidecar/src/execution/javascript/sqlite.rs:341-345 | crates/native-sidecar/src/execution/javascript/sqlite.rs:367-371 — 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/v8-runtime/src/bridge.rs:1892 — crates/v8-runtime/src/bridge.rs:1892-1896 | crates/v8-runtime/src/bridge.rs:1988-1992 | crates/v8-runtime/src/bridge.rs:2180-2184 — 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.
D2 · Cognitive Complexity · agentos_native_sidecar_core · ×4
  • agentos_native_sidecar_core::limits::validate_vm_limits (cognitive 31) crates/native-sidecar-core/src/limits.rs:1134 — agentos_native_sidecar_core::limits::validate_vm_limits has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (24 pts), loops 7 (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.
  • agentos_native_sidecar_core::limits::vm_limits_from_config (cognitive 28) crates/native-sidecar-core/src/limits.rs:492 — agentos_native_sidecar_core::limits::vm_limits_from_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23 (28 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.
  • agentos_native_sidecar_core::vm_fetch::decode_kernel_http_chunked_body (cognitive 27) crates/native-sidecar-core/src/vm_fetch.rs:247 — agentos_native_sidecar_core::vm_fetch::decode_kernel_http_chunked_body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_native_sidecar_core::vm_fetch::parse_kernel_http_fetch_response (cognitive 23) crates/native-sidecar-core/src/vm_fetch.rs:9 — agentos_native_sidecar_core::vm_fetch::parse_kernel_http_fetch_response has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasmExecution · ×4
  • WasmExecution::wait_event_blocking (cognitive 24) crates/execution/src/wasm.rs:765 — WasmExecution::wait_event_blocking has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (23 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.
  • WasmExecution::poll_event (cognitive 20) crates/execution/src/wasm.rs:623 — WasmExecution::poll_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (WasmExecution::poll_event_blocking) 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.
  • WasmExecution::poll_event_blocking (cognitive 20) crates/execution/src/wasm.rs:689 — WasmExecution::poll_event_blocking has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (WasmExecution::poll_event) 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.
  • WasmExecution::try_poll_event (cognitive 17) crates/execution/src/wasm.rs:662 — WasmExecution::try_poll_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFields · ×4
  • TooManyFields: ActiveProcess crates/native-sidecar/src/state.rs:2039 — TooManyFields — 78 stored fields beside 49 methods. The bar is 30 stored fields; this is 48 over it, 2.60× 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: VmState crates/native-sidecar/src/state.rs:1192 — TooManyFields — 58 stored fields beside 3 methods. The bar is 30 stored fields; this is 28 over it, 1.93× 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: NativeSidecar crates/native-sidecar/src/service.rs:1369 — TooManyFields — 40 stored fields beside 248 methods. 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: ActiveTcpSocket crates/native-sidecar/src/state.rs:2936 — TooManyFields — 37 stored fields beside 27 methods. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×4
  • Duplicated block (21–22 lines × 2) crates/native-sidecar/src/execution/child_process.rs:5208 — crates/native-sidecar/src/execution/child_process.rs:5208-5228 | crates/native-sidecar/src/execution/child_process.rs:8007-8028 — both copies are in the same file, so extract the 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–22 lines × 2) crates/native-sidecar/src/execution/javascript/http.rs:773 — crates/native-sidecar/src/execution/javascript/http.rs:773-793 | crates/native-sidecar/src/execution/javascript/http.rs:2533-2554 — both copies are in the same file, so extract the 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–22 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:4453 — crates/native-sidecar/src/execution/javascript/rpc.rs:4453-4474 | crates/native-sidecar/src/execution/javascript/rpc.rs:4647-4667 — both copies are in the same file, so extract the 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–22 lines × 2) crates/native-sidecar/src/request_operations.rs:614 — crates/native-sidecar/src/request_operations.rs:614-635 | crates/native-sidecar/src/request_operations.rs:1224-1244 — both copies are in the same file, so extract the 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–12 lines × 2) · ×4
  • Duplicated block (11–12 lines × 2) crates/kernel/src/kernel.rs:5876 — crates/kernel/src/kernel.rs:5876-5887 | crates/kernel/src/kernel.rs:5969-5979 — both copies are in the same file, so extract the 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–12 lines × 2) crates/native-sidecar/src/execution/child_process.rs:9357 — crates/native-sidecar/src/execution/child_process.rs:9357-9368 | crates/native-sidecar/src/execution/child_process.rs:9462-9472 — both copies are in the same file, so extract the 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–12 lines × 2) crates/vfs/src/posix/vfs.rs:962 — crates/vfs/src/posix/vfs.rs:962-972 | crates/vfs/src/posix/vfs.rs:1492-1503 — both copies are in the same file, so extract the 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–12 lines × 2) toolchain/crates/libs/wasi-pty/src/lib.rs:355 — toolchain/crates/libs/wasi-pty/src/lib.rs:355-365 | toolchain/crates/libs/wasi-spawn/src/lib.rs:537-548 — before extracting anything, compare `toolchain/crates/libs/wasi-pty/src/lib.rs` and `toolchain/crates/libs/wasi-spawn/src/lib.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×4
  • Duplicated block (9–10 lines × 2) crates/client/src/process.rs:657 — crates/client/src/process.rs:657-665 | crates/client/src/process.rs:684-693 — both copies are in the same file, so extract the 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) crates/runtime/src/fairness.rs:484 — crates/runtime/src/fairness.rs:484-492 | crates/runtime/src/fairness.rs:501-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) crates/sidecar-protocol/src/wire.rs:863 — crates/sidecar-protocol/src/wire.rs:863-872 | crates/sidecar-protocol/src/wire.rs:902-910 — both copies are in the same file, so extract the 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) crates/vfs/src/posix/overlay_fs.rs:1961 — crates/vfs/src/posix/overlay_fs.rs:1961-1969 | crates/vfs/src/posix/overlay_fs.rs:1980-1989 — both copies are in the same file, so extract the 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 (9 lines × 3) · ×4
  • Duplicated block (9 lines × 3) crates/native-sidecar-core/src/guest_net.rs:110 — crates/native-sidecar-core/src/guest_net.rs:110-118 | crates/native-sidecar-core/src/guest_net.rs:145-153 | crates/native-sidecar-core/src/guest_net.rs:276-284 — 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 (9 lines × 3) crates/native-sidecar/src/execution/network/tcp.rs:2339 — crates/native-sidecar/src/execution/network/tcp.rs:2339-2347 | crates/native-sidecar/src/execution/network/tls.rs:924-932 | crates/native-sidecar/src/execution/network/udp.rs:200-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (9 lines × 3) crates/runtime/src/capability.rs:475 — crates/runtime/src/capability.rs:475-483 | crates/runtime/src/capability.rs:517-526 | crates/runtime/src/capability.rs:551-560 — 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 (9 lines × 3) crates/vfs/src/posix/vfs.rs:1309 — crates/vfs/src/posix/vfs.rs:1309-1317 | crates/vfs/src/posix/vfs.rs:1448-1456 | crates/vfs/src/posix/vfs.rs:2133-2141 — 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.
X18 · Disposal-pattern correctness · Disposes a dependency it does not own · ×4
  • Disposes a dependency it does not own packages/runtime-core/src/node-runtime.ts:1140 — `kernel` is never created by `NodeRuntime` — it is the constructor parameter `kernel` (line 570), and its declared type `Kernel` is an interface — yet this class disposes it here (line 1140). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own packages/runtime-core/src/sidecar-process.ts:1886 — `protocolClient` is never created by `SidecarProcess` — it is the constructor parameter `protocolClient` (line 354), and its declared type `SidecarProcessTransport` is an interface — yet this class disposes it here (line 1886). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own packages/core/src/agent-os.ts:5955 — `#kernel` is never created by `AgentOs` — it is the constructor parameter `kernel` (line 2888), and its declared type `Kernel` is an interface — yet this class disposes it here (line 5955). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own packages/core/src/cron/cron-manager.ts:129 — `driver` is never created by `CronManager` — it is the constructor parameter `driver` (line 63), and its declared type `ScheduleDriver` is an interface — yet this class disposes it here (line 129). The instance came from whoever resolved it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the program is torn down when THIS instance goes away, and the real owner's later `dispose()` runs a second time on an object already disposed. Drop the call — a class disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
X2 · Cancellation propagation · Async function without AbortSignal · ×4
  • Async function without AbortSignal: get scripts/publish/verify-common-software.mjs:29 — `get` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: crateVersionExists scripts/publish/src/ci/bin.ts:52 — `crateVersionExists` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetch REDACTED:926 — `fetch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: httpRequest REDACTED:949 — `httpRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D1 · Cyclomatic Complexity · OwnedLanguageSidecar · ×3
  • OwnedLanguageSidecar::execute_language_operation_owned (cyclomatic 62) crates/native-sidecar/src/language_execution.rs:1235 — OwnedLanguageSidecar::execute_language_operation_owned has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • OwnedLanguageSidecar::handle_execution_lifecycle_owned (cyclomatic 42) crates/native-sidecar/src/language_execution.rs:1888 — OwnedLanguageSidecar::handle_execution_lifecycle_owned 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.
  • OwnedLanguageSidecar::expire_public_execution_deadlines (cyclomatic 20) crates/native-sidecar/src/language_execution.rs:1088 — OwnedLanguageSidecar::expire_public_execution_deadlines 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 · agentos_yq · ×3
  • agentos_yq::parse_args (cyclomatic 34) software/yq/native/crates/yq/src/lib.rs:72 — agentos_yq::parse_args 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.
  • agentos_yq::xml_to_json (cyclomatic 24) software/yq/native/crates/yq/src/lib.rs:274 — agentos_yq::xml_to_json 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.
  • agentos_yq::write_xml_element (cyclomatic 17) software/yq/native/crates/yq/src/lib.rs:505 — agentos_yq::write_xml_element 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 · agentos_native_sidecar_core · ×3
  • agentos_native_sidecar_core::limits::validate_vm_limits (cyclomatic 27) crates/native-sidecar-core/src/limits.rs:1134 — agentos_native_sidecar_core::limits::validate_vm_limits 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.
  • agentos_native_sidecar_core::limits::vm_limits_from_config (cyclomatic 24) crates/native-sidecar-core/src/limits.rs:492 — agentos_native_sidecar_core::limits::vm_limits_from_config 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.
  • agentos_native_sidecar_core::vm_fetch::parse_kernel_http_fetch_response (cyclomatic 16) crates/native-sidecar-core/src/vm_fetch.rs:9 — agentos_native_sidecar_core::vm_fetch::parse_kernel_http_fetch_response 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 · OverlayFileSystem · ×3
  • OverlayFileSystem::read_dir_limited (cyclomatic 24) crates/vfs/src/posix/overlay_fs.rs:1387 — OverlayFileSystem::read_dir_limited 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.
  • OverlayFileSystem::read_dir_with_types_inner (cyclomatic 18) crates/vfs/src/posix/overlay_fs.rs:1103 — OverlayFileSystem::read_dir_with_types_inner 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.
  • OverlayFileSystem::read_dir (cyclomatic 17) crates/vfs/src/posix/overlay_fs.rs:1323 — OverlayFileSystem::read_dir 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 · PipeManager · ×3
  • PipeManager::read_with_timeout (cyclomatic 22) crates/kernel/src/pipe_manager.rs:521 — PipeManager::read_with_timeout 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.
  • PipeManager::open_named_pipe (cyclomatic 17) crates/kernel/src/pipe_manager.rs:263 — PipeManager::open_named_pipe 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.
  • PipeManager::close (cyclomatic 16) crates/kernel/src/pipe_manager.rs:640 — PipeManager::close 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×3
  • Fixed-sleep synchronisation: interactive shell: tree / produces output and prompt returns software/tree/test/tree-test.nightly.test.ts:92 — This test starts work it did not wait for (`shell`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 1500))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: tree does not hang when stdin is an empty PTY software/tree/test/tree-test.nightly.test.ts:124 — This test starts work it did not wait for (`shell`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 1500))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: idles 60s+ in raw mode on the default CPU watchdog, then consumes a keystroke packages/core/tests/vim-interactive.nightly.test.ts:272 — This test starts work it did not wait for (`waitForScreen`, still running when the sleep starts) and then orders itself against it with `sleep(65_000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D2 · Cognitive Complexity · OwnedLanguageSidecar · ×3
  • OwnedLanguageSidecar::execute_language_operation_owned (cognitive 110) crates/native-sidecar/src/language_execution.rs:1235 — OwnedLanguageSidecar::execute_language_operation_owned has cognitive complexity 110 (threshold 15). Drivers by points: if/else 50 (91 pts), boolean chains 8, loops 2 (6 pts), match/switch 4 (5 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OwnedLanguageSidecar::handle_execution_lifecycle_owned (cognitive 62) crates/native-sidecar/src/language_execution.rs:1888 — OwnedLanguageSidecar::handle_execution_lifecycle_owned has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (53 pts), match/switch 7 (9 pts) (nesting depth added 32). 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.
  • OwnedLanguageSidecar::expire_public_execution_deadlines (cognitive 40) crates/native-sidecar/src/language_execution.rs:1088 — OwnedLanguageSidecar::expire_public_execution_deadlines has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (34 pts), boolean chains 3, loops 3 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PtyManager · ×3
  • PtyManager::read_with_timeout (cognitive 98) crates/kernel/src/pty.rs:535 — PtyManager::read_with_timeout has cognitive complexity 98 (threshold 15). Drivers by points: if/else 30 (91 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PtyManager::poll (cognitive 18) crates/kernel/src/pty.rs:419 — PtyManager::poll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 4). 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.
  • PtyManager::write (cognitive 18) crates/kernel/src/pty.rs:466 — PtyManager::write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentos_diff · ×3
  • agentos_diff::diff_files (cognitive 90) software/diffutils/native/crates/diff/src/lib.rs:250 — agentos_diff::diff_files has cognitive complexity 90 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 10 (31 pts), match/switch 4 (15 pts), boolean chains 2 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_diff::diff_dirs (cognitive 19) software/diffutils/native/crates/diff/src/lib.rs:131 — agentos_diff::diff_dirs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, match/switch 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_diff::preprocess (cognitive 17) software/diffutils/native/crates/diff/src/lib.rs:204 — agentos_diff::preprocess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentos_yq · ×3
  • agentos_yq::parse_args (cognitive 66) software/yq/native/crates/yq/src/lib.rs:72 — agentos_yq::parse_args has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (51 pts), boolean chains 7, loops 2 (4 pts), match/switch 1 (4 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.
  • agentos_yq::xml_to_json (cognitive 53) software/yq/native/crates/yq/src/lib.rs:274 — agentos_yq::xml_to_json has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_yq::write_xml_element (cognitive 30) software/yq/native/crates/yq/src/lib.rs:505 — agentos_yq::write_xml_element has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (10 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 17). 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 · agentos_jq · ×3
  • agentos_jq::parse_args (cognitive 40) software/jq/native/crates/jq/src/lib.rs:47 — agentos_jq::parse_args has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (30 pts), loops 2 (4 pts), match/switch 1 (4 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.
  • agentos_jq::read_inputs (cognitive 23) software/jq/native/crates/jq/src/lib.rs:188 — agentos_jq::read_inputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (8 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.
  • agentos_jq::run_jq (cognitive 21) software/jq/native/crates/jq/src/lib.rs:270 — agentos_jq::run_jq has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/native-sidecar/src/filesystem.rs:395 — crates/native-sidecar/src/filesystem.rs:395-439 | crates/native-sidecar/src/filesystem.rs:446-473 | crates/native-sidecar/src/filesystem.rs:4033-4075 | crates/native-sidecar/src/filesystem.rs:4086-4119 | crates/native-sidecar/src/plugins/host_dir.rs:985-1039 — 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/vfs/src/adapter/mounted_fs.rs:258 — crates/vfs/src/adapter/mounted_fs.rs:258-266 | crates/vfs/src/adapter/mounted_fs.rs:275-283 | crates/vfs/src/adapter/mounted_fs.rs:300-308 | crates/vfs/src/adapter/mounted_fs.rs:358-366 | crates/vfs/src/adapter/mounted_fs.rs:404-412 — 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/vfs/src/posix/vfs.rs:1906 — crates/vfs/src/posix/vfs.rs:1906-1941 | crates/vfs/src/posix/vfs.rs:1943-1973 | crates/vfs/src/posix/vfs.rs:1975-2008 | crates/vfs/src/posix/vfs.rs:2016-2059 | crates/vfs/src/posix/vfs.rs:2061-2088 — 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 · Duplicated block (29 lines × 2) · ×3
  • Duplicated block (29 lines × 2) crates/kernel/src/pipe_manager.rs:839 — crates/kernel/src/pipe_manager.rs:839-867 | crates/kernel/src/pty.rs:1437-1465 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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 (29 lines × 2) crates/native-sidecar/src/execution/javascript/http.rs:550 — crates/native-sidecar/src/execution/javascript/http.rs:550-578 | crates/native-sidecar/src/execution/javascript/http.rs:1388-1416 — both copies are in the same file, so extract the 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 (29 lines × 2) crates/native-sidecar/src/language_execution.rs:2166 — crates/native-sidecar/src/language_execution.rs:2166-2194 | crates/native-sidecar/src/language_execution.rs:2236-2264 — both copies are in the same file, so extract the 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 (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) crates/kernel/src/socket_table.rs:1518 — crates/kernel/src/socket_table.rs:1518-1544 | crates/kernel/src/socket_table.rs:1655-1681 — both copies are in the same file, so extract the 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 (27 lines × 2) crates/native-sidecar/src/execution/launch.rs:4547 — crates/native-sidecar/src/execution/launch.rs:4547-4573 | crates/native-sidecar/src/execution/launch.rs:4773-4799 — both copies are in the same file, so extract the 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 (27 lines × 2) crates/native-sidecar/src/stdio.rs:2107 — crates/native-sidecar/src/stdio.rs:2107-2133 | crates/native-sidecar/src/stdio.rs:2138-2164 — both copies are in the same file, so extract the 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 (18–19 lines × 2) · ×3
  • Duplicated block (18–19 lines × 2) crates/native-sidecar/src/execution/launch.rs:220 — crates/native-sidecar/src/execution/launch.rs:220-238 | crates/native-sidecar/src/execution/launch.rs:275-292 — both copies are in the same file, so extract the 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–19 lines × 2) crates/native-sidecar/src/service.rs:3433 — crates/native-sidecar/src/service.rs:3433-3451 | crates/native-sidecar/src/service.rs:3551-3568 — both copies are in the same file, so extract the 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–19 lines × 2) crates/native-sidecar/src/vm.rs:905 — crates/native-sidecar/src/vm.rs:905-922 | crates/native-sidecar/src/vm.rs:1816-1834 — both copies are in the same file, so extract the 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 × 2) · ×3
  • Duplicated block (15–16 lines × 2) crates/kernel/src/kernel.rs:9072 — crates/kernel/src/kernel.rs:9072-9086 | crates/kernel/src/kernel.rs:9702-9717 — both copies are in the same file, so extract the 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–16 lines × 2) crates/native-sidecar/src/language_execution.rs:1179 — crates/native-sidecar/src/language_execution.rs:1179-1194 | crates/native-sidecar/src/language_execution.rs:2585-2599 — both copies are in the same file, so extract the 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–16 lines × 2) crates/native-sidecar/src/vm.rs:1392 — crates/native-sidecar/src/vm.rs:1392-1406 | crates/native-sidecar/src/vm.rs:2285-2300 — both copies are in the same file, so extract the 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 (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) crates/execution/src/javascript.rs:1589 — crates/execution/src/javascript.rs:1589-1600 | crates/native-sidecar/src/vm.rs:5083-5095 — 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–13 lines × 2) crates/execution/src/javascript.rs:5376 — crates/execution/src/javascript.rs:5376-5387 | crates/execution/src/javascript.rs:5419-5431 — both copies are in the same file, so extract the 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–13 lines × 2) crates/native-sidecar-core/src/guest_fs.rs:20 — crates/native-sidecar-core/src/guest_fs.rs:20-31 | crates/native-sidecar-core/src/guest_fs.rs:44-56 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) crates/native-sidecar-core/src/router.rs:139 — crates/native-sidecar-core/src/router.rs:139-148 | crates/native-sidecar-core/src/router.rs:215-225 — both copies are in the same file, so extract the 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–11 lines × 2) crates/native-sidecar/src/execution/child_process.rs:5495 — crates/native-sidecar/src/execution/child_process.rs:5495-5505 | crates/native-sidecar/src/execution/child_process.rs:5753-5762 — both copies are in the same file, so extract the 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–11 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:386 — crates/native-sidecar/src/execution/network/http2.rs:386-396 | crates/native-sidecar/src/execution/network/http2.rs:651-660 — both copies are in the same file, so extract the 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 (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) crates/kernel/src/kernel.rs:5200 — crates/kernel/src/kernel.rs:5200-5209 | crates/kernel/src/kernel.rs:5320-5329 | crates/kernel/src/kernel.rs:5552-5561 — 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/kernel/src/pipe_manager.rs:372 — crates/kernel/src/pipe_manager.rs:372-381 | crates/kernel/src/pipe_manager.rs:761-770 | crates/kernel/src/pipe_manager.rs:790-799 — 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/native-sidecar/src/execution/javascript/http.rs:846 — crates/native-sidecar/src/execution/javascript/http.rs:846-855 | crates/native-sidecar/src/execution/javascript/http.rs:1016-1026 | crates/native-sidecar/src/execution/javascript/http.rs:2612-2622 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: ActiveProcess (LCOM4 18) crates/native-sidecar/src/state.rs:2039 — ActiveProcess's methods fall into 18 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 18 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: RoutedExtensionServices (LCOM4 5) crates/native-sidecar/src/extension_services.rs:831 — RoutedExtensionServices's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LoopbackTlsEndpoint (LCOM4 4) crates/native-sidecar/src/state.rs:3081 — LoopbackTlsEndpoint's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R10 · Code Duplication · Duplicated block (42 lines × 2 locations) · ×3
  • Duplicated block (42 lines × 2 locations) packages/build-tools/bridge-src/builtins/child-process.ts:764 — packages/build-tools/bridge-src/builtins/child-process.ts:764 · packages/build-tools/bridge-src/builtins/child-process.ts:903 — 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 (42 lines × 2 locations) packages/core/src/options-schema.ts:15 — packages/core/src/options-schema.ts:15 · packages/runtime-core/src/node-runtime-options-schema.ts:5 — 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 (42 lines × 2 locations) REDACTED:1322 — REDACTED:1322 · packages/runtime-core/src/test-runtime.ts:1889 — 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.
D1 · Cyclomatic Complexity · agentos_native_baseline · ×2
  • agentos_native_baseline::run_once (cyclomatic 64) crates/native-baseline/src/main.rs:285 — agentos_native_baseline::run_once has cyclomatic complexity 64 (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.
  • agentos_native_baseline::main (cyclomatic 17) crates/native-baseline/src/main.rs:918 — agentos_native_baseline::main 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: agentos_native_baseline::parse_op (cyclomatic 41) 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 · agentos_file_cmd · ×2
  • agentos_file_cmd::identify (cyclomatic 41) software/file/native/crates/file-cmd/src/lib.rs:192 — agentos_file_cmd::identify has cyclomatic complexity 41 (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.
  • agentos_file_cmd::main (cyclomatic 31) software/file/native/crates/file-cmd/src/lib.rs:12 — agentos_file_cmd::main 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 · agentos_kernel · ×2
  • agentos_kernel::pty::process_input (cyclomatic 37) crates/kernel/src/pty.rs:1103 — agentos_kernel::pty::process_input 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.
  • agentos_kernel::kernel::resolve_unix_socket_components (cyclomatic 23) crates/kernel/src/kernel.rs:8933 — agentos_kernel::kernel::resolve_unix_socket_components 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 · agentos_diff · ×2
  • agentos_diff::diff_files (cyclomatic 37) software/diffutils/native/crates/diff/src/lib.rs:250 — agentos_diff::diff_files 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.
  • agentos_diff::main (cyclomatic 18) software/diffutils/native/crates/diff/src/lib.rs:37 — agentos_diff::main 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.
D1 · Cyclomatic Complexity · LocalBridgeState · ×2
  • LocalBridgeState::handle_internal_bridge_call (cyclomatic 26) crates/execution/src/javascript.rs:4375 — LocalBridgeState::handle_internal_bridge_call 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: agentos_execution::javascript::builtin_named_exports (cyclomatic 41) 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.
  • LocalBridgeState::handle_polyfill_dispatch (cyclomatic 17) crates/execution/src/javascript.rs:4491 — LocalBridgeState::handle_polyfill_dispatch 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: agentos_execution::javascript::builtin_named_exports (cyclomatic 41) 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 · agentos_client · ×2
  • agentos_client::cron::looks_like_one_shot (cyclomatic 25) crates/client/src/cron.rs:389 — agentos_client::cron::looks_like_one_shot 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.
  • agentos_client::agent_os::validate_host_function_input_at_path (cyclomatic 16) crates/client/src/agent_os.rs:2286 — agentos_client::agent_os::validate_host_function_input_at_path 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 · agentos_tar · ×2
  • agentos_tar::main (cognitive 86) software/tar/native/crates/tar/src/lib.rs:110 — agentos_tar::main has cognitive complexity 86 (threshold 15). Drivers by points: if/else 29 (61 pts), match/switch 7 (18 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_tar::do_extract (cognitive 27) software/tar/native/crates/tar/src/lib.rs:551 — agentos_tar::do_extract has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 2 (4 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 · agentos_file_cmd · ×2
  • agentos_file_cmd::main (cognitive 82) software/file/native/crates/file-cmd/src/lib.rs:12 — agentos_file_cmd::main has cognitive complexity 82 (threshold 15). Drivers by points: if/else 20 (59 pts), match/switch 5 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_file_cmd::identify (cognitive 18) software/file/native/crates/file-cmd/src/lib.rs:192 — agentos_file_cmd::identify has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (5 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 · agentos_native_baseline · ×2
  • agentos_native_baseline::run_once (cognitive 57) crates/native-baseline/src/main.rs:285 — agentos_native_baseline::run_once has cognitive complexity 57 (threshold 15). Drivers by points: loops 18 (38 pts), if/else 8 (18 pts), match/switch 1 (nesting depth added 30). 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.
  • agentos_native_baseline::main (cognitive 32) crates/native-baseline/src/main.rs:918 — agentos_native_baseline::main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 5 (10 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_cmp · ×2
  • cmd_cmp::compare (cognitive 43) software/coreutils/native/crates/cmd-cmp/src/main.rs:179 — cmd_cmp::compare has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 2 (3 pts), boolean chains 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.
  • cmd_cmp::parse_args (cognitive 34) software/coreutils/native/crates/cmd-cmp/src/main.rs:79 — cmd_cmp::parse_args has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 14, 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.
D2 · Cognitive Complexity · agentos_strings_cmd · ×2
  • agentos_strings_cmd::main (cognitive 38) software/coreutils/native/crates/strings-cmd/src/lib.rs:10 — agentos_strings_cmd::main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 6 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_strings_cmd::extract_strings (cognitive 28) software/coreutils/native/crates/strings-cmd/src/lib.rs:112 — agentos_strings_cmd::extract_strings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentos_du · ×2
  • agentos_du::walk_du (cognitive 37) software/coreutils/native/crates/du/src/lib.rs:132 — agentos_du::walk_du has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 2, loops 1 (2 pts) (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.
  • agentos_du::main (cognitive 30) software/coreutils/native/crates/du/src/lib.rs:19 — agentos_du::main has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 6 (9 pts), loops 3 (5 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · ModuleResolver · ×2
  • ModuleResolver::resolve_path (cognitive 28) crates/execution/src/javascript.rs:5165 — ModuleResolver::resolve_path has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ModuleResolver::resolve_package_imports (cognitive 18) crates/execution/src/javascript.rs:5035 — ModuleResolver::resolve_package_imports has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 1 (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 · agentos_column · ×2
  • agentos_column::main (cognitive 28) software/coreutils/native/crates/column/src/lib.rs:6 — agentos_column::main has cognitive complexity 28 (threshold 15). Drivers by points: loops 4 (9 pts), match/switch 4 (9 pts), if/else 6 (8 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • agentos_column::format_table (cognitive 23) software/coreutils/native/crates/column/src/lib.rs:95 — agentos_column::format_table has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (10 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 · PosixAcl · ×2
  • PosixAcl::validate (cognitive 22) crates/kernel/src/kernel.rs:9449 — PosixAcl::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PosixAcl::check_access (cognitive 17) crates/kernel/src/kernel.rs:9590 — PosixAcl::check_access has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, 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 · LocalBridgeState · ×2
  • LocalBridgeState::handle_internal_bridge_call (cognitive 21) crates/execution/src/javascript.rs:4375 — LocalBridgeState::handle_internal_bridge_call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • LocalBridgeState::handle_polyfill_dispatch (cognitive 19) crates/execution/src/javascript.rs:4491 — LocalBridgeState::handle_polyfill_dispatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuestPathTranslator · ×2
  • GuestPathTranslator::guest_to_host (cognitive 20) crates/execution/src/javascript.rs:1331 — GuestPathTranslator::guest_to_host has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 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.
  • GuestPathTranslator::canonical_guest_path (cognitive 18) crates/execution/src/javascript.rs:1406 — GuestPathTranslator::canonical_guest_path has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoopbackTlsEndpoint · ×2
  • LoopbackTlsEndpoint::poll_read (cognitive 18) crates/native-sidecar/src/execution/network/tls.rs:426 — LoopbackTlsEndpoint::poll_read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • LoopbackTlsEndpoint::read (cognitive 17) crates/native-sidecar/src/execution/network/tls.rs:279 — LoopbackTlsEndpoint::read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ProcessTable · ×2
  • ProcessTable::register_with_process_group (cognitive 17) crates/kernel/src/process_table.rs:440 — ProcessTable::register_with_process_group has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ProcessTable::setpgid (cognitive 16) crates/kernel/src/process_table.rs:783 — ProcessTable::setpgid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 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.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×2
  • Edited copy of a member (21 corresponding lines) crates/native-sidecar/src/execution/child_process.rs:7679 — crates/native-sidecar/src/execution/child_process.rs:7679-7709 | crates/native-sidecar/src/execution/child_process.rs:7716-7741 — 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/kernel/src/pty.rs:157 — crates/kernel/src/pty.rs:157-179 | crates/kernel/src/pty.rs:183-205 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4986 — crates/native-sidecar/src/execution/child_process.rs:4986-5021 | crates/native-sidecar/src/execution/child_process.rs:5650-5685 — both copies are in the same file, so extract the 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 (36 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:4333 — crates/native-sidecar/src/execution/javascript/rpc.rs:4333-4368 | crates/native-sidecar/src/execution/javascript/rpc.rs:4522-4557 — both copies are in the same file, so extract the 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 (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:3249 — crates/native-sidecar/src/execution/javascript/rpc.rs:3249-3270 | crates/native-sidecar/src/execution/javascript/rpc.rs:3988-4009 — both copies are in the same file, so extract the 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 (22 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:4377 — crates/native-sidecar/src/execution/javascript/rpc.rs:4377-4398 | crates/native-sidecar/src/execution/javascript/rpc.rs:4570-4591 — both copies are in the same file, so extract the 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 (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) crates/native-sidecar/src/stdio.rs:3354 — crates/native-sidecar/src/stdio.rs:3354-3373 | crates/native-sidecar/src/stdio.rs:3412-3431 — both copies are in the same file, so extract the 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) crates/native-sidecar/src/vm.rs:1476 — crates/native-sidecar/src/vm.rs:1476-1495 | crates/native-sidecar/src/vm.rs:2235-2254 — both copies are in the same file, so extract the 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 (19 lines × 3) · ×2
  • Duplicated block (19 lines × 3) crates/native-sidecar/src/execution/network/http2.rs:417 — crates/native-sidecar/src/execution/network/http2.rs:417-435 | crates/native-sidecar/src/execution/network/http2.rs:440-458 | crates/native-sidecar/src/execution/network/http2.rs:529-547 — 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 (19 lines × 3) crates/v8-runtime/src/host_call.rs:765 — crates/v8-runtime/src/host_call.rs:765-783 | crates/v8-runtime/src/host_call.rs:797-815 | crates/v8-runtime/src/host_call.rs:829-847 — 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 (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) crates/native-sidecar-core/src/router.rs:120 — crates/native-sidecar-core/src/router.rs:120-136 | crates/native-sidecar-core/src/router.rs:196-213 — both copies are in the same file, so extract the 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–18 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:352 — crates/native-sidecar/src/execution/network/http2.rs:352-369 | crates/native-sidecar/src/execution/network/http2.rs:608-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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) crates/native-sidecar/src/execution/process.rs:2029 — crates/native-sidecar/src/execution/process.rs:2029-2044 | crates/native-sidecar/src/execution/process.rs:2051-2066 | crates/native-sidecar/src/execution/process.rs:2076-2091 — 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 (16 lines × 3) crates/native-sidecar/src/stdio.rs:2415 — crates/native-sidecar/src/stdio.rs:2415-2430 | crates/native-sidecar/src/stdio.rs:2739-2754 | crates/native-sidecar/src/stdio.rs:2788-2803 — 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 (13–16 lines × 2) · ×2
  • Duplicated block (13–16 lines × 2) crates/native-sidecar/src/execution/child_process.rs:5194 — crates/native-sidecar/src/execution/child_process.rs:5194-5206 | crates/native-sidecar/src/execution/child_process.rs:7989-8004 — both copies are in the same file, so extract the 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–16 lines × 2) crates/native-sidecar/src/service.rs:2121 — crates/native-sidecar/src/service.rs:2121-2136 | crates/native-sidecar/src/service.rs:2160-2172 — both copies are in the same file, so extract the 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 (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) crates/kernel/src/kernel.rs:5444 — crates/kernel/src/kernel.rs:5444-5458 | crates/kernel/src/kernel.rs:5554-5567 — both copies are in the same file, so extract the 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–15 lines × 2) crates/native-sidecar/src/language_execution.rs:1131 — crates/native-sidecar/src/language_execution.rs:1131-1145 | crates/native-sidecar/src/language_execution.rs:2538-2551 — both copies are in the same file, so extract the 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 (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) crates/kernel/src/socket_table.rs:2114 — crates/kernel/src/socket_table.rs:2114-2127 | crates/kernel/src/socket_table.rs:2178-2191 | crates/kernel/src/socket_table.rs:2226-2239 — 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 (14 lines × 3) crates/native-sidecar/src/execution/javascript/rpc.rs:3564 — crates/native-sidecar/src/execution/javascript/rpc.rs:3564-3577 | crates/native-sidecar/src/execution/javascript/rpc.rs:4454-4467 | crates/native-sidecar/src/execution/javascript/rpc.rs:4647-4660 — 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 (13 lines × 4) · ×2
  • Duplicated block (13 lines × 4) crates/native-sidecar/src/execution/child_process.rs:8953 — crates/native-sidecar/src/execution/child_process.rs:8953-8965 | crates/native-sidecar/src/execution/child_process.rs:9024-9036 | crates/native-sidecar/src/execution/child_process.rs:9225-9237 | crates/native-sidecar/src/execution/child_process.rs:9583-9595 — 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 (13 lines × 4) crates/native-sidecar/src/execution/javascript/rpc.rs:3688 — crates/native-sidecar/src/execution/javascript/rpc.rs:3688-3700 | crates/native-sidecar/src/execution/javascript/rpc.rs:4064-4076 | crates/native-sidecar/src/execution/javascript/rpc.rs:4360-4372 | crates/native-sidecar/src/execution/javascript/rpc.rs:4549-4561 — 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 (12 lines × 3) · ×2
  • Duplicated block (12 lines × 3) crates/native-sidecar/src/execution/child_process.rs:9246 — crates/native-sidecar/src/execution/child_process.rs:9246-9257 | crates/native-sidecar/src/execution/child_process.rs:9652-9663 | crates/native-sidecar/src/execution/child_process.rs:9700-9711 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) crates/native-sidecar/src/service.rs:4249 — crates/native-sidecar/src/service.rs:4249-4260 | crates/native-sidecar/src/service.rs:4337-4348 | crates/native-sidecar/src/service.rs:4353-4364 — 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 (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) crates/native-sidecar/src/execution/python/sockets.rs:511 — crates/native-sidecar/src/execution/python/sockets.rs:511-521 | crates/native-sidecar/src/execution/python/sockets.rs:593-603 | crates/native-sidecar/src/execution/python/sockets.rs:661-671 | crates/native-sidecar/src/execution/python/sockets.rs:737-747 — 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 (11 lines × 4) crates/native-sidecar/src/filesystem.rs:3638 — crates/native-sidecar/src/filesystem.rs:3638-3648 | crates/native-sidecar/src/service.rs:5994-6004 | crates/vfs/src/posix/mount_table.rs:2679-2689 | crates/vfs/src/posix/tar_fs.rs:755-765 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) crates/native-sidecar/src/language_execution.rs:1131 — crates/native-sidecar/src/language_execution.rs:1131-1138 | crates/native-sidecar/src/language_execution.rs:1182-1189 | crates/native-sidecar/src/language_execution.rs:2538-2545 | crates/native-sidecar/src/language_execution.rs:2588-2595 — 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) crates/v8-runtime/src/session.rs:3850 — crates/v8-runtime/src/session.rs:3850-3857 | crates/v8-runtime/src/session.rs:3868-3875 | crates/v8-runtime/src/session.rs:3987-3994 | crates/v8-runtime/src/session.rs:4047-4054 — 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 (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) crates/native-sidecar/src/execution/child_process.rs:5361 — crates/native-sidecar/src/execution/child_process.rs:5361-5368 | crates/native-sidecar/src/execution/child_process.rs:5893-5899 — both copies are in the same file, so extract the 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–8 lines × 2) crates/native-sidecar/src/plugins/host_dir.rs:1676 — crates/native-sidecar/src/plugins/host_dir.rs:1676-1682 | crates/native-sidecar/src/plugins/host_dir.rs:1721-1728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×2
  • Duplicated block (6–8 lines × 2) crates/native-sidecar/src/filesystem.rs:5573 — crates/native-sidecar/src/filesystem.rs:5573-5578 | crates/native-sidecar/src/filesystem.rs:5609-5616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6–8 lines × 2) crates/native-sidecar/src/vm.rs:1499 — crates/native-sidecar/src/vm.rs:1499-1506 | crates/native-sidecar/src/vm.rs:2256-2261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) crates/vfs/src/posix/mount_table.rs:247 — crates/vfs/src/posix/mount_table.rs:247-252 | crates/vfs/src/posix/mount_table.rs:264-269 | crates/vfs/src/posix/vfs.rs:634-639 | crates/vfs/src/posix/vfs.rs:653-658 — before extracting anything, compare `crates/vfs/src/posix/mount_table.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 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 × 4) crates/kernel/src/kernel.rs:9178 — crates/kernel/src/kernel.rs:9178-9183 | crates/kernel/src/pipe_manager.rs:887-892 | crates/kernel/src/poll.rs:250-255 | crates/kernel/src/pty.rs:1485-1490 — before extracting anything, compare `crates/kernel/src/pipe_manager.rs` and `crates/kernel/src/pty.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 102 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.
P12 · CI test-gate honesty · Tests run only outside the merge gate · ×2
  • Tests run only outside the merge gate REDACTED:56 — `pnpm test` is the only CI command that runs 304 test(s) in 80 file(s) (e.g. `packages/agentos-sandbox/tests/provider.test.ts`, `packages/agentos-sandbox/tests/vm-integration.test.ts`), and the workflow runs only on a schedule — a failure there is found after the change merged, when the only remedy is a revert. Run them on pull requests (or in the merge queue).
  • Tests run only outside the merge gate REDACTED:75 — `pnpm --dir packages/runtime-core test:npm-workflows` is the only CI command that runs 8 test(s) in 3 file(s) (e.g. `packages/runtime-core/tests/integration/e2e-concurrently.nightly.test.ts`, `packages/runtime-core/tests/integration/e2e-nextjs-build.nightly.test.ts`), and the workflow runs only on a schedule — a failure there is found after the change merged, when the only remedy is a revert. Run them on pull requests (or in the merge queue).
P12 · CI test-gate honesty · Workspace package's tests never run by CI · ×2
  • Workspace package's tests never run by CI packages/runtime-core/tests/integration/projects/jest-native-resolver-blocked/package.json:1 — `packages/runtime-core/tests/integration/projects/jest-native-resolver-blocked` is a workspace package with 1 test(s) in 1 file(s) (e.g. `packages/runtime-core/tests/integration/projects/jest-native-resolver-blocked/sum.test.cjs`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
  • Workspace package's tests never run by CI packages/runtime-core/tests/integration/projects/mocha-pass/package.json:1 — `packages/runtime-core/tests/integration/projects/mocha-pass` is a workspace package with 3 test(s) in 2 file(s) (e.g. `packages/runtime-core/tests/integration/projects/mocha-pass/test/math.test.cjs`, `packages/runtime-core/tests/integration/projects/mocha-pass/test/text.test.cjs`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
R10 · Code Duplication · Duplicated block (109 lines × 2 locations) · ×2
  • Duplicated block (109 lines × 2 locations) packages/build-tools/bridge-src/builtins/http.ts:3835 — packages/build-tools/bridge-src/builtins/http.ts:3835 · packages/build-tools/bridge-src/builtins/http.ts:4012 — both copies are in the same file, so extract the 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 (109 lines × 2 locations) REDACTED:1572 — REDACTED:1572 · packages/runtime-core/src/test-runtime.ts:2155 — 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 (41 lines × 2 locations) · ×2
  • Duplicated block (41 lines × 2 locations) crates/execution/assets/runners/wasm-runner.mjs:6699 — crates/execution/assets/runners/wasm-runner.mjs:6699 · crates/execution/assets/runners/wasm-runner.mjs:6815 — 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 (41 lines × 2 locations) REDACTED:1140 — REDACTED:1140 · packages/runtime-core/src/test-runtime.ts:1704 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R7 · Dead Code · Dead file (~95 LoC) · ×2
  • Dead file (~95 LoC) packages/playground/scripts/build-worker.js — no import path from any entry point (354 application, 40 tooling, 445 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
  • Dead file (~95 LoC) scripts/gen-registry.mjs — no import path from any entry point (354 application, 40 tooling, 445 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
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×2
  • Untrusted text written into markup unescaped packages/playground/frontend/app.js:329 — `LANGUAGE_ICONS[proc.language]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped packages/playground/frontend/app.js:450 — `addProcessMenu.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) packages/runtime-browser/src/root-filesystem-from-vfs.ts:57 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) packages/runtime-browser/src/sab-reactor.ts:202 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — your Biome config enables no a11y rules and there's no axe/pa11y/Lighthouse in tests or CI. Start by turning on Biome's own a11y rule group to catch issues at author time. What was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
AX7 · Slice cohesion · Cross-slice coupling · ×1
  • Cross-slice coupling: utmpx → systemd_logind toolchain/stubs/uucore/src/lib/features/utmpx.rs:394 — `UtmpxIter` (slice 'utmpx') depends on `SystemdUtmpxIter` from slice 'systemd_logind'.
D1 · Cyclomatic Complexity · worker.createBrowserProcess (cyclomatic 109) · ×1
  • worker.createBrowserProcess (cyclomatic 109) packages/runtime-browser/src/worker.ts:2630 — worker.createBrowserProcess has cyclomatic complexity 109 (threshold 15). Of this number, 44 points are the body's own statements and 65 belong to 26 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 · net-tcp-event-floor.bench.deriveGuestBridgeTrace (cyclomatic 103) · ×1
  • net-tcp-event-floor.bench.deriveGuestBridgeTrace (cyclomatic 103) packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:831 — net-tcp-event-floor.bench.deriveGuestBridgeTrace has cyclomatic complexity 103 (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 · net_poll (cyclomatic 99) · ×1
  • net_poll (cyclomatic 99) crates/execution/assets/runners/wasm-runner.mjs:5344 — net_poll has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · poll_oneoff (cyclomatic 86) · ×1
  • poll_oneoff (cyclomatic 86) crates/execution/assets/runners/wasm-runner.mjs:12064 — poll_oneoff has cyclomatic complexity 86 (threshold 15). Of this number, 61 points are the body's own statements and 25 belong to 8 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 · NativeSidecarKernelProxy.openShell (cyclomatic 85) · ×1
  • NativeSidecarKernelProxy.openShell (cyclomatic 85) REDACTED:1021 — NativeSidecarKernelProxy.openShell has cyclomatic complexity 85 (threshold 15). Of this number, 29 points are the body's own statements and 56 belong to 17 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 · builtin-modules.loadBuiltinModule (cyclomatic 84) · ×1
  • builtin-modules.loadBuiltinModule (cyclomatic 84) packages/build-tools/bridge-src/builtins/builtin-modules.ts:698 — builtin-modules.loadBuiltinModule has cyclomatic complexity 84 (threshold 15). Of this number, 67 points are the body's own statements and 17 belong to 7 function items inside it that branch. 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 · _pollOneoff (cyclomatic 81) · ×1
  • _pollOneoff (cyclomatic 81) crates/execution/assets/runners/wasi-module.js:2495 — _pollOneoff has cyclomatic complexity 81 (threshold 15). Of this number, 77 points are the body's own statements and 4 belong to 7 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 · request-payloads.toGeneratedRequestPayload (cyclomatic 77) · ×1
  • request-payloads.toGeneratedRequestPayload (cyclomatic 77) packages/runtime-core/src/request-payloads.ts:405 — request-payloads.toGeneratedRequestPayload has cyclomatic complexity 77 (threshold 15). Of this number, 76 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · NativeSidecarKernelProxy.openShell (cyclomatic 74) · ×1
  • NativeSidecarKernelProxy.openShell (cyclomatic 74) REDACTED:813 — NativeSidecarKernelProxy.openShell has cyclomatic complexity 74 (threshold 15). Of this number, 29 points are the body's own statements and 45 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 · installPythonWorkspaceFs (cyclomatic 74) · ×1
  • installPythonWorkspaceFs (cyclomatic 74) crates/execution/assets/runners/python-runner.mjs:1674 — installPythonWorkspaceFs has cyclomatic complexity 74 (threshold 15). Most of this is not in the body itself: 14 of the 74 points are its own statements and the rest belongs to 48 function items inside it that branch (propagateSetattrToHost, createFsError, makeStat, …). 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 · _NetSocket._pumpBridgeReads (cyclomatic 69) · ×1
  • _NetSocket._pumpBridgeReads (cyclomatic 69) packages/build-tools/bridge-src/builtins/net.ts:2735 — _NetSocket._pumpBridgeReads 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.
D1 · Cyclomatic Complexity · response-payloads.fromGeneratedResponsePayload (cyclomatic 66) · ×1
  • response-payloads.fromGeneratedResponsePayload (cyclomatic 66) packages/runtime-core/src/response-payloads.ts:329 — response-payloads.fromGeneratedResponsePayload has cyclomatic complexity 66 (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 · child-process.spawn (cyclomatic 63) · ×1
  • child-process.spawn (cyclomatic 63) packages/build-tools/bridge-src/builtins/child-process.ts:1361 — child-process.spawn has cyclomatic complexity 63 (threshold 15). Of this number, 43 points are the body's own statements and 20 belong to 6 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. This is NOT this file's highest cyclomatic complexity: ChildProcess.constructor (cyclomatic 68) 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 · fd_read (cyclomatic 59) · ×1
  • fd_read (cyclomatic 59) crates/execution/assets/runners/wasm-runner.mjs:10639 — fd_read has cyclomatic complexity 59 (threshold 15). Of this number, 45 points are the body's own statements and 14 belong to 22 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 · _fdWrite (cyclomatic 58) · ×1
  • _fdWrite (cyclomatic 58) crates/execution/assets/runners/wasi-module.js:1404 — _fdWrite has cyclomatic complexity 58 (threshold 15). Of this number, 51 points are the body's own statements and 7 belong to 25 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 · _fdRead (cyclomatic 58) · ×1
  • _fdRead (cyclomatic 58) crates/execution/assets/runners/wasi-module.js:1677 — _fdRead has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · readdir.bench.main (cyclomatic 57) · ×1
  • readdir.bench.main (cyclomatic 57) packages/runtime-benchmarks/src/focused/readdir.bench.ts:511 — readdir.bench.main has cyclomatic complexity 57 (threshold 15). Of this number, 35 points are the body's own statements and 22 belong to 5 function items 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 · net_recv (cyclomatic 56) · ×1
  • net_recv (cyclomatic 56) crates/execution/assets/runners/wasm-runner.mjs:6238 — net_recv has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · wasm-runner.decodeSpawnActions (cyclomatic 52) · ×1
  • wasm-runner.decodeSpawnActions (cyclomatic 52) crates/execution/assets/runners/wasm-runner.mjs:1614 — wasm-runner.decodeSpawnActions has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · http2.http2Dispatch (cyclomatic 52) · ×1
  • http2.http2Dispatch (cyclomatic 52) packages/build-tools/bridge-src/builtins/http2.ts:1994 — http2.http2Dispatch has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc_spawn_v2 (cyclomatic 52) · ×1
  • proc_spawn_v2 (cyclomatic 52) crates/execution/assets/runners/wasm-runner.mjs:6842 — proc_spawn_v2 has cyclomatic complexity 52 (threshold 15). Of this number, 49 points are the body's own statements and 3 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 · fd_recvmsg_rights (cyclomatic 49) · ×1
  • fd_recvmsg_rights (cyclomatic 49) crates/execution/assets/runners/wasm-runner.mjs:8466 — fd_recvmsg_rights has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentos_tar · ×1
  • agentos_tar::main (cyclomatic 46) software/tar/native/crates/tar/src/lib.rs:110 — agentos_tar::main has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · child-process.spawnSync (cyclomatic 46) · ×1
  • child-process.spawnSync (cyclomatic 46) packages/build-tools/bridge-src/builtins/child-process.ts:1535 — child-process.spawnSync has cyclomatic complexity 46 (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: ChildProcess.constructor (cyclomatic 68) 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 · path_open (cyclomatic 45) · ×1
  • path_open (cyclomatic 45) crates/execution/assets/runners/wasm-runner.mjs:10082 — path_open has cyclomatic complexity 45 (threshold 15). Of this number, 41 points are the body's own statements and 4 belong to 10 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: mapHostProcessError (cyclomatic 47) 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 · child-process.decodeAdvancedIpcMessage (cyclomatic 44) · ×1
  • child-process.decodeAdvancedIpcMessage (cyclomatic 44) packages/build-tools/bridge-src/builtins/child-process.ts:194 — child-process.decodeAdvancedIpcMessage has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 14 of the 44 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 198, decode). 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: ChildProcess.constructor (cyclomatic 68) 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 · console.installBuiltinUtilFormatWithOptions (cyclomatic 42) · ×1
  • console.installBuiltinUtilFormatWithOptions (cyclomatic 42) packages/build-tools/bridge-src/builtins/console.ts:378 — console.installBuiltinUtilFormatWithOptions has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 11 of the 42 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 501, a function literal at line 453, a function literal at line 423, …). 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 · net.wakeSocketBridgeReads (cyclomatic 42) · ×1
  • net.wakeSocketBridgeReads (cyclomatic 42) packages/build-tools/bridge-src/builtins/net.ts:141 — net.wakeSocketBridgeReads has cyclomatic complexity 42 (threshold 15). Of this number, 29 points are the body's own statements and 13 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Performer · ×1
  • Performer::csi_dispatch (cyclomatic 40) crates/native-sidecar/src/execution/terminal_model.rs:459 — Performer::csi_dispatch has cyclomatic complexity 40 (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 · net.normalizeListenArgs (cyclomatic 39) · ×1
  • net.normalizeListenArgs (cyclomatic 39) packages/build-tools/bridge-src/builtins/net.ts:483 — net.normalizeListenArgs 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 · _pathOpen (cyclomatic 39) · ×1
  • _pathOpen (cyclomatic 39) crates/execution/assets/runners/wasi-module.js:2265 — _pathOpen has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 belong to 6 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 · child-process.routeChildProcessEvent (cyclomatic 38) · ×1
  • child-process.routeChildProcessEvent (cyclomatic 38) packages/build-tools/bridge-src/builtins/child-process.ts:333 — child-process.routeChildProcessEvent has cyclomatic complexity 38 (threshold 15). Of this number, 23 points are the body's own statements and 15 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ChildProcess.constructor (cyclomatic 68) 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 · wasm-runner.readHostNetSocketToGuestIovs (cyclomatic 37) · ×1
  • wasm-runner.readHostNetSocketToGuestIovs (cyclomatic 37) crates/execution/assets/runners/wasm-runner.mjs:3384 — wasm-runner.readHostNetSocketToGuestIovs 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. This is NOT this file's highest cyclomatic complexity: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · proc_waitpid_v3 (cyclomatic 37) · ×1
  • proc_waitpid_v3 (cyclomatic 37) crates/execution/assets/runners/wasm-runner.mjs:7469 — proc_waitpid_v3 has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 belong to 6 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_dup2 (cyclomatic 36) · ×1
  • fd_dup2 (cyclomatic 36) crates/execution/assets/runners/wasm-runner.mjs:7886 — fd_dup2 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_write (cyclomatic 36) · ×1
  • fd_write (cyclomatic 36) crates/execution/assets/runners/wasm-runner.mjs:11754 — fd_write has cyclomatic complexity 36 (threshold 15). Of this number, 35 points are the body's own statements and 1 belongs to 17 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: mapHostProcessError (cyclomatic 47) 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 · net.netSocketDispatch (cyclomatic 35) · ×1
  • net.netSocketDispatch (cyclomatic 35) packages/build-tools/bridge-src/builtins/net.ts:1627 — net.netSocketDispatch has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · process.setupGlobals (cyclomatic 35) · ×1
  • process.setupGlobals (cyclomatic 35) packages/build-tools/bridge-src/builtins/process.ts:1117 — process.setupGlobals has cyclomatic complexity 35 (threshold 15). Of this number, 24 points are the body's own statements and 11 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 · registerKernelDelegateFd (cyclomatic 35) · ×1
  • registerKernelDelegateFd (cyclomatic 35) crates/execution/assets/runners/wasm-runner.mjs:2767 — registerKernelDelegateFd has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · routeChunkToFd (cyclomatic 35) · ×1
  • routeChunkToFd (cyclomatic 35) crates/execution/assets/runners/wasm-runner.mjs:3779 — routeChunkToFd 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · PtyManager · ×1
  • PtyManager::read_with_timeout (cyclomatic 34) crates/kernel/src/pty.rs:535 — PtyManager::read_with_timeout has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · http.waitForRawHttpResponse (cyclomatic 34) · ×1
  • http.waitForRawHttpResponse (cyclomatic 34) packages/build-tools/bridge-src/builtins/http.ts:2198 — http.waitForRawHttpResponse has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 2267, 2229, 2294, …). 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 · http.parseLoopbackRequestBuffer (cyclomatic 34) · ×1
  • http.parseLoopbackRequestBuffer (cyclomatic 34) packages/build-tools/bridge-src/builtins/http.ts:2480 — http.parseLoopbackRequestBuffer has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · net_connect (cyclomatic 34) · ×1
  • net_connect (cyclomatic 34) crates/execution/assets/runners/wasm-runner.mjs:5675 — net_connect 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · agentos_shims · ×1
  • agentos_shims::xargs::xargs (cyclomatic 33) toolchain/crates/libs/shims/src/xargs.rs:25 — agentos_shims::xargs::xargs has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · process.readProcessConfig (cyclomatic 33) · ×1
  • process.readProcessConfig (cyclomatic 33) packages/build-tools/bridge-src/builtins/process.ts:22 — process.readProcessConfig 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 · host-functions-zod.validateSchema (cyclomatic 33) · ×1
  • host-functions-zod.validateSchema (cyclomatic 33) packages/runtime-core/src/host-functions-zod.ts:151 — host-functions-zod.validateSchema has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · net_dns_query_rr_v1 (cyclomatic 33) · ×1
  • net_dns_query_rr_v1 (cyclomatic 33) crates/execution/assets/runners/wasm-runner.mjs:5830 — net_dns_query_rr_v1 has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · console.createStdioWriteStream (cyclomatic 32) · ×1
  • console.createStdioWriteStream (cyclomatic 32) packages/build-tools/bridge-src/builtins/console.ts:39 — console.createStdioWriteStream has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 belong to one function item 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 · net.wakePeerBridgeReads (cyclomatic 32) · ×1
  • net.wakePeerBridgeReads (cyclomatic 32) packages/build-tools/bridge-src/builtins/net.ts:279 — net.wakePeerBridgeReads 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 · runtime-driver.handleSyncBridgeOperation (cyclomatic 32) · ×1
  • runtime-driver.handleSyncBridgeOperation (cyclomatic 32) packages/runtime-browser/src/runtime-driver.ts:311 — runtime-driver.handleSyncBridgeOperation has cyclomatic complexity 32 (threshold 15). Of this number, 31 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 · NativeSidecarKernelProxy.createFilesystemView (cyclomatic 32) · ×1
  • NativeSidecarKernelProxy.createFilesystemView (cyclomatic 32) REDACTED:1920 — NativeSidecarKernelProxy.createFilesystemView has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 2031, 2078, 1936, …). 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 · index.compilerRuntimeMain (cyclomatic 32) · ×1
  • index.compilerRuntimeMain (cyclomatic 32) packages/typescript/src/index.ts:616 — index.compilerRuntimeMain has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 9 function items inside it that branch (createSourceProgram, a function literal at line 918, toDiagnosticCategory, …). 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 · net_bind (cyclomatic 32) · ×1
  • net_bind (cyclomatic 32) crates/execution/assets/runners/wasm-runner.mjs:5932 — net_bind 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · cmd_cmp · ×1
  • cmd_cmp::parse_args (cyclomatic 31) software/coreutils/native/crates/cmd-cmp/src/main.rs:79 — cmd_cmp::parse_args has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OwnedPythonSocketService · ×1
  • OwnedPythonSocketService::python_socket_op (cyclomatic 30) crates/native-sidecar/src/execution/python/sockets.rs:470 — OwnedPythonSocketService::python_socket_op 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.
D1 · Cyclomatic Complexity · agentos_jq · ×1
  • agentos_jq::parse_args (cyclomatic 30) software/jq/native/crates/jq/src/lib.rs:47 — agentos_jq::parse_args has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agentos_gzip · ×1
  • agentos_gzip::main (cyclomatic 30) software/gzip/native/crates/gzip/src/lib.rs:20 — agentos_gzip::main has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NetServer._pumpAccepts (cyclomatic 30) · ×1
  • NetServer._pumpAccepts (cyclomatic 30) packages/build-tools/bridge-src/builtins/net.ts:3654 — NetServer._pumpAccepts has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeSidecarKernelProxy.createFilesystemView (cyclomatic 30) · ×1
  • NativeSidecarKernelProxy.createFilesystemView (cyclomatic 30) REDACTED:2504 — NativeSidecarKernelProxy.createFilesystemView has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 2615, 2662, 2520, …). 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 · NativeSidecarKernelProxy.exec (cyclomatic 30) · ×1
  • NativeSidecarKernelProxy.exec (cyclomatic 30) REDACTED:528 — NativeSidecarKernelProxy.exec has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · child-process.encodeAdvancedIpcMessage · ×1
  • child-process.encodeAdvancedIpcMessage::encode (cyclomatic 29) packages/build-tools/bridge-src/builtins/child-process.ts:128 — child-process.encodeAdvancedIpcMessage::encode 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. This is NOT this file's highest cyclomatic complexity: ChildProcess.constructor (cyclomatic 68) 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 · AgentOs._handleSidecarEvent (cyclomatic 29) · ×1
  • AgentOs._handleSidecarEvent (cyclomatic 29) packages/core/src/agent-os.ts:5722 — AgentOs._handleSidecarEvent 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 · process-spawn.bench.main (cyclomatic 29) · ×1
  • process-spawn.bench.main (cyclomatic 29) packages/runtime-benchmarks/src/focused/process-spawn.bench.ts:1031 — process-spawn.bench.main has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · releaseFdHandle (cyclomatic 29) · ×1
  • releaseFdHandle (cyclomatic 29) crates/execution/assets/runners/wasm-runner.mjs:3011 — releaseFdHandle 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · WriteStream.end (cyclomatic 28) · ×1
  • WriteStream.end (cyclomatic 28) REDACTED:1766 — WriteStream.end has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 1789). 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 · fd_sendmsg_rights (cyclomatic 28) · ×1
  • fd_sendmsg_rights (cyclomatic 28) crates/execution/assets/runners/wasm-runner.mjs:8384 — fd_sendmsg_rights 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: mapHostProcessError (cyclomatic 47) 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 · agentos_du · ×1
  • agentos_du::main (cyclomatic 27) software/coreutils/native/crates/du/src/lib.rs:19 — agentos_du::main has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · http.parseChunkedBody (cyclomatic 27) · ×1
  • http.parseChunkedBody (cyclomatic 27) packages/build-tools/bridge-src/builtins/http.ts:2402 — http.parseChunkedBody 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 · http.serializeLoopbackResponse (cyclomatic 27) · ×1
  • http.serializeLoopbackResponse (cyclomatic 27) packages/build-tools/bridge-src/builtins/http.ts:2692 — http.serializeLoopbackResponse 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 · http.dispatchLoopbackServerRequest (cyclomatic 27) · ×1
  • http.dispatchLoopbackServerRequest (cyclomatic 27) packages/build-tools/bridge-src/builtins/http.ts:4005 — http.dispatchLoopbackServerRequest has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · JavascriptExecutionEngine · ×1
  • JavascriptExecutionEngine::create_execution_with_module_reader_and_runtime (cyclomatic 26) crates/execution/src/javascript.rs:2712 — JavascriptExecutionEngine::create_execution_with_module_reader_and_runtime 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. This is NOT this file's highest cyclomatic complexity: agentos_execution::javascript::builtin_named_exports (cyclomatic 41) 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 · VmLimitsConfig · ×1
  • VmLimitsConfig::validate (cyclomatic 26) crates/vm-config/src/lib.rs:981 — VmLimitsConfig::validate 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 · http2.validateHttp2Settings (cyclomatic 26) · ×1
  • http2.validateHttp2Settings (cyclomatic 26) packages/build-tools/bridge-src/builtins/http2.ts:458 — http2.validateHttp2Settings 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 · ServerResponseBridge.end (cyclomatic 26) · ×1
  • ServerResponseBridge.end (cyclomatic 26) packages/build-tools/bridge-src/builtins/http.ts:3212 — ServerResponseBridge.end 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 · worker.initRuntime (cyclomatic 26) · ×1
  • worker.initRuntime (cyclomatic 26) packages/runtime-browser/src/worker.ts:1908 — worker.initRuntime has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 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 2320, randomBytes, loadFileSync, …). 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 · wasm-runner.wasiImport.fd_fdstat_get (cyclomatic 25) · ×1
  • wasm-runner.wasiImport.fd_fdstat_get (cyclomatic 25) crates/execution/assets/runners/wasm-runner.mjs:11311 — wasm-runner.wasiImport.fd_fdstat_get 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. This is NOT this file's highest cyclomatic complexity: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · fs._globCollect (cyclomatic 25) · ×1
  • fs._globCollect (cyclomatic 25) REDACTED:2148 — fs._globCollect 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 2 function items inside it that branch (walk, addResult). 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 · NativeSidecarKernelProxy.spawn (cyclomatic 25) · ×1
  • NativeSidecarKernelProxy.spawn (cyclomatic 25) REDACTED:863 — NativeSidecarKernelProxy.spawn has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 6 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 · pumpChildInputPipe (cyclomatic 25) · ×1
  • pumpChildInputPipe (cyclomatic 25) crates/execution/assets/runners/wasm-runner.mjs:4268 — pumpChildInputPipe has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · child-process.childProcessDispatch (cyclomatic 24) · ×1
  • child-process.childProcessDispatch (cyclomatic 24) packages/build-tools/bridge-src/builtins/child-process.ts:464 — child-process.childProcessDispatch has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ChildProcess.constructor (cyclomatic 68) 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 · AgentOs.create · ×1
  • AgentOs.create::createVmAdmin (cyclomatic 24) packages/core/src/agent-os.ts:3015 — AgentOs.create::createVmAdmin 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 shape REPEATS in the file: one other method here (AgentOs.create) 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. This is NOT this file's highest cyclomatic complexity: agent-os.handleJsBridgeCall (cyclomatic 26) 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 · fd_record_lock (cyclomatic 24) · ×1
  • fd_record_lock (cyclomatic 24) crates/execution/assets/runners/wasm-runner.mjs:8206 — fd_record_lock 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: mapHostProcessError (cyclomatic 47) 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 · JavascriptBenchmarkReport · ×1
  • JavascriptBenchmarkReport::render_markdown_with_comparison (cyclomatic 23) crates/execution/src/benchmark.rs:193 — JavascriptBenchmarkReport::render_markdown_with_comparison 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 · InMemoryMetadataStore · ×1
  • InMemoryMetadataStore::set_attr (cyclomatic 23) crates/vfs/src/engine/mem/metadata_store.rs:490 — InMemoryMetadataStore::set_attr 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 · RawBodyReader · ×1
  • RawBodyReader::read_chunk (cyclomatic 23) toolchain/crates/libs/wasi-http/src/lib.rs:629 — RawBodyReader::read_chunk 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 · wasm-runner.maybeCreateSyntheticCommandResult (cyclomatic 23) · ×1
  • wasm-runner.maybeCreateSyntheticCommandResult (cyclomatic 23) crates/execution/assets/runners/wasm-runner.mjs:4017 — wasm-runner.maybeCreateSyntheticCommandResult 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. This is NOT this file's highest cyclomatic complexity: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · child-process.execSync (cyclomatic 23) · ×1
  • child-process.execSync (cyclomatic 23) packages/build-tools/bridge-src/builtins/child-process.ts:1300 — child-process.execSync 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. This is NOT this file's highest cyclomatic complexity: ChildProcess.constructor (cyclomatic 68) 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 · http.dispatchServerRequest (cyclomatic 23) · ×1
  • http.dispatchServerRequest (cyclomatic 23) packages/build-tools/bridge-src/builtins/http.ts:3828 — http.dispatchServerRequest has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runtime.resolveExportsValue (cyclomatic 23) · ×1
  • runtime.resolveExportsValue (cyclomatic 23) packages/runtime-browser/src/runtime.ts:1023 — runtime.resolveExportsValue has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · protocol-client.resolveProtocolFrameTransport (cyclomatic 23) · ×1
  • protocol-client.resolveProtocolFrameTransport (cyclomatic 23) packages/runtime-core/src/protocol-client.ts:436 — protocol-client.resolveProtocolFrameTransport has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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 · ActiveTcpSocket · ×1
  • ActiveTcpSocket::poll (cyclomatic 22) crates/native-sidecar/src/execution/network/tcp.rs:497 — ActiveTcpSocket::poll 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 · wasm-runner.buildPreopens (cyclomatic 22) · ×1
  • wasm-runner.buildPreopens (cyclomatic 22) crates/execution/assets/runners/wasm-runner.mjs:1187 — wasm-runner.buildPreopens has cyclomatic complexity 22 (threshold 15). 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, separate the cases: extract each independent 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: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · _NetSocket._flushBridgeWrites (cyclomatic 22) · ×1
  • _NetSocket._flushBridgeWrites (cyclomatic 22) packages/build-tools/bridge-src/builtins/net.ts:2174 — _NetSocket._flushBridgeWrites has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 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 · IncomingMessage.constructor (cyclomatic 22) · ×1
  • IncomingMessage.constructor (cyclomatic 22) packages/build-tools/bridge-src/builtins/http.ts:52 — IncomingMessage.constructor has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServerResponseBridge.writeHead (cyclomatic 22) · ×1
  • ServerResponseBridge.writeHead (cyclomatic 22) packages/build-tools/bridge-src/builtins/http.ts:3016 — ServerResponseBridge.writeHead has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 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 · dgram.normalizeDgramSendArgs (cyclomatic 22) · ×1
  • dgram.normalizeDgramSendArgs (cyclomatic 22) packages/build-tools/bridge-src/builtins/dgram.ts:456 — dgram.normalizeDgramSendArgs 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 · rpc-client.parseSimpleExecCommand (cyclomatic 22) · ×1
  • rpc-client.parseSimpleExecCommand (cyclomatic 22) REDACTED:265 — rpc-client.parseSimpleExecCommand 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. This is NOT this file's highest cyclomatic complexity: NativeSidecarKernelProxy.waitForTrackedProcess (cyclomatic 24) 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 · kernel-proxy.parseSimpleExecCommand (cyclomatic 22) · ×1
  • kernel-proxy.parseSimpleExecCommand (cyclomatic 22) REDACTED:154 — kernel-proxy.parseSimpleExecCommand 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 · _fdClose (cyclomatic 22) · ×1
  • _fdClose (cyclomatic 22) crates/execution/assets/runners/wasi-module.js:1866 — _fdClose has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · collectInactivePipeHandles (cyclomatic 22) · ×1
  • collectInactivePipeHandles (cyclomatic 22) crates/execution/assets/runners/wasm-runner.mjs:3160 — collectInactivePipeHandles 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · net_accept (cyclomatic 22) · ×1
  • net_accept (cyclomatic 22) crates/execution/assets/runners/wasm-runner.mjs:6074 — net_accept 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_renumber (cyclomatic 22) · ×1
  • fd_renumber (cyclomatic 22) crates/execution/assets/runners/wasm-runner.mjs:11989 — fd_renumber 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fs.normalizeFsTimeSpec (cyclomatic 21) · ×1
  • fs.normalizeFsTimeSpec (cyclomatic 21) REDACTED:2546 — fs.normalizeFsTimeSpec 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 · child-process.fork (cyclomatic 21) · ×1
  • child-process.fork (cyclomatic 21) packages/build-tools/bridge-src/builtins/child-process.ts:1753 — child-process.fork 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. This is NOT this file's highest cyclomatic complexity: ChildProcess.constructor (cyclomatic 68) 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 · DgramSocket._pumpMessages (cyclomatic 21) · ×1
  • DgramSocket._pumpMessages (cyclomatic 21) packages/build-tools/bridge-src/builtins/dgram.ts:1111 — DgramSocket._pumpMessages has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · undici.createAgentOsUndiciDispatcher (cyclomatic 21) · ×1
  • undici.createAgentOsUndiciDispatcher (cyclomatic 21) packages/build-tools/bridge-src/builtins/undici.ts:14 — undici.createAgentOsUndiciDispatcher has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 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 · event-buffer.sidecarSelectorMatchesEvent (cyclomatic 21) · ×1
  • event-buffer.sidecarSelectorMatchesEvent (cyclomatic 21) packages/runtime-core/src/event-buffer.ts:285 — event-buffer.sidecarSelectorMatchesEvent 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 · _pumpPipeProducers (cyclomatic 21) · ×1
  • _pumpPipeProducers (cyclomatic 21) crates/execution/assets/runners/wasi-module.js:610 — _pumpPipeProducers 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 · installPythonGuestPreloadHardening · ×1
  • installPythonGuestPreloadHardening::restrictedFetch (cyclomatic 21) crates/execution/assets/runners/python-runner.mjs:1576 — installPythonGuestPreloadHardening::restrictedFetch 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 · BridgeCallContext · ×1
  • BridgeCallContext::sync_call_response_with_max_response_bytes (cyclomatic 20) crates/v8-runtime/src/host_call.rs:1238 — BridgeCallContext::sync_call_response_with_max_response_bytes 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 · wasm-runner.parseInitialHostNetFds (cyclomatic 20) · ×1
  • wasm-runner.parseInitialHostNetFds (cyclomatic 20) crates/execution/assets/runners/wasm-runner.mjs:3731 — wasm-runner.parseInitialHostNetFds has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · prelude.cloneStructuredValue (cyclomatic 20) · ×1
  • prelude.cloneStructuredValue (cyclomatic 20) REDACTED:116 — prelude.cloneStructuredValue 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 · fs.bridgeErrorCode (cyclomatic 20) · ×1
  • fs.bridgeErrorCode (cyclomatic 20) REDACTED:2016 — fs.bridgeErrorCode 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 · IncomingMessage.on (cyclomatic 20) · ×1
  • IncomingMessage.on (cyclomatic 20) packages/build-tools/bridge-src/builtins/http.ts:127 — IncomingMessage.on has cyclomatic complexity 20 (threshold 15). Of this number, 10 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 · AgentOs._executionOperation (cyclomatic 20) · ×1
  • AgentOs._executionOperation (cyclomatic 20) packages/core/src/agent-os.ts:3343 — AgentOs._executionOperation has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 4 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. This is NOT this file's highest cyclomatic complexity: agent-os.handleJsBridgeCall (cyclomatic 26) 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 · agent-os.parseHostFunctionArgv (cyclomatic 20) · ×1
  • agent-os.parseHostFunctionArgv (cyclomatic 20) packages/core/src/agent-os.ts:2211 — agent-os.parseHostFunctionArgv 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: agent-os.handleJsBridgeCall (cyclomatic 26) 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 · worker.onmessage (cyclomatic 20) · ×1
  • worker.onmessage (cyclomatic 20) packages/runtime-browser/src/worker.ts:3663 — worker.onmessage 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 · StdioSidecarProtocolClient.dispose (cyclomatic 20) · ×1
  • StdioSidecarProtocolClient.dispose (cyclomatic 20) packages/runtime-core/src/native-client.ts:169 — StdioSidecarProtocolClient.dispose has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · openBlockingGuestFifoForPathOpen (cyclomatic 20) · ×1
  • openBlockingGuestFifoForPathOpen (cyclomatic 20) crates/execution/assets/runners/wasm-runner.mjs:1971 — openBlockingGuestFifoForPathOpen 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: mapHostProcessError (cyclomatic 47) 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 · proc_waitpid (cyclomatic 20) · ×1
  • proc_waitpid (cyclomatic 20) crates/execution/assets/runners/wasm-runner.mjs:7255 — proc_waitpid 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: mapHostProcessError (cyclomatic 47) 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 · fd_filestat_set_size (cyclomatic 20) · ×1
  • fd_filestat_set_size (cyclomatic 20) crates/execution/assets/runners/wasm-runner.mjs:11581 — fd_filestat_set_size 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: mapHostProcessError (cyclomatic 47) 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 · PosixAcl · ×1
  • PosixAcl::validate (cyclomatic 19) crates/kernel/src/kernel.rs:9449 — PosixAcl::validate 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. This is NOT this file's highest cyclomatic complexity: KernelVm::resolve_proc_node (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · VmUserConfig · ×1
  • VmUserConfig::validate (cyclomatic 19) crates/vm-config/src/lib.rs:381 — VmUserConfig::validate 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 · cmd_id · ×1
  • cmd_id::parse_options (cyclomatic 19) software/coreutils/native/crates/cmd-id/src/main.rs:64 — cmd_id::parse_options 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 · agentos_awk · ×1
  • agentos_awk::run_awk (cyclomatic 19) software/gawk/native/crates/awk/src/lib.rs:27 — agentos_awk::run_awk 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 · agentos_strings_cmd · ×1
  • agentos_strings_cmd::main (cyclomatic 19) software/coreutils/native/crates/strings-cmd/src/lib.rs:10 — agentos_strings_cmd::main 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 · WASI._filetypeForStats (cyclomatic 19) · ×1
  • WASI._filetypeForStats (cyclomatic 19) crates/execution/assets/runners/wasi-module.js:720 — WASI._filetypeForStats 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 · ClientRequest._dispatchUndiciRequest (cyclomatic 19) · ×1
  • ClientRequest._dispatchUndiciRequest (cyclomatic 19) packages/build-tools/bridge-src/builtins/http.ts:526 — ClientRequest._dispatchUndiciRequest has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · process.readLiveProcessResourceUsage (cyclomatic 19) · ×1
  • process.readLiveProcessResourceUsage (cyclomatic 19) packages/build-tools/bridge-src/builtins/process.ts:525 — process.readLiveProcessResourceUsage 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 · footprint.details (cyclomatic 19) · ×1
  • footprint.details (cyclomatic 19) scripts/pipboy/src/render/footprint.ts:93 — footprint.details has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc_waitpid_v2 (cyclomatic 19) · ×1
  • proc_waitpid_v2 (cyclomatic 19) crates/execution/assets/runners/wasm-runner.mjs:7339 — proc_waitpid_v2 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_dup_min (cyclomatic 19) · ×1
  • fd_dup_min (cyclomatic 19) crates/execution/assets/runners/wasm-runner.mjs:8022 — fd_dup_min 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_readdir (cyclomatic 19) · ×1
  • fd_readdir (cyclomatic 19) crates/execution/assets/runners/wasm-runner.mjs:10908 — fd_readdir 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_close (cyclomatic 19) · ×1
  • fd_close (cyclomatic 19) crates/execution/assets/runners/wasm-runner.mjs:11902 — fd_close 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: mapHostProcessError (cyclomatic 47) 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 · RoutedExtensionServices · ×1
  • RoutedExtensionServices::poll_process_event (cyclomatic 18) crates/native-sidecar/src/extension_services.rs:1092 — RoutedExtensionServices::poll_process_event 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 · RuntimeConfig · ×1
  • RuntimeConfig::validate (cyclomatic 18) crates/runtime/src/lib.rs:503 — RuntimeConfig::validate has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Url · ×1
  • Url::parse (cyclomatic 18) toolchain/crates/libs/wasi-http/src/lib.rs:69 — Url::parse 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 · agentos_column · ×1
  • agentos_column::main (cyclomatic 18) software/coreutils/native/crates/column/src/lib.rs:6 — agentos_column::main has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · build.build (cyclomatic 18) · ×1
  • build.build (cyclomatic 18) packages/agentos-toolchain/src/build.ts:62 — build.build has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · misc-stubs.getNodeReadableAsyncIterable (cyclomatic 18) · ×1
  • misc-stubs.getNodeReadableAsyncIterable (cyclomatic 18) packages/build-tools/bridge-src/builtins/misc-stubs.ts:196 — misc-stubs.getNodeReadableAsyncIterable has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 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 · builtin-modules.fileURLToPath2 (cyclomatic 18) · ×1
  • builtin-modules.fileURLToPath2 (cyclomatic 18) packages/build-tools/bridge-src/builtins/builtin-modules.ts:584 — builtin-modules.fileURLToPath2 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 · net.normalizeConnectArgs (cyclomatic 18) · ×1
  • net.normalizeConnectArgs (cyclomatic 18) packages/build-tools/bridge-src/builtins/net.ts:617 — net.normalizeConnectArgs 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 · net.buildSerializedTlsOptions (cyclomatic 18) · ×1
  • net.buildSerializedTlsOptions (cyclomatic 18) packages/build-tools/bridge-src/builtins/net.ts:1074 — net.buildSerializedTlsOptions 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 · http2.pollRetainedHttp2Handle · ×1
  • http2.pollRetainedHttp2Handle::tick (cyclomatic 18) packages/build-tools/bridge-src/builtins/http2.ts:2286 — http2.pollRetainedHttp2Handle::tick 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 · ClientRequest._dispatchRawSocketRequest (cyclomatic 18) · ×1
  • ClientRequest._dispatchRawSocketRequest (cyclomatic 18) packages/build-tools/bridge-src/builtins/http.ts:587 — ClientRequest._dispatchRawSocketRequest has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · worker.applyTimingMitigation (cyclomatic 18) · ×1
  • worker.applyTimingMitigation (cyclomatic 18) packages/runtime-browser/src/worker.ts:259 — worker.applyTimingMitigation has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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 · footprint.compareRoot (cyclomatic 18) · ×1
  • footprint.compareRoot (cyclomatic 18) scripts/pipboy/src/compare/footprint.ts:110 — footprint.compareRoot 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 · version.bumpPackageJsons (cyclomatic 18) · ×1
  • version.bumpPackageJsons (cyclomatic 18) scripts/publish/src/lib/version.ts:126 — version.bumpPackageJsons 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 · _fdReaddir (cyclomatic 18) · ×1
  • _fdReaddir (cyclomatic 18) crates/execution/assets/runners/wasi-module.js:2118 — _fdReaddir has cyclomatic complexity 18 (threshold 15). Of this number, 16 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 · ActiveTcpListener · ×1
  • ActiveTcpListener::poll (cyclomatic 17) crates/native-sidecar/src/execution/network/tcp.rs:1767 — ActiveTcpListener::poll 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 · PreparedDisposeVm · ×1
  • PreparedDisposeVm::execute (cyclomatic 17) crates/native-sidecar/src/vm.rs:1991 — PreparedDisposeVm::execute 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 · ChunkedFs · ×1
  • ChunkedFs::write_chunked_range (cyclomatic 17) crates/vfs/src/engine/engines/chunked.rs:302 — ChunkedFs::write_chunked_range 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 · cmd_findmnt · ×1
  • cmd_findmnt::parse_args (cyclomatic 17) software/coreutils/native/crates/cmd-findmnt/src/main.rs:97 — cmd_findmnt::parse_args has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · wasm-runner.parseInitialKernelFdMappings (cyclomatic 17) · ×1
  • wasm-runner.parseInitialKernelFdMappings (cyclomatic 17) crates/execution/assets/runners/wasm-runner.mjs:180 — wasm-runner.parseInitialKernelFdMappings 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: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · wasm-runner.pollHostNetSocket (cyclomatic 17) · ×1
  • wasm-runner.pollHostNetSocket (cyclomatic 17) crates/execution/assets/runners/wasm-runner.mjs:4799 — wasm-runner.pollHostNetSocket 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 is NOT this file's highest cyclomatic complexity: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · wasm-runner.hostNetSockoptKind (cyclomatic 17) · ×1
  • wasm-runner.hostNetSockoptKind (cyclomatic 17) crates/execution/assets/runners/wasm-runner.mjs:5039 — wasm-runner.hostNetSockoptKind 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: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · prelude.installBase64UrlBufferEncoding (cyclomatic 17) · ×1
  • prelude.installBase64UrlBufferEncoding (cyclomatic 17) REDACTED:43 — prelude.installBase64UrlBufferEncoding has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · crypto.createBuiltinHash.digest (cyclomatic 17) · ×1
  • crypto.createBuiltinHash.digest (cyclomatic 17) packages/build-tools/bridge-src/builtins/crypto.ts:477 — crypto.createBuiltinHash.digest 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 · fs.normalizeStreamStartEnd (cyclomatic 17) · ×1
  • fs.normalizeStreamStartEnd (cyclomatic 17) REDACTED:1224 — fs.normalizeStreamStartEnd 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 · stdin.stdinDispatch (cyclomatic 17) · ×1
  • stdin.stdinDispatch (cyclomatic 17) packages/build-tools/bridge-src/builtins/stdin.ts:230 — stdin.stdinDispatch 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 · module-loader.requireFrom (cyclomatic 17) · ×1
  • module-loader.requireFrom (cyclomatic 17) packages/build-tools/bridge-src/builtins/module-loader.ts:320 — module-loader.requireFrom 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 · net-tcp-event-floor.bench.runEcho (cyclomatic 17) · ×1
  • net-tcp-event-floor.bench.runEcho (cyclomatic 17) packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:605 — net-tcp-event-floor.bench.runEcho 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 6 function literals inside it that branch (lines 634, 669, 620, …). 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 · net-tcp-event-floor.bench.classifySummary (cyclomatic 17) · ×1
  • net-tcp-event-floor.bench.classifySummary (cyclomatic 17) packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:784 — net-tcp-event-floor.bench.classifySummary 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 · wasi-ls-scaling.bench.runCase (cyclomatic 17) · ×1
  • wasi-ls-scaling.bench.runCase (cyclomatic 17) packages/runtime-benchmarks/src/focused/wasi-ls-scaling.bench.ts:308 — wasi-ls-scaling.bench.runCase 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 · processChildEvent (cyclomatic 17) · ×1
  • processChildEvent (cyclomatic 17) crates/execution/assets/runners/wasm-runner.mjs:4191 — processChildEvent 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: mapHostProcessError (cyclomatic 47) 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 · fd_flock (cyclomatic 17) · ×1
  • fd_flock (cyclomatic 17) crates/execution/assets/runners/wasm-runner.mjs:8145 — fd_flock 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: mapHostProcessError (cyclomatic 47) 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 · SocketTable · ×1
  • SocketTable::poll (cyclomatic 16) crates/kernel/src/socket_table.rs:2047 — SocketTable::poll 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 · MountTable · ×1
  • MountTable::realpath (cyclomatic 16) crates/vfs/src/posix/mount_table.rs:2203 — MountTable::realpath 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 · SqliteMetadataStore · ×1
  • SqliteMetadataStore::persist_commit_write (cyclomatic 16) crates/vfs-store/src/local/sqlite_metadata_store.rs:346 — SqliteMetadataStore::persist_commit_write 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 · python-runner.installPythonGuestPreloadHardening (cyclomatic 16) · ×1
  • python-runner.installPythonGuestPreloadHardening (cyclomatic 16) crates/execution/assets/runners/python-runner.mjs:1568 — python-runner.installPythonGuestPreloadHardening has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (restrictedFetch). 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 · WASI._resolveDescriptorDirectStatPath (cyclomatic 16) · ×1
  • WASI._resolveDescriptorDirectStatPath (cyclomatic 16) crates/execution/assets/runners/wasi-module.js:1297 — WASI._resolveDescriptorDirectStatPath 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 · wasm-runner.receiveHostNetDatagramEvent (cyclomatic 16) · ×1
  • wasm-runner.receiveHostNetDatagramEvent (cyclomatic 16) crates/execution/assets/runners/wasm-runner.mjs:5158 — wasm-runner.receiveHostNetDatagramEvent 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: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · wasm-runner.wasiImport.fd_pwrite (cyclomatic 16) · ×1
  • wasm-runner.wasiImport.fd_pwrite (cyclomatic 16) crates/execution/assets/runners/wasm-runner.mjs:11086 — wasm-runner.wasiImport.fd_pwrite 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: wasm-runner.mapHostProcessError (cyclomatic 46) 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 · aospkg.parseTarMembers (cyclomatic 16) · ×1
  • aospkg.parseTarMembers (cyclomatic 16) packages/agentos-toolchain/src/aospkg.ts:380 — aospkg.parseTarMembers 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 · header.detectExecutableKind (cyclomatic 16) · ×1
  • header.detectExecutableKind (cyclomatic 16) packages/agentos-toolchain/src/header.ts:25 — header.detectExecutableKind 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 · builtin-modules.bufferIsUtf8 (cyclomatic 16) · ×1
  • builtin-modules.bufferIsUtf8 (cyclomatic 16) packages/build-tools/bridge-src/builtins/builtin-modules.ts:180 — builtin-modules.bufferIsUtf8 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 · crypto.normalizeDirectCryptoKeyInput (cyclomatic 16) · ×1
  • crypto.normalizeDirectCryptoKeyInput (cyclomatic 16) packages/build-tools/bridge-src/builtins/crypto.ts:642 — crypto.normalizeDirectCryptoKeyInput 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 · ReadStream._readNextChunk (cyclomatic 16) · ×1
  • ReadStream._readNextChunk (cyclomatic 16) REDACTED:1395 — ReadStream._readNextChunk has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function item 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 · fs.normalizeWriteSyncArgs (cyclomatic 16) · ×1
  • fs.normalizeWriteSyncArgs (cyclomatic 16) REDACTED:1115 — fs.normalizeWriteSyncArgs 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 · http.attachHttpServerSocket · ×1
  • http.attachHttpServerSocket::processRequests (cyclomatic 16) packages/build-tools/bridge-src/builtins/http.ts:4259 — http.attachHttpServerSocket::processRequests 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 · AgentOs.create (cyclomatic 16) · ×1
  • AgentOs.create (cyclomatic 16) packages/core/src/agent-os.ts:2935 — AgentOs.create 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 shape REPEATS in the file: one other method here (AgentOs.create::createVmAdmin) 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. This is NOT this file's highest cyclomatic complexity: agent-os.handleJsBridgeCall (cyclomatic 26) 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 · BrowserRuntimeDriver.handleWorkerMessage (cyclomatic 16) · ×1
  • BrowserRuntimeDriver.handleWorkerMessage (cyclomatic 16) packages/runtime-browser/src/runtime-driver.ts:629 — BrowserRuntimeDriver.handleWorkerMessage 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 · worker.execScript (cyclomatic 16) · ×1
  • worker.execScript (cyclomatic 16) packages/runtime-browser/src/worker.ts:3497 — worker.execScript has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 3518). 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 · NativeSidecarKernelProxy.spawn (cyclomatic 16) · ×1
  • NativeSidecarKernelProxy.spawn (cyclomatic 16) REDACTED:685 — NativeSidecarKernelProxy.spawn has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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 · resolve.resolveSide (cyclomatic 16) · ×1
  • resolve.resolveSide (cyclomatic 16) scripts/pipboy/src/footprint/resolve.ts:57 — resolve.resolveSide has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 5 function literals inside it that branch. 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.
D1 · Cyclomatic Complexity · _flushPipeConsumers (cyclomatic 16) · ×1
  • _flushPipeConsumers (cyclomatic 16) crates/execution/assets/runners/wasi-module.js:531 — _flushPipeConsumers 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 · net_close (cyclomatic 16) · ×1
  • net_close (cyclomatic 16) crates/execution/assets/runners/wasm-runner.mjs:6527 — net_close has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 6 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. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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 · fd_pread (cyclomatic 16) · ×1
  • fd_pread (cyclomatic 16) crates/execution/assets/runners/wasm-runner.mjs:10992 — fd_pread has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: mapHostProcessError (cyclomatic 47) 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.
D10 · Test Quality · Skipped test · ×1
  • Skipped test: ${String(name)} [missing Google Drive credentials] packages/core/tests/google-drive-backend.test.ts:46 — Skipped — switched off by it.skip
D2 · Cognitive Complexity · net_poll (cognitive 227) · ×1
  • net_poll (cognitive 227) crates/execution/assets/runners/wasm-runner.mjs:5344 — net_poll has cognitive complexity 227 (threshold 15). Drivers by points: if/else 47 (155 pts), ternaries 12 (36 pts), boolean chains 24, loops 4 (8 pts), error handling 2 (4 pts) (nesting depth added 138). 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 · _pollOneoff (cognitive 139) · ×1
  • _pollOneoff (cognitive 139) crates/execution/assets/runners/wasi-module.js:2495 — _pollOneoff has cognitive complexity 139 (threshold 15). Drivers by points: if/else 26 (64 pts), ternaries 12 (32 pts), boolean chains 28, loops 6 (10 pts), error handling 2 (4 pts), other 1 (nesting depth added 64). Of this number, 134 points are the body's own statements and 5 belong to 7 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 · _NetSocket._pumpBridgeReads (cognitive 115) · ×1
  • _NetSocket._pumpBridgeReads (cognitive 115) packages/build-tools/bridge-src/builtins/net.ts:2735 — _NetSocket._pumpBridgeReads has cognitive complexity 115 (threshold 15). Drivers by points: if/else 45 (89 pts), ternaries 5 (13 pts), boolean chains 12, loops 1 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fd_read (cognitive 107) · ×1
  • fd_read (cognitive 107) crates/execution/assets/runners/wasm-runner.mjs:10639 — fd_read has cognitive complexity 107 (threshold 15). Drivers by points: if/else 24 (52 pts), error handling 6 (14 pts), loops 6 (13 pts), boolean chains 11, ternaries 5 (11 pts), other 6 (nesting depth added 49). Of this number, 78 points are the body's own statements and 29 belong to 22 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 · _fdRead (cognitive 103) · ×1
  • _fdRead (cognitive 103) crates/execution/assets/runners/wasi-module.js:1677 — _fdRead has cognitive complexity 103 (threshold 15). Drivers by points: if/else 22 (50 pts), ternaries 10 (24 pts), boolean chains 18, loops 2 (5 pts), error handling 2 (4 pts), other 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · net-tcp-event-floor.bench.deriveGuestBridgeTrace (cognitive 102) · ×1
  • net-tcp-event-floor.bench.deriveGuestBridgeTrace (cognitive 102) packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:831 — net-tcp-event-floor.bench.deriveGuestBridgeTrace has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 100, boolean chains 1, if/else 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 · poll_oneoff (cognitive 102) · ×1
  • poll_oneoff (cognitive 102) crates/execution/assets/runners/wasm-runner.mjs:12064 — poll_oneoff has cognitive complexity 102 (threshold 15). Drivers by points: if/else 31 (57 pts), ternaries 19 (43 pts), boolean chains 24, loops 6 (8 pts), error handling 1, other 1 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeSidecarKernelProxy.openShell (cognitive 100) · ×1
  • NativeSidecarKernelProxy.openShell (cognitive 100) REDACTED:1021 — NativeSidecarKernelProxy.openShell has cognitive complexity 100 (threshold 15). Drivers by points: if/else 36 (58 pts), loops 12 (16 pts), boolean chains 13, ternaries 8 (13 pts) (nesting depth added 31). Of this number, 46 points are the body's own statements and 54 belong to 17 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 · wasm-runner.decodeSpawnActions (cognitive 97) · ×1
  • wasm-runner.decodeSpawnActions (cognitive 97) crates/execution/assets/runners/wasm-runner.mjs:1614 — wasm-runner.decodeSpawnActions has cognitive complexity 97 (threshold 15). Drivers by points: if/else 32 (79 pts), loops 4 (8 pts), boolean chains 7, ternaries 1 (3 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch 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.createBrowserProcess (cognitive 94) · ×1
  • worker.createBrowserProcess (cognitive 94) packages/runtime-browser/src/worker.ts:2630 — worker.createBrowserProcess has cognitive complexity 94 (threshold 15). Drivers by points: if/else 52 (55 pts), boolean chains 17, ternaries 11 (12 pts), loops 10 (nesting depth added 4). Of this number, 38 points are the body's own statements and 56 belong to 26 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 · NativeSidecarKernelProxy.openShell (cognitive 84) · ×1
  • NativeSidecarKernelProxy.openShell (cognitive 84) REDACTED:813 — NativeSidecarKernelProxy.openShell has cognitive complexity 84 (threshold 15). Drivers by points: if/else 30 (47 pts), loops 11 (15 pts), boolean chains 12, ternaries 5 (10 pts) (nesting depth added 26). Of this number, 46 points are the body's own statements and 38 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 · net_recv (cognitive 84) · ×1
  • net_recv (cognitive 84) crates/execution/assets/runners/wasm-runner.mjs:6238 — net_recv has cognitive complexity 84 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 11, ternaries 6 (11 pts), error handling 2 (3 pts), loops 1, other 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _fdWrite (cognitive 80) · ×1
  • _fdWrite (cognitive 80) crates/execution/assets/runners/wasi-module.js:1404 — _fdWrite has cognitive complexity 80 (threshold 15). Drivers by points: if/else 21 (32 pts), ternaries 9 (20 pts), boolean chains 17, other 10, error handling 1 (nesting depth added 22). Of this number, 71 points are the body's own statements and 9 belong to 25 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 · installPythonWorkspaceFs (cognitive 77) · ×1
  • installPythonWorkspaceFs (cognitive 77) crates/execution/assets/runners/python-runner.mjs:1674 — installPythonWorkspaceFs has cognitive complexity 77 (threshold 15). Drivers by points: if/else 41 (47 pts), boolean chains 12, error handling 5 (7 pts), other 5, ternaries 4, loops 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 60 belong to 48 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 · fd_recvmsg_rights (cognitive 77) · ×1
  • fd_recvmsg_rights (cognitive 77) crates/execution/assets/runners/wasm-runner.mjs:8466 — fd_recvmsg_rights has cognitive complexity 77 (threshold 15). Drivers by points: if/else 17 (41 pts), other 11, loops 5 (8 pts), boolean chains 7, ternaries 6 (7 pts), error handling 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readdir.bench.main (cognitive 76) · ×1
  • readdir.bench.main (cognitive 76) packages/runtime-benchmarks/src/focused/readdir.bench.ts:511 — readdir.bench.main has cognitive complexity 76 (threshold 15). Drivers by points: loops 12 (30 pts), if/else 6 (26 pts), ternaries 11 (13 pts), boolean chains 7 (nesting depth added 40). Of this number, 60 points are the body's own statements and 16 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 · AgentOs._handleSidecarEvent (cognitive 75) · ×1
  • AgentOs._handleSidecarEvent (cognitive 75) packages/core/src/agent-os.ts:5722 — AgentOs._handleSidecarEvent has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 5 (21 pts), error handling 4 (18 pts), loops 6 (18 pts), if/else 9 (15 pts), boolean chains 3 (nesting depth added 48). 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 · proc_waitpid_v3 (cognitive 72) · ×1
  • proc_waitpid_v3 (cognitive 72) crates/execution/assets/runners/wasm-runner.mjs:7469 — proc_waitpid_v3 has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (56 pts), boolean chains 8, ternaries 3 (4 pts), loops 2 (3 pts), error handling 1 (nesting depth added 36). Of this number, 69 points are the body's own statements and 3 belong to 6 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 · net.wakeSocketBridgeReads (cognitive 71) · ×1
  • net.wakeSocketBridgeReads (cognitive 71) packages/build-tools/bridge-src/builtins/net.ts:141 — net.wakeSocketBridgeReads has cognitive complexity 71 (threshold 15). Drivers by points: if/else 28 (65 pts), boolean chains 5, ternaries 1 (nesting depth added 37). Of this number, 27 points are the body's own statements and 44 belong 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 · http2.http2Dispatch (cognitive 71) · ×1
  • http2.http2Dispatch (cognitive 71) packages/build-tools/bridge-src/builtins/http2.ts:1994 — http2.http2Dispatch has cognitive complexity 71 (threshold 15). Drivers by points: if/else 45 (64 pts), boolean chains 5, ternaries 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.
D2 · Cognitive Complexity · child-process.routeChildProcessEvent (cognitive 68) · ×1
  • child-process.routeChildProcessEvent (cognitive 68) packages/build-tools/bridge-src/builtins/child-process.ts:333 — child-process.routeChildProcessEvent has cognitive complexity 68 (threshold 15). Drivers by points: if/else 21 (43 pts), ternaries 5 (11 pts), boolean chains 8, loops 2 (6 pts) (nesting depth added 32). Of this number, 45 points are the body's own statements and 23 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.parseChunkedBody (cognitive 63) · ×1
  • http.parseChunkedBody (cognitive 63) packages/build-tools/bridge-src/builtins/http.ts:2402 — http.parseChunkedBody has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (45 pts), ternaries 2 (7 pts), boolean chains 6, loops 2 (5 pts) (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.
D2 · Cognitive Complexity · path_open (cognitive 60) · ×1
  • path_open (cognitive 60) crates/execution/assets/runners/wasm-runner.mjs:10082 — path_open has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 10, error handling 4 (8 pts), other 5, ternaries 2 (3 pts) (nesting depth added 17). Of this number, 56 points are the body's own statements and 4 belong to 10 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 · version.bumpPackageJsons (cognitive 58) · ×1
  • version.bumpPackageJsons (cognitive 58) scripts/publish/src/lib/version.ts:126 — version.bumpPackageJsons has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (43 pts), loops 4 (12 pts), boolean chains 3 (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 · wasm-runner.readHostNetSocketToGuestIovs (cognitive 54) · ×1
  • wasm-runner.readHostNetSocketToGuestIovs (cognitive 54) crates/execution/assets/runners/wasm-runner.mjs:3384 — wasm-runner.readHostNetSocketToGuestIovs has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 8, ternaries 3 (5 pts), error handling 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · builtin-modules.loadBuiltinModule (cognitive 54) · ×1
  • builtin-modules.loadBuiltinModule (cognitive 54) packages/build-tools/bridge-src/builtins/builtin-modules.ts:698 — builtin-modules.loadBuiltinModule has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 3 (6 pts), boolean chains 5, match/switch 1 (nesting depth added 24). Of this number, 23 points are the body's own statements and 31 belong to 7 function items 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 · net.normalizeListenArgs (cognitive 54) · ×1
  • net.normalizeListenArgs (cognitive 54) packages/build-tools/bridge-src/builtins/net.ts:483 — net.normalizeListenArgs has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 13 (29 pts), if/else 9 (15 pts), boolean chains 10 (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 · net_connect (cognitive 54) · ×1
  • net_connect (cognitive 54) crates/execution/assets/runners/wasm-runner.mjs:5675 — net_connect has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 4, error handling 2 (4 pts), other 3, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WriteStream.end (cognitive 51) · ×1
  • WriteStream.end (cognitive 51) REDACTED:1766 — WriteStream.end has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 6, loops 2 (6 pts), ternaries 2 (5 pts), error handling 1 (nesting depth added 21). Most of this is not in the body itself: 10 of the 51 points are its own statements and the rest belongs to one function literal inside it that branches (line 1789). 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 · fd_write (cognitive 51) · ×1
  • fd_write (cognitive 51) crates/execution/assets/runners/wasm-runner.mjs:11754 — fd_write has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (24 pts), error handling 5 (11 pts), boolean chains 7, ternaries 4 (6 pts), other 3 (nesting depth added 16). Of this number, 49 points are the body's own statements and 2 belong to 17 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 · ServerResponseBridge.writeHead (cognitive 50) · ×1
  • ServerResponseBridge.writeHead (cognitive 50) packages/build-tools/bridge-src/builtins/http.ts:3016 — ServerResponseBridge.writeHead has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 2 (7 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 28). Of this number, 37 points are the body's own statements and 13 belong 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 · ActiveTcpSocket · ×1
  • ActiveTcpSocket::poll (cognitive 49) crates/native-sidecar/src/execution/network/tcp.rs:497 — ActiveTcpSocket::poll has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (43 pts), match/switch 3 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentos_gzip · ×1
  • agentos_gzip::main (cognitive 49) software/gzip/native/crates/gzip/src/lib.rs:20 — agentos_gzip::main has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (35 pts), loops 3 (6 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · child-process.spawn (cognitive 49) · ×1
  • child-process.spawn (cognitive 49) packages/build-tools/bridge-src/builtins/child-process.ts:1361 — child-process.spawn has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 18, if/else 11 (18 pts), ternaries 4 (8 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 13). Of this number, 45 points are the body's own statements and 4 belong to 6 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 · child-process.spawnSync (cognitive 49) · ×1
  • child-process.spawnSync (cognitive 49) packages/build-tools/bridge-src/builtins/child-process.ts:1535 — child-process.spawnSync has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 15 (22 pts), boolean chains 17, if/else 8 (9 pts), error handling 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 · proc_spawn_v2 (cognitive 49) · ×1
  • proc_spawn_v2 (cognitive 49) crates/execution/assets/runners/wasm-runner.mjs:6842 — proc_spawn_v2 has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 19 (20 pts), other 12, if/else 9 (11 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 3). Of this number, 48 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · net.netSocketDispatch (cognitive 48) · ×1
  • net.netSocketDispatch (cognitive 48) packages/build-tools/bridge-src/builtins/net.ts:1627 — net.netSocketDispatch has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (33 pts), ternaries 3 (6 pts), error handling 2 (5 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · NetServer._pumpAccepts (cognitive 46) · ×1
  • NetServer._pumpAccepts (cognitive 46) packages/build-tools/bridge-src/builtins/net.ts:3654 — NetServer._pumpAccepts has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 8, ternaries 3 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VmLimitsConfig · ×1
  • VmLimitsConfig::validate (cognitive 44) crates/vm-config/src/lib.rs:981 — VmLimitsConfig::validate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 3 (6 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 · child-process.decodeAdvancedIpcMessage (cognitive 44) · ×1
  • child-process.decodeAdvancedIpcMessage (cognitive 44) packages/build-tools/bridge-src/builtins/child-process.ts:194 — child-process.decodeAdvancedIpcMessage has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 5 (13 pts), boolean chains 8, ternaries 4 (8 pts), match/switch 2 (nesting depth added 15). Of this number, 22 points are the body's own statements and 22 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routeChunkToFd (cognitive 44) · ×1
  • routeChunkToFd (cognitive 44) crates/execution/assets/runners/wasm-runner.mjs:3779 — routeChunkToFd has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (27 pts), other 10, boolean chains 4, loops 1 (2 pts), ternaries 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 · net_bind (cognitive 44) · ×1
  • net_bind (cognitive 44) crates/execution/assets/runners/wasm-runner.mjs:5932 — net_bind has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 10, other 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fd_dup2 (cognitive 43) · ×1
  • fd_dup2 (cognitive 43) crates/execution/assets/runners/wasm-runner.mjs:7886 — fd_dup2 has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 9, ternaries 2 (5 pts), other 4, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rpc-client.parseSimpleExecCommand (cognitive 42) · ×1
  • rpc-client.parseSimpleExecCommand (cognitive 42) REDACTED:265 — rpc-client.parseSimpleExecCommand has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 3, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · host-functions-zod.validateSchema (cognitive 42) · ×1
  • host-functions-zod.validateSchema (cognitive 42) packages/runtime-core/src/host-functions-zod.ts:151 — host-functions-zod.validateSchema has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 3 (7 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kernel-proxy.parseSimpleExecCommand (cognitive 42) · ×1
  • kernel-proxy.parseSimpleExecCommand (cognitive 42) REDACTED:154 — kernel-proxy.parseSimpleExecCommand has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 3, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.waitForRawHttpResponse (cognitive 41) · ×1
  • http.waitForRawHttpResponse (cognitive 41) packages/build-tools/bridge-src/builtins/http.ts:2198 — http.waitForRawHttpResponse has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (28 pts), ternaries 4 (7 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 10). None of this is in the body itself: all 41 points belong to 7 function literals inside it that branch (lines 2294, 2229, 2267, …). 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 · http.parseLoopbackRequestBuffer (cognitive 41) · ×1
  • http.parseLoopbackRequestBuffer (cognitive 41) packages/build-tools/bridge-src/builtins/http.ts:2480 — http.parseLoopbackRequestBuffer has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 7, ternaries 4 (6 pts), loops 2, error handling 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 · runtime.resolveExportsValue (cognitive 41) · ×1
  • runtime.resolveExportsValue (cognitive 41) packages/runtime-browser/src/runtime.ts:1023 — runtime.resolveExportsValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 19). Of this number, 40 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 · JavascriptExecutionEngine · ×1
  • JavascriptExecutionEngine::create_execution_with_module_reader_and_runtime (cognitive 39) crates/execution/src/javascript.rs:2712 — JavascriptExecutionEngine::create_execution_with_module_reader_and_runtime has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27 (32 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RoutedExtensionServices · ×1
  • RoutedExtensionServices::poll_process_event (cognitive 39) crates/native-sidecar/src/extension_services.rs:1092 — RoutedExtensionServices::poll_process_event has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 5 (17 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawBodyReader · ×1
  • RawBodyReader::read_chunk (cognitive 39) toolchain/crates/libs/wasi-http/src/lib.rs:629 — RawBodyReader::read_chunk has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (6 pts), match/switch 5 (6 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 · ServerResponseBridge.end (cognitive 39) · ×1
  • ServerResponseBridge.end (cognitive 39) packages/build-tools/bridge-src/builtins/http.ts:3212 — ServerResponseBridge.end has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 3 (10 pts), loops 2 (7 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fd_record_lock (cognitive 39) · ×1
  • fd_record_lock (cognitive 39) crates/execution/assets/runners/wasm-runner.mjs:8206 — fd_record_lock has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, error handling 3 (6 pts), loops 2, ternaries 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 · _pathOpen (cognitive 38) · ×1
  • _pathOpen (cognitive 38) crates/execution/assets/runners/wasi-module.js:2265 — _pathOpen has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11, boolean chains 10, other 10, ternaries 6, error handling 1. Of this number, 35 points are the body's own statements and 3 belong to 6 function literals 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 · http.serializeLoopbackResponse (cognitive 37) · ×1
  • http.serializeLoopbackResponse (cognitive 37) packages/build-tools/bridge-src/builtins/http.ts:2692 — http.serializeLoopbackResponse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 6, loops 2 (5 pts), ternaries 4 (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.
D2 · Cognitive Complexity · process-spawn.bench.main (cognitive 37) · ×1
  • process-spawn.bench.main (cognitive 37) packages/runtime-benchmarks/src/focused/process-spawn.bench.ts:1031 — process-spawn.bench.main has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23, ternaries 9 (10 pts), boolean chains 4 (nesting depth added 1). Of this number, 35 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · console.createStdioWriteStream (cognitive 36) · ×1
  • console.createStdioWriteStream (cognitive 36) packages/build-tools/bridge-src/builtins/console.ts:39 — console.createStdioWriteStream has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 8, loops 2 (4 pts), ternaries 1 (nesting depth added 4). Of this number, 30 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · http2.validateHttp2Settings (cognitive 36) · ×1
  • http2.validateHttp2Settings (cognitive 36) packages/build-tools/bridge-src/builtins/http2.ts:458 — http2.validateHttp2Settings has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · agent-os.parseHostFunctionArgv (cognitive 36) · ×1
  • agent-os.parseHostFunctionArgv (cognitive 36) packages/core/src/agent-os.ts:2211 — agent-os.parseHostFunctionArgv has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 4 (9 pts), loops 3, boolean chains 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.
D2 · Cognitive Complexity · NativeSidecarKernelProxy.runEventPump (cognitive 36) · ×1
  • NativeSidecarKernelProxy.runEventPump (cognitive 36) REDACTED:1628 — NativeSidecarKernelProxy.runEventPump has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (11 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · maybeCreateSyntheticCommandResult (cognitive 36) · ×1
  • maybeCreateSyntheticCommandResult (cognitive 36) crates/execution/assets/runners/wasm-runner.mjs:4017 — maybeCreateSyntheticCommandResult has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 9, error handling 2 (5 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc_waitpid (cognitive 36) · ×1
  • proc_waitpid (cognitive 36) crates/execution/assets/runners/wasm-runner.mjs:7255 — proc_waitpid has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (27 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 1, error handling 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 · OwnedPythonSocketService · ×1
  • OwnedPythonSocketService::python_socket_op (cognitive 35) crates/native-sidecar/src/execution/python/sockets.rs:470 — OwnedPythonSocketService::python_socket_op has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 8 (13 pts), boolean chains 2 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · agentos_awk · ×1
  • agentos_awk::run_awk (cognitive 35) software/gawk/native/crates/awk/src/lib.rs:27 — agentos_awk::run_awk has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (30 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · child-process.childProcessDispatch (cognitive 35) · ×1
  • child-process.childProcessDispatch (cognitive 35) packages/build-tools/bridge-src/builtins/child-process.ts:464 — child-process.childProcessDispatch has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 10 (11 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 14). Of this number, 30 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 · net_dns_query_rr_v1 (cognitive 35) · ×1
  • net_dns_query_rr_v1 (cognitive 35) crates/execution/assets/runners/wasm-runner.mjs:5830 — net_dns_query_rr_v1 has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 9, ternaries 6 (8 pts), loops 2, error handling 1, other 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · NativeSidecarKernelProxy.createFilesystemView (cognitive 34) · ×1
  • NativeSidecarKernelProxy.createFilesystemView (cognitive 34) REDACTED:1920 — NativeSidecarKernelProxy.createFilesystemView has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 13, boolean chains 2, error handling 1 (nesting depth added 3). None of this is in the body itself: all 34 points belong to 11 function literals inside it that branch (lines 2031, 2078, 1936, …). 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 · fd_filestat_set_size (cognitive 34) · ×1
  • fd_filestat_set_size (cognitive 34) crates/execution/assets/runners/wasm-runner.mjs:11581 — fd_filestat_set_size has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 4 (10 pts), other 3, ternaries 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.
D2 · Cognitive Complexity · BridgeCallContext · ×1
  • BridgeCallContext::sync_call_response_with_max_response_bytes (cognitive 33) crates/v8-runtime/src/host_call.rs:1238 — BridgeCallContext::sync_call_response_with_max_response_bytes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 4 (9 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · python-runner.readProgramFromStdin (cognitive 33) · ×1
  • python-runner.readProgramFromStdin (cognitive 33) crates/execution/assets/runners/python-runner.mjs:2184 — python-runner.readProgramFromStdin has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), ternaries 2 (6 pts), error handling 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.
D2 · Cognitive Complexity · aospkg.parseTarMembers (cognitive 33) · ×1
  • aospkg.parseTarMembers (cognitive 33) packages/agentos-toolchain/src/aospkg.ts:380 — aospkg.parseTarMembers has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · net.wakePeerBridgeReads (cognitive 33) · ×1
  • net.wakePeerBridgeReads (cognitive 33) packages/build-tools/bridge-src/builtins/net.ts:279 — net.wakePeerBridgeReads has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 10, ternaries 4 (6 pts), loops 2 (3 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 · releaseFdHandle (cognitive 33) · ×1
  • releaseFdHandle (cognitive 33) crates/execution/assets/runners/wasm-runner.mjs:3011 — releaseFdHandle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 6, error handling 1 (3 pts), other 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 · proc_waitpid_v2 (cognitive 33) · ×1
  • proc_waitpid_v2 (cognitive 33) crates/execution/assets/runners/wasm-runner.mjs:7339 — proc_waitpid_v2 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JavascriptBenchmarkReport · ×1
  • JavascriptBenchmarkReport::render_markdown_with_comparison (cognitive 32) crates/execution/src/benchmark.rs:193 — JavascriptBenchmarkReport::render_markdown_with_comparison has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 9 (11 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 · MemoryFileSystem · ×1
  • MemoryFileSystem::resolve_path_with_options (cognitive 32) crates/vfs/src/posix/vfs.rs:945 — MemoryFileSystem::resolve_path_with_options has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 2, loops 1 (nesting depth added 17). 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 · process.readProcessConfig (cognitive 32) · ×1
  • process.readProcessConfig (cognitive 32) packages/build-tools/bridge-src/builtins/process.ts:22 — process.readProcessConfig has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 27, ternaries 3, error handling 1, if/else 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 · NativeSidecarKernelProxy.runEventPump (cognitive 32) · ×1
  • NativeSidecarKernelProxy.runEventPump (cognitive 32) REDACTED:2039 — NativeSidecarKernelProxy.runEventPump has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (7 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 19). Of this number, 31 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 · NativeSidecarKernelProxy.createFilesystemView (cognitive 32) · ×1
  • NativeSidecarKernelProxy.createFilesystemView (cognitive 32) REDACTED:2504 — NativeSidecarKernelProxy.createFilesystemView has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 12, boolean chains 2, error handling 1 (nesting depth added 3). None of this is in the body itself: all 32 points belong to 10 function literals inside it that branch (lines 2615, 2662, 2520, …). 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 · worker.initRuntime (cognitive 32) · ×1
  • worker.initRuntime (cognitive 32) packages/runtime-browser/src/worker.ts:1908 — worker.initRuntime has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (17 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 2320, randomBytes, loadFileSync, …). 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 · footprint.details (cognitive 32) · ×1
  • footprint.details (cognitive 32) scripts/pipboy/src/render/footprint.ts:93 — footprint.details has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 7 (19 pts), loops 4 (6 pts), if/else 4, boolean chains 3 (nesting depth added 14). Of this number, 29 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · net_accept (cognitive 32) · ×1
  • net_accept (cognitive 32) crates/execution/assets/runners/wasm-runner.mjs:6074 — net_accept has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, ternaries 2 (4 pts), error handling 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.
D2 · Cognitive Complexity · fd_fdstat_get (cognitive 32) · ×1
  • fd_fdstat_get (cognitive 32) crates/execution/assets/runners/wasm-runner.mjs:11311 — fd_fdstat_get has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 6 (10 pts), error handling 3 (7 pts), boolean chains 4 (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 · Performer · ×1
  • Performer::csi_dispatch (cognitive 31) crates/native-sidecar/src/execution/terminal_model.rs:459 — Performer::csi_dispatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), match/switch 3 (6 pts), boolean chains 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 · ActiveTcpListener · ×1
  • ActiveTcpListener::poll (cognitive 31) crates/native-sidecar/src/execution/network/tcp.rs:1767 — ActiveTcpListener::poll has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 2 (4 pts), boolean chains 2, 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 · agentos_wasi_http · ×1
  • agentos_wasi_http::read_chunked_body (cognitive 31) toolchain/crates/libs/wasi-http/src/lib.rs:869 — agentos_wasi_http::read_chunked_body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · process.setupGlobals (cognitive 31) · ×1
  • process.setupGlobals (cognitive 31) packages/build-tools/bridge-src/builtins/process.ts:1117 — process.setupGlobals has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (nesting depth added 6). Of this number, 29 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · runtime-driver.handleSyncBridgeOperation (cognitive 31) · ×1
  • runtime-driver.handleSyncBridgeOperation (cognitive 31) packages/runtime-browser/src/runtime-driver.ts:311 — runtime-driver.handleSyncBridgeOperation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 8, ternaries 2 (4 pts), match/switch 1 (nesting depth added 11). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · _pumpPipeProducers (cognitive 31) · ×1
  • _pumpPipeProducers (cognitive 31) crates/execution/assets/runners/wasi-module.js:610 — _pumpPipeProducers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 8, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1, other 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 · child-process.encodeAdvancedIpcMessage · ×1
  • child-process.encodeAdvancedIpcMessage::encode (cognitive 30) packages/build-tools/bridge-src/builtins/child-process.ts:128 — child-process.encodeAdvancedIpcMessage::encode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (26 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 · ServerResponseBridge._streamEndBody (cognitive 30) · ×1
  • ServerResponseBridge._streamEndBody (cognitive 30) packages/build-tools/bridge-src/builtins/http.ts:3275 — ServerResponseBridge._streamEndBody has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.attachHttpServerSocket · ×1
  • http.attachHttpServerSocket::processRequests (cognitive 30) packages/build-tools/bridge-src/builtins/http.ts:4259 — http.attachHttpServerSocket::processRequests has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentOs.create · ×1
  • AgentOs.create::createVmAdmin (cognitive 30) packages/core/src/agent-os.ts:3015 — AgentOs.create::createVmAdmin has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 10 (12 pts), loops 2 (3 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (AgentOs.create) 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 · registerKernelDelegateFd (cognitive 30) · ×1
  • registerKernelDelegateFd (cognitive 30) crates/execution/assets/runners/wasm-runner.mjs:2767 — registerKernelDelegateFd has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 13, error handling 1, other 1, ternaries 1 (nesting depth added 4). Of this number, 28 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 · fd_sendmsg_rights (cognitive 30) · ×1
  • fd_sendmsg_rights (cognitive 30) crates/execution/assets/runners/wasm-runner.mjs:8384 — fd_sendmsg_rights has cognitive complexity 30 (threshold 15). Drivers by points: other 10, if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InMemoryMetadataStore · ×1
  • InMemoryMetadataStore::set_attr (cognitive 29) crates/vfs/src/engine/mem/metadata_store.rs:490 — InMemoryMetadataStore::set_attr has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 2 (5 pts), boolean chains 3 (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 · _NetSocket._processLoopbackHttpRequests (cognitive 29) · ×1
  • _NetSocket._processLoopbackHttpRequests (cognitive 29) packages/build-tools/bridge-src/builtins/net.ts:3053 — _NetSocket._processLoopbackHttpRequests has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasi-ls-scaling.bench.runCase (cognitive 29) · ×1
  • wasi-ls-scaling.bench.runCase (cognitive 29) packages/runtime-benchmarks/src/focused/wasi-ls-scaling.bench.ts:308 — wasi-ls-scaling.bench.runCase has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 8 (13 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · response-payloads.fromGeneratedResponsePayload (cognitive 29) · ×1
  • response-payloads.fromGeneratedResponsePayload (cognitive 29) packages/runtime-core/src/response-payloads.ts:329 — response-payloads.fromGeneratedResponsePayload has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (28 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.
D2 · Cognitive Complexity · openBlockingGuestFifoForPathOpen (cognitive 29) · ×1
  • openBlockingGuestFifoForPathOpen (cognitive 29) crates/execution/assets/runners/wasm-runner.mjs:1971 — openBlockingGuestFifoForPathOpen has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, error handling 2 (4 pts), loops 1, other 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 · fs.normalizeFsTimeSpec (cognitive 28) · ×1
  • fs.normalizeFsTimeSpec (cognitive 28) REDACTED:2546 — fs.normalizeFsTimeSpec has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DgramSocket._pumpMessages (cognitive 28) · ×1
  • DgramSocket._pumpMessages (cognitive 28) packages/build-tools/bridge-src/builtins/dgram.ts:1111 — DgramSocket._pumpMessages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, ternaries 1 (3 pts), error handling 1, loops 1 (nesting depth added 10). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dgram.normalizeDgramSendArgs (cognitive 28) · ×1
  • dgram.normalizeDgramSendArgs (cognitive 28) packages/build-tools/bridge-src/builtins/dgram.ts:456 — dgram.normalizeDgramSendArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 6 (9 pts), boolean chains 6 (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 · AgentOs._executionOperation (cognitive 28) · ×1
  • AgentOs._executionOperation (cognitive 28) packages/core/src/agent-os.ts:3343 — AgentOs._executionOperation has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 13 belong to 4 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 · fd_flock (cognitive 28) · ×1
  • fd_flock (cognitive 28) crates/execution/assets/runners/wasm-runner.mjs:8145 — fd_flock has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (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.
D2 · Cognitive Complexity · http2.getCompleteUtf8PrefixLength (cognitive 27) · ×1
  • http2.getCompleteUtf8PrefixLength (cognitive 27) packages/build-tools/bridge-src/builtins/http2.ts:929 — http2.getCompleteUtf8PrefixLength has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (22 pts), if/else 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 17). 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 · IncomingMessage.on (cognitive 27) · ×1
  • IncomingMessage.on (cognitive 27) packages/build-tools/bridge-src/builtins/http.ts:127 — IncomingMessage.on has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6 (nesting depth added 10). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 133, 172, 145, …). 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 · fd_readdir (cognitive 27) · ×1
  • fd_readdir (cognitive 27) crates/execution/assets/runners/wasm-runner.mjs:10908 — fd_readdir has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, other 3, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fd_pread (cognitive 27) · ×1
  • fd_pread (cognitive 27) crates/execution/assets/runners/wasm-runner.mjs:10992 — fd_pread has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3 (7 pts), loops 2 (5 pts), other 1, ternaries 1 (nesting depth added 12). Of this number, 17 points are the body's own statements and 10 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 · PreparedDisposeVm · ×1
  • PreparedDisposeVm::execute (cognitive 26) crates/native-sidecar/src/vm.rs:1991 — PreparedDisposeVm::execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MountTable · ×1
  • MountTable::realpath (cognitive 26) crates/vfs/src/posix/mount_table.rs:2203 — MountTable::realpath has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, match/switch 2 (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 · wasm-runner.buildPreopens (cognitive 26) · ×1
  • wasm-runner.buildPreopens (cognitive 26) crates/execution/assets/runners/wasm-runner.mjs:1187 — wasm-runner.buildPreopens has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 8, ternaries 2 (5 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · builtin-modules.fileURLToPath2 (cognitive 26) · ×1
  • builtin-modules.fileURLToPath2 (cognitive 26) packages/build-tools/bridge-src/builtins/builtin-modules.ts:584 — builtin-modules.fileURLToPath2 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, ternaries 1 (2 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 · crypto.createBuiltinHash.digest (cognitive 26) · ×1
  • crypto.createBuiltinHash.digest (cognitive 26) packages/build-tools/bridge-src/builtins/crypto.ts:477 — crypto.createBuiltinHash.digest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (6 pts), boolean chains 4, ternaries 3 (4 pts), loops 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 · _NetSocket._flushBridgeWrites (cognitive 26) · ×1
  • _NetSocket._flushBridgeWrites (cognitive 26) packages/build-tools/bridge-src/builtins/net.ts:2174 — _NetSocket._flushBridgeWrites has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 6 (8 pts), boolean chains 4, ternaries 3 (nesting depth added 6). Of this number, 20 points are the body's own statements and 6 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 · http.dispatchLoopbackServerRequest (cognitive 26) · ×1
  • http.dispatchLoopbackServerRequest (cognitive 26) packages/build-tools/bridge-src/builtins/http.ts:4005 — http.dispatchLoopbackServerRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 4 (6 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · index.compilerRuntimeMain (cognitive 26) · ×1
  • index.compilerRuntimeMain (cognitive 26) packages/typescript/src/index.ts:616 — index.compilerRuntimeMain has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, ternaries 3, match/switch 2 (nesting depth added 6). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (createSourceProgram, resolveProjectConfig, a function literal at line 918, …). 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 · ChunkedFs · ×1
  • ChunkedFs::write_chunked_range (cognitive 25) crates/vfs/src/engine/engines/chunked.rs:302 — ChunkedFs::write_chunked_range has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (3 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.
D2 · Cognitive Complexity · NativeSidecarKernelProxy.spawn (cognitive 25) · ×1
  • NativeSidecarKernelProxy.spawn (cognitive 25) REDACTED:863 — NativeSidecarKernelProxy.spawn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 7 (9 pts), boolean chains 6 (nesting depth added 3). Of this number, 17 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · agent-os.buildHostFunctionReference (cognitive 25) · ×1
  • agent-os.buildHostFunctionReference (cognitive 25) packages/core/src/agent-os.ts:1572 — agent-os.buildHostFunctionReference has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 3 (11 pts), loops 4 (10 pts), if/else 2 (3 pts), boolean chains 1 (nesting depth added 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ls.bench.runCase (cognitive 25) · ×1
  • ls.bench.runCase (cognitive 25) packages/runtime-benchmarks/src/focused/ls.bench.ts:125 — ls.bench.runCase has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · net-tcp-event-floor.bench.runEcho (cognitive 25) · ×1
  • net-tcp-event-floor.bench.runEcho (cognitive 25) packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:605 — net-tcp-event-floor.bench.runEcho has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). None of this is in the body itself: all 25 points belong to 6 function literals inside it that branch (lines 634, 620, 642, …). 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 · worker.applyTimingMitigation (cognitive 25) · ×1
  • worker.applyTimingMitigation (cognitive 25) packages/runtime-browser/src/worker.ts:259 — worker.applyTimingMitigation has cognitive complexity 25 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 6 (9 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commit.reportAttributes (cognitive 25) · ×1
  • commit.reportAttributes (cognitive 25) scripts/pipboy/src/trace/commit.ts:78 — commit.reportAttributes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (11 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 14). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimerWheel · ×1
  • TimerWheel::run (cognitive 24) crates/execution/src/javascript.rs:1102 — TimerWheel::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreparedExtensionServiceCommand · ×1
  • PreparedExtensionServiceCommand::execute_supervised (cognitive 24) crates/native-sidecar/src/extension_services.rs:165 — PreparedExtensionServiceCommand::execute_supervised has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 8 (17 pts), if/else 2 (7 pts) (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.
D2 · Cognitive Complexity · SqliteMetadataStore · ×1
  • SqliteMetadataStore::persist_commit_write (cognitive 24) crates/vfs-store/src/local/sqlite_metadata_store.rs:346 — SqliteMetadataStore::persist_commit_write has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 4 (5 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.
D2 · Cognitive Complexity · Url · ×1
  • Url::parse (cognitive 24) toolchain/crates/libs/wasi-http/src/lib.rs:69 — Url::parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SseReader · ×1
  • SseReader::next_event (cognitive 24) toolchain/crates/libs/wasi-http/src/lib.rs:344 — SseReader::next_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentos_wasi_spawn · ×1
  • agentos_wasi_spawn::read_captured_streams_with_limit (cognitive 24) toolchain/crates/libs/wasi-spawn/src/lib.rs:217 — agentos_wasi_spawn::read_captured_streams_with_limit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (8 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.
D2 · Cognitive Complexity · python-runner.installPythonGuestPreloadHardening (cognitive 24) · ×1
  • python-runner.installPythonGuestPreloadHardening (cognitive 24) crates/execution/assets/runners/python-runner.mjs:1568 — python-runner.installPythonGuestPreloadHardening has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 9). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to one function item inside it that branches (restrictedFetch). 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 · prelude.cloneStructuredValue (cognitive 24) · ×1
  • prelude.cloneStructuredValue (cognitive 24) REDACTED:116 — prelude.cloneStructuredValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, loops 4 (8 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). 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 · fs._globCollect · ×1
  • fs._globCollect::walk (cognitive 24) REDACTED:2171 — fs._globCollect::walk has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (7 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (fs._globCollect) 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 · net.normalizeConnectArgs (cognitive 24) · ×1
  • net.normalizeConnectArgs (cognitive 24) packages/build-tools/bridge-src/builtins/net.ts:617 — net.normalizeConnectArgs has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 5, if/else 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 · module-loader.requireFrom (cognitive 24) · ×1
  • module-loader.requireFrom (cognitive 24) packages/build-tools/bridge-src/builtins/module-loader.ts:320 — module-loader.requireFrom has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (7 pts), error handling 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.updateProcessConfig (cognitive 24) · ×1
  • worker.updateProcessConfig (cognitive 24) packages/runtime-browser/src/worker.ts:3436 — worker.updateProcessConfig has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pumpChildInputPipe (cognitive 24) · ×1
  • pumpChildInputPipe (cognitive 24) crates/execution/assets/runners/wasm-runner.mjs:4268 — pumpChildInputPipe has cognitive complexity 24 (threshold 15). Drivers by points: other 9, boolean chains 8, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SessionReadyBroker · ×1
  • SessionReadyBroker::ready_batch (cognitive 23) crates/runtime/src/readiness.rs:535 — SessionReadyBroker::ready_batch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (7 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 · VmUserConfig · ×1
  • VmUserConfig::validate (cognitive 23) crates/vm-config/src/lib.rs:381 — VmUserConfig::validate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · wasm-runner.receiveHostNetDatagramEvent (cognitive 23) · ×1
  • wasm-runner.receiveHostNetDatagramEvent (cognitive 23) crates/execution/assets/runners/wasm-runner.mjs:5158 — wasm-runner.receiveHostNetDatagramEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 4 (8 pts), boolean chains 5, 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 · wasm-runner.wasiImport.fd_pwrite (cognitive 23) · ×1
  • wasm-runner.wasiImport.fd_pwrite (cognitive 23) crates/execution/assets/runners/wasm-runner.mjs:11086 — wasm-runner.wasiImport.fd_pwrite has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (7 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasm-runner.wasiImport.fd_seek (cognitive 23) · ×1
  • wasm-runner.wasiImport.fd_seek (cognitive 23) crates/execution/assets/runners/wasm-runner.mjs:11215 — wasm-runner.wasiImport.fd_seek has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (7 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · misc-stubs.getNodeReadableAsyncIterable (cognitive 23) · ×1
  • misc-stubs.getNodeReadableAsyncIterable (cognitive 23) packages/build-tools/bridge-src/builtins/misc-stubs.ts:196 — misc-stubs.getNodeReadableAsyncIterable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3, ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlockList.check (cognitive 23) · ×1
  • BlockList.check (cognitive 23) packages/build-tools/bridge-src/builtins/net.ts:894 — BlockList.check has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncomingMessage.constructor (cognitive 23) · ×1
  • IncomingMessage.constructor (cognitive 23) packages/build-tools/bridge-src/builtins/http.ts:52 — IncomingMessage.constructor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServerResponseBridge.write (cognitive 23) · ×1
  • ServerResponseBridge.write (cognitive 23) packages/build-tools/bridge-src/builtins/http.ts:3181 — ServerResponseBridge.write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (9 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 · NativeSidecarKernelProxy.buildProcessSnapshot (cognitive 23) · ×1
  • NativeSidecarKernelProxy.buildProcessSnapshot (cognitive 23) REDACTED:2731 — NativeSidecarKernelProxy.buildProcessSnapshot has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (8 pts), loops 4, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeSidecarKernelProxy.exec (cognitive 23) · ×1
  • NativeSidecarKernelProxy.exec (cognitive 23) REDACTED:528 — NativeSidecarKernelProxy.exec has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, ternaries 4, loops 1 (2 pts) (nesting depth added 3). Of this number, 18 points are the body's own statements and 5 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 · packages.discoverPackages (cognitive 23) · ×1
  • packages.discoverPackages (cognitive 23) scripts/publish/src/lib/packages.ts:108 — packages.discoverPackages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (5 pts) (nesting depth added 11). Of this number, 19 points are the body's own statements and 4 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 · _fdClose (cognitive 23) · ×1
  • _fdClose (cognitive 23) crates/execution/assets/runners/wasi-module.js:1866 — _fdClose has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, error handling 2, other 2 (nesting depth added 2). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _fdReaddir (cognitive 23) · ×1
  • _fdReaddir (cognitive 23) crates/execution/assets/runners/wasi-module.js:2118 — _fdReaddir has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 4 (7 pts), boolean chains 4, other 3, error handling 1, loops 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseInitialHostNetFds (cognitive 23) · ×1
  • parseInitialHostNetFds (cognitive 23) crates/execution/assets/runners/wasm-runner.mjs:3731 — parseInitialHostNetFds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, loops 2 (3 pts), error handling 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fd_renumber (cognitive 23) · ×1
  • fd_renumber (cognitive 23) crates/execution/assets/runners/wasm-runner.mjs:11989 — fd_renumber has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 2 (4 pts), other 2, 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 · SocketTable · ×1
  • SocketTable::poll (cognitive 22) crates/kernel/src/socket_table.rs:2047 — SocketTable::poll has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · aospkg.parsePaxRecords (cognitive 22) · ×1
  • aospkg.parsePaxRecords (cognitive 22) packages/agentos-toolchain/src/aospkg.ts:463 — aospkg.parsePaxRecords has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · builtin-modules.bufferIsUtf8 (cognitive 22) · ×1
  • builtin-modules.bufferIsUtf8 (cognitive 22) packages/build-tools/bridge-src/builtins/builtin-modules.ts:180 — builtin-modules.bufferIsUtf8 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fs._globToRegex (cognitive 22) · ×1
  • fs._globToRegex (cognitive 22) REDACTED:2070 — fs._globToRegex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · child-process.fork (cognitive 22) · ×1
  • child-process.fork (cognitive 22) packages/build-tools/bridge-src/builtins/child-process.ts:1753 — child-process.fork has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, ternaries 4 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.finalizeRawHeaderPairs (cognitive 22) · ×1
  • http.finalizeRawHeaderPairs (cognitive 22) packages/build-tools/bridge-src/builtins/http.ts:2660 — http.finalizeRawHeaderPairs has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (10 pts), loops 4 (6 pts), if/else 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 · AgentOs.create (cognitive 22) · ×1
  • AgentOs.create (cognitive 22) packages/core/src/agent-os.ts:2935 — AgentOs.create has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 15 (19 pts), error handling 5 (7 pts), loops 5 (6 pts), boolean chains 3 (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. This shape REPEATS in the file: one other method here (AgentOs.create::createVmAdmin) 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 · worker.onmessage (cognitive 22) · ×1
  • worker.onmessage (cognitive 22) packages/runtime-browser/src/worker.ts:3663 — worker.onmessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 4, 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 · fd_dup_min (cognitive 22) · ×1
  • fd_dup_min (cognitive 22) crates/execution/assets/runners/wasm-runner.mjs:8022 — fd_dup_min has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), other 3, boolean chains 2, 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 · ProcessPackageCache · ×1
  • ProcessPackageCache::get_or_acquire_with_priority (cognitive 21) crates/client/src/software.rs:700 — ProcessPackageCache::get_or_acquire_with_priority has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileLockManager · ×1
  • FileLockManager::set_record_lock_inner (cognitive 21) crates/kernel/src/fd_table.rs:1625 — FileLockManager::set_record_lock_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VirtualFileSystem · ×1
  • VirtualFileSystem::rename_at2 (cognitive 21) crates/vfs/src/posix/vfs.rs:372 — VirtualFileSystem::rename_at2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (9 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Calculator · ×1
  • Calculator::execute (cognitive 21) software/coreutils/native/crates/cmd-bc/src/main.rs:310 — Calculator::execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_id · ×1
  • cmd_id::render (cognitive 21) software/coreutils/native/crates/cmd-id/src/main.rs:203 — cmd_id::render has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _NetSocket._dispatchLoopbackUpgrade (cognitive 21) · ×1
  • _NetSocket._dispatchLoopbackUpgrade (cognitive 21) packages/build-tools/bridge-src/builtins/net.ts:3164 — _NetSocket._dispatchLoopbackUpgrade has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http2.pollRetainedHttp2Handle · ×1
  • http2.pollRetainedHttp2Handle::tick (cognitive 21) packages/build-tools/bridge-src/builtins/http2.ts:2286 — http2.pollRetainedHttp2Handle::tick has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.dispatchServerRequest (cognitive 21) · ×1
  • http.dispatchServerRequest (cognitive 21) packages/build-tools/bridge-src/builtins/http.ts:3828 — http.dispatchServerRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sync-bridge-floor.bench.runCaseWithOptionalLatency (cognitive 21) · ×1
  • sync-bridge-floor.bench.runCaseWithOptionalLatency (cognitive 21) packages/runtime-benchmarks/src/focused/sync-bridge-floor.bench.ts:246 — sync-bridge-floor.bench.runCaseWithOptionalLatency has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · StdioSidecarProtocolClient.dispose (cognitive 21) · ×1
  • StdioSidecarProtocolClient.dispose (cognitive 21) packages/runtime-core/src/native-client.ts:169 — StdioSidecarProtocolClient.dispose has cognitive complexity 21 (threshold 15). Drivers by points: error handling 8 (12 pts), if/else 6, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve.resolveSide (cognitive 21) · ×1
  • resolve.resolveSide (cognitive 21) scripts/pipboy/src/footprint/resolve.ts:57 — resolve.resolveSide has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 3, ternaries 2, boolean chains 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 4 belong to 5 function literals inside it that branch. 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 · _flushPipeConsumers (cognitive 21) · ×1
  • _flushPipeConsumers (cognitive 21) crates/execution/assets/runners/wasi-module.js:531 — _flushPipeConsumers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts), other 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 · processChildEvent (cognitive 21) · ×1
  • processChildEvent (cognitive 21) crates/execution/assets/runners/wasm-runner.mjs:4191 — processChildEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (6 pts), other 4, 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 · BrowserSidecar · ×1
  • BrowserSidecar::find_listener (cognitive 20) crates/native-sidecar-browser/src/service.rs:769 — BrowserSidecar::find_listener has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (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 · WarmWorkerPool · ×1
  • WarmWorkerPool::refill_until (cognitive 20) crates/v8-runtime/src/session.rs:726 — WarmWorkerPool::refill_until has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasm-runner.hostNetSockoptKind (cognitive 20) · ×1
  • wasm-runner.hostNetSockoptKind (cognitive 20) crates/execution/assets/runners/wasm-runner.mjs:5039 — wasm-runner.hostNetSockoptKind has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8 (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 · wasm-runner.wasiImport.fd_filestat_get (cognitive 20) · ×1
  • wasm-runner.wasiImport.fd_filestat_get (cognitive 20) crates/execution/assets/runners/wasm-runner.mjs:11523 — wasm-runner.wasiImport.fd_filestat_get has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3 (7 pts), boolean chains 2, ternaries 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 · wasm-runner.writeKernelCooperatively (cognitive 20) · ×1
  • wasm-runner.writeKernelCooperatively (cognitive 20) crates/execution/assets/runners/wasm-runner.mjs:11704 — wasm-runner.writeKernelCooperatively has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · misc-stubs.collectReadableChunks (cognitive 20) · ×1
  • misc-stubs.collectReadableChunks (cognitive 20) packages/build-tools/bridge-src/builtins/misc-stubs.ts:122 — misc-stubs.collectReadableChunks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 3 (6 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · child-process.execSync (cognitive 20) · ×1
  • child-process.execSync (cognitive 20) packages/build-tools/bridge-src/builtins/child-process.ts:1300 — child-process.execSync has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 6, boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _Agent._processPendingRequests (cognitive 20) · ×1
  • _Agent._processPendingRequests (cognitive 20) packages/build-tools/bridge-src/builtins/http.ts:1583 — _Agent._processPendingRequests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (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 · runtime-compat.discoverWasmCommandEntries (cognitive 20) · ×1
  • runtime-compat.discoverWasmCommandEntries (cognitive 20) REDACTED:1284 — runtime-compat.discoverWasmCommandEntries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrowserRuntimeDriver.handleWorkerMessage (cognitive 20) · ×1
  • BrowserRuntimeDriver.handleWorkerMessage (cognitive 20) packages/runtime-browser/src/runtime-driver.ts:629 — BrowserRuntimeDriver.handleWorkerMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 2 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · event-buffer.sidecarSelectorMatchesEvent (cognitive 20) · ×1
  • event-buffer.sidecarSelectorMatchesEvent (cognitive 20) packages/runtime-core/src/event-buffer.ts:285 — event-buffer.sidecarSelectorMatchesEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · footprint.compareRoot (cognitive 20) · ×1
  • footprint.compareRoot (cognitive 20) scripts/pipboy/src/compare/footprint.ts:110 — footprint.compareRoot has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9, if/else 3 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _installSyscallCounterWrappers (cognitive 20) · ×1
  • _installSyscallCounterWrappers (cognitive 20) crates/execution/assets/runners/wasi-module.js:216 — _installSyscallCounterWrappers has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 3 (5 pts), error handling 1 (3 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 230). 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 · flushPipeConsumers (cognitive 20) · ×1
  • flushPipeConsumers (cognitive 20) crates/execution/assets/runners/wasm-runner.mjs:3651 — flushPipeConsumers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts), other 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 · net_close (cognitive 20) · ×1
  • net_close (cognitive 20) crates/execution/assets/runners/wasm-runner.mjs:6527 — net_close has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 5 belong to 6 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 · fd_close (cognitive 20) · ×1
  • fd_close (cognitive 20) crates/execution/assets/runners/wasm-runner.mjs:11902 — fd_close has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), other 5, error handling 2 (3 pts), boolean chains 1, ternaries 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 · RuntimeConfig · ×1
  • RuntimeConfig::validate (cognitive 19) crates/runtime/src/lib.rs:503 — RuntimeConfig::validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TarFileSystem · ×1
  • TarFileSystem::resolve_archive_path_uncached (cognitive 19) crates/vfs/src/posix/tar_fs.rs:166 — TarFileSystem::resolve_archive_path_uncached has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 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 · WASI._resolveHostMappingForGuestPath (cognitive 19) · ×1
  • WASI._resolveHostMappingForGuestPath (cognitive 19) crates/execution/assets/runners/wasi-module.js:1051 — WASI._resolveHostMappingForGuestPath has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 3 (6 pts), boolean chains 4, loops 2 (nesting depth added 7). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 1052). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · runtime.resolveImportsTarget (cognitive 19) · ×1
  • runtime.resolveImportsTarget (cognitive 19) packages/runtime-browser/src/runtime.ts:1095 — runtime.resolveImportsTarget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · protocol-client.resolveProtocolFrameTransport (cognitive 19) · ×1
  • protocol-client.resolveProtocolFrameTransport (cognitive 19) packages/runtime-core/src/protocol-client.ts:436 — protocol-client.resolveProtocolFrameTransport has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, match/switch 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeSidecarKernelProxy.buildProcessSnapshot (cognitive 19) · ×1
  • NativeSidecarKernelProxy.buildProcessSnapshot (cognitive 19) REDACTED:2143 — NativeSidecarKernelProxy.buildProcessSnapshot has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 2 (4 pts), loops 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cut-release.main (cognitive 19) · ×1
  • cut-release.main (cognitive 19) scripts/publish/src/local/cut-release.ts:67 — cut-release.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · installPythonGuestPreloadHardening · ×1
  • installPythonGuestPreloadHardening::restrictedFetch (cognitive 19) crates/execution/assets/runners/python-runner.mjs:1576 — installPythonGuestPreloadHardening::restrictedFetch has cognitive complexity 19 (threshold 15). Drivers by points: other 7, boolean chains 5, if/else 3, ternaries 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · retainPathOpenDelegateFd (cognitive 19) · ×1
  • retainPathOpenDelegateFd (cognitive 19) crates/execution/assets/runners/wasm-runner.mjs:2421 — retainPathOpenDelegateFd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1, other 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 · collectInactivePipeHandles (cognitive 19) · ×1
  • collectInactivePipeHandles (cognitive 19) crates/execution/assets/runners/wasm-runner.mjs:3160 — collectInactivePipeHandles has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), other 4, loops 2 (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 · fd_fdstat_set_flags (cognitive 19) · ×1
  • fd_fdstat_set_flags (cognitive 19) crates/execution/assets/runners/wasm-runner.mjs:11473 — fd_fdstat_set_flags has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 2, error handling 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 · python-runner.installPythonStdin · ×1
  • python-runner.installPythonStdin::readFromKernelStdin (cognitive 18) crates/execution/assets/runners/python-runner.mjs:2112 — python-runner.installPythonStdin::readFromKernelStdin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (5 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 · build.build (cognitive 18) · ×1
  • build.build (cognitive 18) packages/agentos-toolchain/src/build.ts:62 — build.build has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 5, ternaries 4, loops 1 (2 pts), error handling 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · stage.stage (cognitive 18) · ×1
  • stage.stage (cognitive 18) packages/agentos-toolchain/src/stage.ts:39 — stage.stage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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 · fs.normalizeWriteSyncArgs (cognitive 18) · ×1
  • fs.normalizeWriteSyncArgs (cognitive 18) REDACTED:1115 — fs.normalizeWriteSyncArgs has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · net.buildSerializedTlsOptions (cognitive 18) · ×1
  • net.buildSerializedTlsOptions (cognitive 18) packages/build-tools/bridge-src/builtins/net.ts:1074 — net.buildSerializedTlsOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2, 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 · http2.flushPendingHttp2ClientStreamEvents (cognitive 18) · ×1
  • http2.flushPendingHttp2ClientStreamEvents (cognitive 18) packages/build-tools/bridge-src/builtins/http2.ts:1954 — http2.flushPendingHttp2ClientStreamEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DgramSocket._sendInternal (cognitive 18) · ×1
  • DgramSocket._sendInternal (cognitive 18) packages/build-tools/bridge-src/builtins/dgram.ts:1058 — DgramSocket._sendInternal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · undici.createAgentOsUndiciDispatcher (cognitive 18) · ×1
  • undici.createAgentOsUndiciDispatcher (cognitive 18) packages/build-tools/bridge-src/builtins/undici.ts:14 — undici.createAgentOsUndiciDispatcher has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 4, error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 3 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 · process.readLiveProcessResourceUsage (cognitive 18) · ×1
  • process.readLiveProcessResourceUsage (cognitive 18) packages/build-tools/bridge-src/builtins/process.ts:525 — process.readLiveProcessResourceUsage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 16, boolean chains 1, if/else 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 · AgentOs._waitProcess (cognitive 18) · ×1
  • AgentOs._waitProcess (cognitive 18) packages/core/src/agent-os.ts:4627 — AgentOs._waitProcess has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5 (7 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConvergedModuleServicer.handle (cognitive 18) · ×1
  • ConvergedModuleServicer.handle (cognitive 18) packages/runtime-browser/src/converged-module-servicer.ts:37 — ConvergedModuleServicer.handle has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 1 (3 pts), loops 1 (2 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · KernelReactor.drainOnce (cognitive 18) · ×1
  • KernelReactor.drainOnce (cognitive 18) packages/runtime-browser/src/sab-reactor.ts:132 — KernelReactor.drainOnce has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 1 (3 pts), loops 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 · worker.execScript (cognitive 18) · ×1
  • worker.execScript (cognitive 18) packages/runtime-browser/src/worker.ts:3497 — worker.execScript has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (7 pts), boolean chains 3, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 3518). 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 · NativeSidecarKernelProxy.dispose (cognitive 18) · ×1
  • NativeSidecarKernelProxy.dispose (cognitive 18) REDACTED:437 — NativeSidecarKernelProxy.dispose has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (4 pts), loops 2, error handling 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BenchmarkComparison · ×1
  • BenchmarkComparison::from_reports (cognitive 17) crates/execution/src/benchmark.rs:980 — BenchmarkComparison::from_reports has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (3 pts), loops 1 (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.
D2 · Cognitive Complexity · PythonExecution · ×1
  • PythonExecution::wait (cognitive 17) crates/execution/src/python.rs:768 — PythonExecution::wait has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PermissionedFileSystem · ×1
  • PermissionedFileSystem::resolved_destination_path (cognitive 17) crates/kernel/src/permissions.rs:445 — PermissionedFileSystem::resolved_destination_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · State · ×1
  • State::resolve_path_depth (cognitive 17) crates/vfs/src/engine/mem/metadata_store.rs:198 — State::resolve_path_depth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasm-runner.fsOpenFlagForPathOpen (cognitive 17) · ×1
  • wasm-runner.fsOpenFlagForPathOpen (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:2209 — wasm-runner.fsOpenFlagForPathOpen has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 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.
D2 · Cognitive Complexity · wasm-runner.pollHostNetSocket (cognitive 17) · ×1
  • wasm-runner.pollHostNetSocket (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:4799 — wasm-runner.pollHostNetSocket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · wasm-runner.wasiImport.poll_oneoff · ×1
  • wasm-runner.wasiImport.poll_oneoff::collectKernelReadyEvents (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:12157 — wasm-runner.wasiImport.poll_oneoff::collectKernelReadyEvents has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (6 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 · wasm-runner.dispatchWasmSignal (cognitive 17) · ×1
  • wasm-runner.dispatchWasmSignal (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:12494 — wasm-runner.dispatchWasmSignal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 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 · wasm-runner.resetCaughtWasmSignalDispositionsForExec (cognitive 17) · ×1
  • wasm-runner.resetCaughtWasmSignalDispositionsForExec (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:12585 — wasm-runner.resetCaughtWasmSignalDispositionsForExec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 1 (5 pts), error handling 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aospkg.packAospkgFromTarBytes (cognitive 17) · ×1
  • aospkg.packAospkgFromTarBytes (cognitive 17) packages/agentos-toolchain/src/aospkg.ts:108 — aospkg.packAospkgFromTarBytes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, 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 · header.detectExecutableKind (cognitive 17) · ×1
  • header.detectExecutableKind (cognitive 17) packages/agentos-toolchain/src/header.ts:25 — header.detectExecutableKind has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · crypto.normalizeDiffieHellmanArgs (cognitive 17) · ×1
  • crypto.normalizeDiffieHellmanArgs (cognitive 17) packages/build-tools/bridge-src/builtins/crypto.ts:915 — crypto.normalizeDiffieHellmanArgs has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (6 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 · fs.bridgeErrorCode (cognitive 17) · ×1
  • fs.bridgeErrorCode (cognitive 17) REDACTED:2016 — fs.bridgeErrorCode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · tls.tlsConnect (cognitive 17) · ×1
  • tls.tlsConnect (cognitive 17) packages/build-tools/bridge-src/builtins/tls.ts:55 — tls.tlsConnect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientRequest._dispatchUndiciRequest (cognitive 17) · ×1
  • ClientRequest._dispatchUndiciRequest (cognitive 17) packages/build-tools/bridge-src/builtins/http.ts:526 — ClientRequest._dispatchUndiciRequest has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 6, if/else 4, error handling 1. Of this number, 12 points are the body's own statements and 5 belong to 3 function literals 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 · ClientRequest._dispatchRawSocketRequest (cognitive 17) · ×1
  • ClientRequest._dispatchRawSocketRequest (cognitive 17) packages/build-tools/bridge-src/builtins/http.ts:587 — ClientRequest._dispatchRawSocketRequest has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 3 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _Agent._releaseSocket (cognitive 17) · ×1
  • _Agent._releaseSocket (cognitive 17) packages/build-tools/bridge-src/builtins/http.ts:1464 — _Agent._releaseSocket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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 · http.serializeRawHeaderPairs (cognitive 17) · ×1
  • http.serializeRawHeaderPairs (cognitive 17) packages/build-tools/bridge-src/builtins/http.ts:2627 — http.serializeRawHeaderPairs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 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 · PatchedEventTarget.dispatchEvent (cognitive 17) · ×1
  • PatchedEventTarget.dispatchEvent (cognitive 17) packages/build-tools/bridge-src/polyfills/dom-events.ts:284 — PatchedEventTarget.dispatchEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build-v8-bridge.validateBridgeContractGlobals (cognitive 17) · ×1
  • build-v8-bridge.validateBridgeContractGlobals (cognitive 17) REDACTED:246 — build-v8-bridge.validateBridgeContractGlobals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 4). 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 · index.getPlatformPackageName (cognitive 17) · ×1
  • index.getPlatformPackageName (cognitive 17) packages/runtime-sidecar/index.js:45 — index.getPlatformPackageName has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 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.
D2 · Cognitive Complexity · main.createShellDiagnosticStripper (cognitive 17) · ×1
  • main.createShellDiagnosticStripper (cognitive 17) packages/shell/src/main.ts:216 — main.createShellDiagnosticStripper has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (7 pts), loops 1 (nesting depth added 9). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 220). 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 · main.shellArgsRequestCommandOrScript (cognitive 17) · ×1
  • main.shellArgsRequestCommandOrScript (cognitive 17) packages/shell/src/main.ts:465 — main.shellArgsRequestCommandOrScript has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collect.collectHygiene (cognitive 17) · ×1
  • collect.collectHygiene (cognitive 17) scripts/pipboy/src/hygiene/collect.ts:145 — collect.collectHygiene has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · installPyodideShellCompat (cognitive 17) · ×1
  • installPyodideShellCompat (cognitive 17) crates/execution/assets/runners/python-runner.mjs:210 — installPyodideShellCompat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, ternaries 1. None of this is in the body itself: all 17 points belong to 7 function items inside it that branch (a function literal at line 246, shellRead, load, …). 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 · proc_exec (cognitive 17) · ×1
  • proc_exec (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:7094 — proc_exec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), other 3, error handling 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc_ppoll_v1 (cognitive 17) · ×1
  • proc_ppoll_v1 (cognitive 17) crates/execution/assets/runners/wasm-runner.mjs:8728 — proc_ppoll_v1 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SharedBridge · ×1
  • SharedBridge::require_resolved_network_access (cognitive 16) crates/native-sidecar/src/service.rs:1051 — SharedBridge::require_resolved_network_access has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 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 · LocalVmSqliteDatabase · ×1
  • LocalVmSqliteDatabase::transaction (cognitive 16) crates/native-sidecar/src/vm_sqlite.rs:443 — LocalVmSqliteDatabase::transaction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HierarchicalDeficitRoundRobin · ×1
  • HierarchicalDeficitRoundRobin::select_next (cognitive 16) crates/runtime/src/fairness.rs:826 — HierarchicalDeficitRoundRobin::select_next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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.
D2 · Cognitive Complexity · BridgeCallRegistry · ×1
  • BridgeCallRegistry::cancel_session (cognitive 16) crates/v8-runtime/src/host_call.rs:906 — BridgeCallRegistry::cancel_session has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 7). 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 · WASI._filetypeForStats (cognitive 16) · ×1
  • WASI._filetypeForStats (cognitive 16) crates/execution/assets/runners/wasi-module.js:720 — WASI._filetypeForStats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, 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.
D2 · Cognitive Complexity · wasm-runner.pumpSpawnedChildren (cognitive 16) · ×1
  • wasm-runner.pumpSpawnedChildren (cognitive 16) crates/execution/assets/runners/wasm-runner.mjs:4326 — wasm-runner.pumpSpawnedChildren has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). 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 · ReadStream._readAllContent (cognitive 16) · ×1
  • ReadStream._readAllContent (cognitive 16) REDACTED:1495 — ReadStream._readAllContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fs._globCollect (cognitive 16) · ×1
  • fs._globCollect (cognitive 16) REDACTED:2148 — fs._globCollect has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (19 pts), if/else 7 (11 pts), error handling 4 (7 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (fs._globCollect::walk) 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 · ChildProcess.send (cognitive 16) · ×1
  • ChildProcess.send (cognitive 16) packages/build-tools/bridge-src/builtins/child-process.ts:1168 — ChildProcess.send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · child-process.exec (cognitive 16) · ×1
  • child-process.exec (cognitive 16) packages/build-tools/bridge-src/builtins/child-process.ts:1217 — child-process.exec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 1263, a function literal at line 1288, finishExec, …). 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 · _NetSocket._final (cognitive 16) · ×1
  • _NetSocket._final (cognitive 16) packages/build-tools/bridge-src/builtins/net.ts:2048 — _NetSocket._final has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (4 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 · stdin._emitStdinData (cognitive 16) · ×1
  • stdin._emitStdinData (cognitive 16) packages/build-tools/bridge-src/builtins/stdin.ts:76 — stdin._emitStdinData has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, loops 3 (6 pts), if/else 2 (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 · AgentOs._readdirRecursive (cognitive 16) · ×1
  • AgentOs._readdirRecursive (cognitive 16) packages/core/src/agent-os.ts:4776 — AgentOs._readdirRecursive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 3 (6 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 · agent-os.createKernelBootstrapLower (cognitive 16) · ×1
  • agent-os.createKernelBootstrapLower (cognitive 16) packages/core/src/agent-os.ts:1178 — agent-os.createKernelBootstrapLower has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fs-sync-ops.bench.runCaseWithOptionalLatency (cognitive 16) · ×1
  • fs-sync-ops.bench.runCaseWithOptionalLatency (cognitive 16) packages/runtime-benchmarks/src/focused/fs-sync-ops.bench.ts:530 — fs-sync-ops.bench.runCaseWithOptionalLatency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · net-tcp-event-floor.bench.classifySummary (cognitive 16) · ×1
  • net-tcp-event-floor.bench.classifySummary (cognitive 16) packages/runtime-benchmarks/src/focused/net-tcp-event-floor.bench.ts:784 — net-tcp-event-floor.bench.classifySummary has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wasi-ls-scaling.bench.main (cognitive 16) · ×1
  • wasi-ls-scaling.bench.main (cognitive 16) packages/runtime-benchmarks/src/focused/wasi-ls-scaling.bench.ts:443 — wasi-ls-scaling.bench.main has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (8 pts), if/else 4 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · worker.createFsModule.openSync (cognitive 16) · ×1
  • worker.createFsModule.openSync (cognitive 16) packages/runtime-browser/src/worker.ts:1538 — worker.createFsModule.openSync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 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 · copy-wasm-commands.commandFiles (cognitive 16) · ×1
  • copy-wasm-commands.commandFiles (cognitive 16) packages/runtime-core/scripts/copy-wasm-commands.mjs:101 — copy-wasm-commands.commandFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inspect.pickCondition (cognitive 16) · ×1
  • inspect.pickCondition (cognitive 16) scripts/pipboy/src/footprint/inspect.ts:230 — inspect.pickCondition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), 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 · version.bumpCargoVersions (cognitive 16) · ×1
  • version.bumpCargoVersions (cognitive 16) scripts/publish/src/lib/version.ts:218 — version.bumpCargoVersions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (2 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tryHostNetAcceptOnce (cognitive 16) · ×1
  • tryHostNetAcceptOnce (cognitive 16) crates/execution/assets/runners/wasm-runner.mjs:5265 — tryHostNetAcceptOnce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 4 (5 pts), boolean chains 4, other 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 · proc_kill (cognitive 16) · ×1
  • proc_kill (cognitive 16) crates/execution/assets/runners/wasm-runner.mjs:7613 — proc_kill has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFunctions · ×1
  • TooManyFunctions: agentos_native_sidecar_core::frames crates/native-sidecar-core/src/frames.rs:25 — 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (154 shared lines) · ×1
  • Near-duplicate member pair (154 shared lines) crates/native-sidecar/src/vm.rs:715 — crates/native-sidecar/src/vm.rs:715-1065 | crates/native-sidecar/src/vm.rs:1653-1983 — These two members are variants of one another: 154 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 (129 shared lines) · ×1
  • Near-duplicate member pair (129 shared lines) crates/execution/src/v8_ipc.rs:140 — crates/execution/src/v8_ipc.rs:140-302 | crates/v8-runtime/src/ipc_binary.rs:415-601 — These two members are variants of one another: 129 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 (111 shared lines) · ×1
  • Near-duplicate member pair (111 shared lines) crates/native-sidecar/src/execution/network/http2.rs:351 — crates/native-sidecar/src/execution/network/http2.rs:351-597 | crates/native-sidecar/src/execution/network/http2.rs:607-790 — These two members are variants of one another: 111 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) crates/native-sidecar/src/execution/process_events.rs:1042 — crates/native-sidecar/src/execution/process_events.rs:1042-1166 | crates/native-sidecar/src/execution/process_events.rs:1589-1750 — 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 (69 shared lines) · ×1
  • Near-duplicate member pair (69 shared lines) crates/native-sidecar/src/execution/javascript/http.rs:741 — crates/native-sidecar/src/execution/javascript/http.rs:741-929 | crates/native-sidecar/src/execution/javascript/http.rs:2532-2654 — These two members are variants of one another: 69 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 (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) crates/kernel/src/pipe_manager.rs:526 — crates/kernel/src/pipe_manager.rs:526-638 | crates/kernel/src/pty.rs:540-710 — These two members are variants of one another: 54 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/native-sidecar/src/execution/child_process.rs:5187 — crates/native-sidecar/src/execution/child_process.rs:5187-5272 | crates/native-sidecar/src/execution/child_process.rs:7976-8094 — 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 (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared lines) crates/native-sidecar/src/stdio.rs:4227 — crates/native-sidecar/src/stdio.rs:4227-4308 | crates/native-sidecar/src/stdio.rs:4314-4386 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) crates/kernel/src/kernel.rs:2947 — crates/kernel/src/kernel.rs:2947-3020 | crates/kernel/src/kernel.rs:3250-3318 — 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 (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) crates/native-sidecar/src/language_execution.rs:1091 — crates/native-sidecar/src/language_execution.rs:1091-1229 | crates/native-sidecar/src/language_execution.rs:2498-2645 — These two members are variants of one another: 37 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 (31 shared lines) · ×1
  • Near-duplicate member pair (31 shared lines) crates/native-sidecar/src/execution/process.rs:1843 — crates/native-sidecar/src/execution/process.rs:1843-1918 | crates/native-sidecar/src/execution/process.rs:1922-1991 — These two members are variants of one another: 31 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 (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) crates/vfs/src/posix/root_fs.rs:917 — crates/vfs/src/posix/root_fs.rs:917-949 | crates/vfs/src/posix/root_fs.rs:954-980 — 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 (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) crates/native-sidecar-core/src/guest_net.rs:321 — crates/native-sidecar-core/src/guest_net.rs:321-339 | crates/native-sidecar-core/src/guest_net.rs:432-450 — 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 (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) crates/native-sidecar/src/execution/child_process.rs:9891 — crates/native-sidecar/src/execution/child_process.rs:9891-9914 | crates/native-sidecar/src/execution/child_process.rs:9922-9944 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×1
  • Edited copy of a member (12 corresponding lines) crates/vfs-store/src/local/file_block_store.rs:125 — crates/vfs-store/src/local/file_block_store.rs:125-136 | crates/vfs/src/engine/mem/block_store.rs:38-49 — 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 · Members sharing a duplicated core (18 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (18 members, 50+ identical tokens) crates/kernel/src/kernel.rs:3686 — crates/kernel/src/kernel.rs:3686-3737 | crates/kernel/src/kernel.rs:3749-3786 | crates/kernel/src/kernel.rs:4131-4153 | crates/kernel/src/kernel.rs:4161-4178 | crates/kernel/src/kernel.rs:4186-4210 | crates/kernel/src/kernel.rs:4274-4309 | crates/kernel/src/kernel.rs:4317-4359 | crates/kernel/src/kernel.rs:4367-4423 | crates/kernel/src/kernel.rs:4432-4472 | crates/kernel/src/kernel.rs:4562-4580 | crates/kernel/src/kernel.rs:4615-4632 | crates/kernel/src/kernel.rs:4640-4657 | crates/kernel/src/kernel.rs:4665-4682 | crates/kernel/src/kernel.rs:4690-4713 | crates/kernel/src/kernel.rs:4721-4744 | crates/kernel/src/kernel.rs:4752-4770 | crates/kernel/src/kernel.rs:4778-4794 | crates/kernel/src/kernel.rs:4801-4817 — These 18 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 18 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 18 times.
D4 · Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (16 members, 50+ identical tokens) crates/kernel/src/kernel.rs:2597 — crates/kernel/src/kernel.rs:2597-2621 | crates/kernel/src/kernel.rs:2630-2657 | crates/kernel/src/kernel.rs:2666-2686 | crates/kernel/src/kernel.rs:2696-2729 | crates/kernel/src/kernel.rs:2738-2765 | crates/kernel/src/kernel.rs:2774-2798 | crates/kernel/src/kernel.rs:5060-5165 | crates/kernel/src/kernel.rs:5199-5309 | crates/kernel/src/kernel.rs:5319-5345 | crates/kernel/src/kernel.rs:5442-5489 | crates/kernel/src/kernel.rs:5498-5542 | crates/kernel/src/kernel.rs:5551-5594 | crates/kernel/src/kernel.rs:5874-5902 | crates/kernel/src/kernel.rs:5967-6016 | crates/kernel/src/kernel.rs:6104-6115 | crates/kernel/src/kernel.rs:6369-6415 — These 16 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 16 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 16 times.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) crates/vfs/src/posix/overlay_fs.rs:1815 — crates/vfs/src/posix/overlay_fs.rs:1815-1826 | crates/vfs/src/posix/overlay_fs.rs:1838-1850 | crates/vfs/src/posix/overlay_fs.rs:1960-1971 | crates/vfs/src/posix/overlay_fs.rs:1979-1991 | crates/vfs/src/posix/overlay_fs.rs:1993-2004 | crates/vfs/src/posix/overlay_fs.rs:2006-2017 | crates/vfs/src/posix/overlay_fs.rs:2019-2031 | crates/vfs/src/posix/overlay_fs.rs:2033-2045 | crates/vfs/src/posix/overlay_fs.rs:2053-2065 | crates/vfs/src/posix/overlay_fs.rs:2067-2078 | crates/vfs/src/posix/overlay_fs.rs:2128-2140 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/kernel/src/pty.rs:767 — crates/kernel/src/pty.rs:767-801 | crates/kernel/src/pty.rs:814-880 | crates/kernel/src/pty.rs:891-903 | crates/kernel/src/pty.rs:920-934 | crates/kernel/src/pty.rs:936-949 | crates/kernel/src/pty.rs:979-996 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (5–88 lines × 3) · ×1
  • Duplicated block (5–88 lines × 3) crates/execution/src/v8_ipc.rs:307 — crates/execution/src/v8_ipc.rs:307-388 | crates/v8-runtime/src/ipc_binary.rs:242-329 | crates/v8-runtime/src/ipc_binary.rs:336-340 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (77 lines × 2) · ×1
  • Duplicated block (77 lines × 2) crates/execution/src/wasm.rs:3642 — crates/execution/src/wasm.rs:3642-3718 | crates/execution/src/wasm.rs:3785-3861 — both copies are in the same file, so extract the 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 (70 lines × 2) · ×1
  • Duplicated block (70 lines × 2) crates/execution/src/v8_ipc.rs:390 — crates/execution/src/v8_ipc.rs:390-459 | crates/v8-runtime/src/ipc_binary.rs:344-413 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (62–63 lines × 2) · ×1
  • Duplicated block (62–63 lines × 2) crates/native-sidecar/src/vm.rs:824 — crates/native-sidecar/src/vm.rs:824-885 | crates/native-sidecar/src/vm.rs:1738-1800 — both copies are in the same file, so extract the 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 (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) crates/execution/src/wasm.rs:3720 — crates/execution/src/wasm.rs:3720-3775 | crates/execution/src/wasm.rs:3864-3919 — both copies are in the same file, so extract the 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 (52 lines × 2) · ×1
  • Duplicated block (52 lines × 2) crates/native-sidecar/src/language_execution.rs:1035 — crates/native-sidecar/src/language_execution.rs:1035-1086 | crates/native-sidecar/src/language_execution.rs:2445-2496 — both copies are in the same file, so extract the 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 (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) crates/native-sidecar/src/execution/process_events.rs:1055 — crates/native-sidecar/src/execution/process_events.rs:1055-1103 | crates/native-sidecar/src/execution/process_events.rs:1602-1650 — both copies are in the same file, so extract the 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 (43 lines × 4) · ×1
  • Duplicated block (43 lines × 4) crates/client/src/agent_os.rs:324 — crates/client/src/agent_os.rs:324-366 | crates/client/src/agent_os.rs:414-456 | crates/client/src/agent_os.rs:526-568 | crates/client/src/agent_os.rs:627-669 — 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) crates/execution/src/python.rs:2077 — crates/execution/src/python.rs:2077-2119 | crates/execution/src/python.rs:2160-2202 — both copies are in the same file, so extract the 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 (34–38 lines × 2) · ×1
  • Duplicated block (34–38 lines × 2) crates/native-sidecar/src/execution/coordinator.rs:903 — crates/native-sidecar/src/execution/coordinator.rs:903-940 | crates/native-sidecar/src/execution/javascript/http.rs:2412-2445 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) crates/kernel/src/socket_table.rs:1595 — crates/kernel/src/socket_table.rs:1595-1631 | crates/kernel/src/socket_table.rs:1732-1768 — both copies are in the same file, so extract the 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 (36–37 lines × 2) · ×1
  • Duplicated block (36–37 lines × 2) crates/native-sidecar/src/service.rs:3269 — crates/native-sidecar/src/service.rs:3269-3305 | crates/native-sidecar/src/service.rs:3346-3381 — both copies are in the same file, so extract the 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 (35 lines × 3) · ×1
  • Duplicated block (35 lines × 3) crates/native-sidecar/src/execution/child_process.rs:3386 — crates/native-sidecar/src/execution/child_process.rs:3386-3420 | crates/native-sidecar/src/execution/child_process.rs:3431-3465 | crates/native-sidecar/src/execution/child_process.rs:3476-3510 — 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 (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) crates/execution/src/v8_ipc.rs:192 — crates/execution/src/v8_ipc.rs:192-226 | crates/v8-runtime/src/ipc_binary.rs:469-503 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) crates/execution/src/v8_ipc.rs:269 — crates/execution/src/v8_ipc.rs:269-302 | crates/v8-runtime/src/ipc_binary.rs:568-601 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) crates/native-sidecar/src/execution/javascript/rpc.rs:3189 — crates/native-sidecar/src/execution/javascript/rpc.rs:3189-3221 | crates/native-sidecar/src/execution/javascript/rpc.rs:3413-3445 — both copies are in the same file, so extract the 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:479 — crates/native-sidecar/src/execution/network/http2.rs:479-510 | crates/native-sidecar/src/execution/network/http2.rs:680-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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) crates/execution/src/python.rs:2048 — crates/execution/src/python.rs:2048-2075 | crates/execution/src/python.rs:2130-2157 — both copies are in the same file, so extract the 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 (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) crates/native-sidecar/src/execution/javascript/rpc.rs:3178 — crates/native-sidecar/src/execution/javascript/rpc.rs:3178-3203 | crates/native-sidecar/src/execution/javascript/rpc.rs:3402-3427 | crates/native-sidecar/src/execution/javascript/rpc.rs:3928-3953 — 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 (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) crates/execution/src/v8_ipc.rs:243 — crates/execution/src/v8_ipc.rs:243-268 | crates/v8-runtime/src/ipc_binary.rs:541-566 — before extracting anything, compare `crates/execution/src/v8_ipc.rs` and `crates/v8-runtime/src/ipc_binary.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 317 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) crates/native-sidecar/src/execution/network/tls.rs:1552 — crates/native-sidecar/src/execution/network/tls.rs:1552-1577 | crates/native-sidecar/src/execution/network/tls.rs:1757-1781 — both copies are in the same file, so extract the 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–25 lines × 3) · ×1
  • Duplicated block (24–25 lines × 3) crates/native-sidecar/src/execution/child_process.rs:4992 — crates/native-sidecar/src/execution/child_process.rs:4992-5016 | crates/native-sidecar/src/execution/child_process.rs:5656-5680 | crates/native-sidecar/src/execution/launch.rs:5252-5275 — before extracting anything, compare `crates/native-sidecar/src/execution/child_process.rs` and `crates/native-sidecar/src/execution/launch.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) crates/client/src/command_line.rs:24 — crates/client/src/command_line.rs:24-48 | crates/native-sidecar/src/execution/launch.rs:4512-4536 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) crates/native-sidecar/src/execution/network/http2.rs:835 — crates/native-sidecar/src/execution/network/http2.rs:835-859 | crates/native-sidecar/src/execution/network/http2.rs:888-909 — both copies are in the same file, so extract the 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 (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) crates/native-sidecar/src/vm.rs:924 — crates/native-sidecar/src/vm.rs:924-946 | crates/native-sidecar/src/vm.rs:1836-1860 — both copies are in the same file, so extract the 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 (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) crates/v8-runtime/src/execution.rs:461 — crates/v8-runtime/src/execution.rs:461-484 | crates/v8-runtime/src/execution.rs:509-530 — both copies are in the same file, so extract the 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) crates/native-sidecar/src/execution/child_process.rs:2933 — crates/native-sidecar/src/execution/child_process.rs:2933-2955 | crates/native-sidecar/src/execution/child_process.rs:3794-3816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) crates/native-sidecar/src/execution/child_process.rs:8499 — crates/native-sidecar/src/execution/child_process.rs:8499-8519 | crates/native-sidecar/src/execution/stdio.rs:649-671 — 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) crates/sidecar-protocol/src/protocol.rs:2385 — crates/sidecar-protocol/src/protocol.rs:2385-2406 | crates/sidecar-protocol/src/wire.rs:929-951 — before extracting anything, compare `crates/sidecar-protocol/src/protocol.rs` and `crates/sidecar-protocol/src/wire.rs` as WHOLE FILES: this scan already matched 3 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.
D4 · Code Duplication · Duplicated block (17–21 lines × 4) · ×1
  • Duplicated block (17–21 lines × 4) crates/native-sidecar/src/stdio.rs:2634 — crates/native-sidecar/src/stdio.rs:2634-2654 | crates/native-sidecar/src/stdio.rs:2656-2676 | crates/native-sidecar/src/stdio.rs:2678-2698 | crates/native-sidecar/src/stdio.rs:2700-2716 — 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) crates/native-sidecar/src/filesystem.rs:4040 — crates/native-sidecar/src/filesystem.rs:4040-4060 | crates/native-sidecar/src/filesystem.rs:4090-4109 — both copies are in the same file, so extract the 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 (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) crates/native-sidecar/src/execution/javascript/rpc.rs:3687 — crates/native-sidecar/src/execution/javascript/rpc.rs:3687-3704 | crates/native-sidecar/src/execution/javascript/rpc.rs:4359-4376 | crates/native-sidecar/src/execution/javascript/rpc.rs:4548-4565 — 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 (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) crates/kernel/src/dns.rs:269 — crates/kernel/src/dns.rs:269-284 | crates/kernel/src/dns.rs:299-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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) crates/native-sidecar/src/execution/child_process.rs:4139 — crates/native-sidecar/src/execution/child_process.rs:4139-4153 | crates/native-sidecar/src/execution/child_process.rs:4349-4365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) toolchain/crates/libs/wasi-http/src/lib.rs:477 — toolchain/crates/libs/wasi-http/src/lib.rs:477-493 | toolchain/crates/libs/wasi-http/src/lib.rs:518-530 — both copies are in the same file, so extract the 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–15 lines × 3) · ×1
  • Duplicated block (11–15 lines × 3) crates/execution/src/wasm.rs:1701 — crates/execution/src/wasm.rs:1701-1711 | crates/execution/src/wasm.rs:1723-1733 | crates/execution/src/wasm.rs:1836-1850 — 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 (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) crates/native-sidecar/src/execution/javascript/http.rs:819 — crates/native-sidecar/src/execution/javascript/http.rs:819-830 | crates/native-sidecar/src/execution/javascript/http.rs:2579-2593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) crates/v8-runtime/src/bridge.rs:1857 — crates/v8-runtime/src/bridge.rs:1857-1869 | crates/v8-runtime/src/bridge.rs:2047-2061 — both copies are in the same file, so extract the 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) crates/execution/src/wasm.rs:1636 — crates/execution/src/wasm.rs:1636-1646 | crates/execution/src/wasm.rs:1663-1676 — both copies are in the same file, so extract the 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 (4–14 lines × 3) · ×1
  • Duplicated block (4–14 lines × 3) crates/native-sidecar-core/src/guest_net.rs:322 — crates/native-sidecar-core/src/guest_net.rs:322-335 | crates/native-sidecar-core/src/guest_net.rs:433-446 | crates/native-sidecar-core/src/guest_pty.rs:94-97 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) crates/native-sidecar/src/execution/javascript/sqlite.rs:343 — crates/native-sidecar/src/execution/javascript/sqlite.rs:343-356 | crates/native-sidecar/src/execution/javascript/sqlite.rs:369-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) crates/execution/src/wasm.rs:1634 — crates/execution/src/wasm.rs:1634-1646 | crates/execution/src/wasm.rs:1661-1673 | crates/execution/src/wasm.rs:1699-1711 | crates/execution/src/wasm.rs:1721-1733 | crates/execution/src/wasm.rs:1834-1846 — 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 (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) crates/native-sidecar/src/language_execution.rs:283 — crates/native-sidecar/src/language_execution.rs:283-295 | crates/native-sidecar/src/language_execution.rs:304-316 | crates/native-sidecar/src/language_execution.rs:326-338 — 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 (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) crates/execution/src/wasm.rs:1228 — crates/execution/src/wasm.rs:1228-1240 | crates/execution/src/wasm.rs:1305-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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) crates/native-sidecar/src/execution/child_process.rs:213 — crates/native-sidecar/src/execution/child_process.rs:213-223 | crates/native-sidecar/src/execution/child_process.rs:4419-4431 — both copies are in the same file, so extract the 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 (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) crates/native-sidecar/src/execution/network/tls.rs:1058 — crates/native-sidecar/src/execution/network/tls.rs:1058-1066 | crates/native-sidecar/src/execution/network/tls.rs:1117-1129 — both copies are in the same file, so extract the 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 (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) crates/execution/src/javascript.rs:134 — crates/execution/src/javascript.rs:134-145 | crates/native-sidecar/src/execution/process_events.rs:425-436 | crates/native-sidecar/src/filesystem.rs:1460-1471 | crates/v8-runtime/src/session.rs:583-594 — before extracting anything, compare `crates/execution/src/javascript.rs` and `crates/native-sidecar/src/execution/process_events.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) crates/native-sidecar/src/execution/child_process.rs:3518 — crates/native-sidecar/src/execution/child_process.rs:3518-3528 | crates/native-sidecar/src/execution/child_process.rs:3550-3560 | crates/native-sidecar/src/execution/child_process.rs:9245-9255 | crates/native-sidecar/src/execution/child_process.rs:9651-9661 | crates/native-sidecar/src/execution/child_process.rs:9699-9709 — 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 (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) crates/native-sidecar/src/execution/child_process.rs:9027 — crates/native-sidecar/src/execution/child_process.rs:9027-9036 | crates/native-sidecar/src/execution/child_process.rs:9096-9105 | crates/native-sidecar/src/execution/child_process.rs:9586-9596 — 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 (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) crates/kernel/src/pty.rs:768 — crates/kernel/src/pty.rs:768-777 | crates/kernel/src/pty.rs:815-824 | crates/kernel/src/pty.rs:892-901 | crates/kernel/src/pty.rs:921-930 | crates/kernel/src/pty.rs:937-946 | crates/kernel/src/pty.rs:980-989 — 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 (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) crates/native-sidecar/src/filesystem.rs:414 — crates/native-sidecar/src/filesystem.rs:414-423 | crates/native-sidecar/src/filesystem.rs:457-466 | crates/native-sidecar/src/filesystem.rs:4053-4062 | crates/native-sidecar/src/filesystem.rs:4102-4111 | crates/native-sidecar/src/plugins/host_dir.rs:1017-1026 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9–10 lines × 5) · ×1
  • Duplicated block (9–10 lines × 5) crates/vfs/src/posix/overlay_fs.rs:2007 — crates/vfs/src/posix/overlay_fs.rs:2007-2015 | crates/vfs/src/posix/overlay_fs.rs:2020-2029 | crates/vfs/src/posix/overlay_fs.rs:2034-2043 | crates/vfs/src/posix/overlay_fs.rs:2054-2063 | crates/vfs/src/posix/overlay_fs.rs:2068-2076 — 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 (3–10 lines × 3) · ×1
  • Duplicated block (3–10 lines × 3) crates/v8-runtime/src/session.rs:2907 — crates/v8-runtime/src/session.rs:2907-2916 | crates/v8-runtime/src/session.rs:2964-2973 | crates/v8-runtime/src/session.rs:3116-3118 — 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 (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) crates/vfs/src/engine/types.rs:542 — crates/vfs/src/engine/types.rs:542-549 | crates/vfs/src/posix/vfs.rs:178-187 — before extracting anything, compare `crates/vfs/src/engine/types.rs` and `crates/vfs/src/posix/vfs.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 18) · ×1
  • Duplicated block (9 lines × 18) crates/kernel/src/kernel.rs:3690 — crates/kernel/src/kernel.rs:3690-3698 | crates/kernel/src/kernel.rs:3753-3761 | crates/kernel/src/kernel.rs:4134-4142 | crates/kernel/src/kernel.rs:4164-4172 | crates/kernel/src/kernel.rs:4189-4197 | crates/kernel/src/kernel.rs:4277-4285 | crates/kernel/src/kernel.rs:4320-4328 | crates/kernel/src/kernel.rs:4370-4378 | crates/kernel/src/kernel.rs:4435-4443 | crates/kernel/src/kernel.rs:4565-4573 | crates/kernel/src/kernel.rs:4618-4626 | crates/kernel/src/kernel.rs:4643-4651 | crates/kernel/src/kernel.rs:4668-4676 | crates/kernel/src/kernel.rs:4693-4701 | crates/kernel/src/kernel.rs:4724-4732 | crates/kernel/src/kernel.rs:4755-4763 | crates/kernel/src/kernel.rs:4781-4789 | crates/kernel/src/kernel.rs:4804-4812 — all 18 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 × 12) · ×1
  • Duplicated block (9 lines × 12) crates/kernel/src/kernel.rs:2598 — crates/kernel/src/kernel.rs:2598-2606 | crates/kernel/src/kernel.rs:2631-2639 | crates/kernel/src/kernel.rs:2667-2675 | crates/kernel/src/kernel.rs:2697-2705 | crates/kernel/src/kernel.rs:2739-2747 | crates/kernel/src/kernel.rs:2775-2783 | crates/kernel/src/kernel.rs:5061-5069 | crates/kernel/src/kernel.rs:5443-5451 | crates/kernel/src/kernel.rs:5875-5883 | crates/kernel/src/kernel.rs:5968-5976 | crates/kernel/src/kernel.rs:6105-6113 | crates/kernel/src/kernel.rs:6370-6378 — all 12 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 (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) crates/kernel/src/kernel.rs:2632 — crates/kernel/src/kernel.rs:2632-2639 | crates/kernel/src/kernel.rs:2668-2675 | crates/kernel/src/kernel.rs:2698-2705 | crates/kernel/src/kernel.rs:2740-2747 | crates/kernel/src/kernel.rs:2776-2783 | crates/kernel/src/kernel.rs:5062-5069 | crates/kernel/src/kernel.rs:5501-5508 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/native-sidecar/src/vm.rs:4789 — crates/native-sidecar/src/vm.rs:4789-4795 | crates/vfs/src/posix/root_fs.rs:859-865 | crates/vfs/src/posix/root_fs.rs:987-994 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (4–8 lines × 3) · ×1
  • Duplicated block (4–8 lines × 3) crates/vfs-store/src/local/file_block_store.rs:129 — crates/vfs-store/src/local/file_block_store.rs:129-136 | crates/vfs/src/engine/mem/block_store.rs:42-49 | crates/vfs/src/engine/mem/object_backend.rs:77-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) crates/vfs/src/posix/vfs.rs:1927 — crates/vfs/src/posix/vfs.rs:1927-1933 | crates/vfs/src/posix/vfs.rs:1961-1967 | crates/vfs/src/posix/vfs.rs:1996-2002 | crates/vfs/src/posix/vfs.rs:2048-2054 | crates/vfs/src/posix/vfs.rs:2074-2080 — 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 (6–7 lines × 4) · ×1
  • Duplicated block (6–7 lines × 4) crates/vfs/src/posix/overlay_fs.rs:153 — crates/vfs/src/posix/overlay_fs.rs:153-159 | crates/vfs/src/posix/overlay_fs.rs:232-237 | crates/vfs/src/posix/vfs.rs:961-967 | crates/vfs/src/posix/vfs.rs:1491-1497 — 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.
D4 · Code Duplication · Duplicated block (5–7 lines × 3) · ×1
  • Duplicated block (5–7 lines × 3) crates/vfs/src/posix/mount_table.rs:2053 — crates/vfs/src/posix/mount_table.rs:2053-2057 | crates/vfs/src/posix/mount_table.rs:2065-2071 | crates/vfs/src/posix/mount_table.rs:2101-2107 — 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 (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) crates/native-sidecar/src/language_execution.rs:567 — crates/native-sidecar/src/language_execution.rs:567-570 | crates/native-sidecar/src/language_execution.rs:601-607 | crates/native-sidecar/src/language_execution.rs:619-625 — 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 (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) crates/vfs/src/adapter/mounted_fs.rs:259 — crates/vfs/src/adapter/mounted_fs.rs:259-263 | crates/vfs/src/adapter/mounted_fs.rs:276-280 | crates/vfs/src/adapter/mounted_fs.rs:301-305 | crates/vfs/src/adapter/mounted_fs.rs:359-363 | crates/vfs/src/adapter/mounted_fs.rs:405-409 — 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) · ×1
  • Duplicated block (7 lines × 4) crates/client/src/fs.rs:421 — crates/client/src/fs.rs:421-427 | crates/client/src/net.rs:305-311 | crates/client/src/process.rs:1577-1583 | crates/client/src/shell.rs:294-300 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) crates/native-sidecar/src/execution/coordinator.rs:537 — crates/native-sidecar/src/execution/coordinator.rs:537-541 | crates/native-sidecar/src/execution/coordinator.rs:565-569 | crates/native-sidecar/src/execution/coordinator.rs:815-819 | crates/native-sidecar/src/execution/signals.rs:605-609 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 6) · ×1
  • Duplicated block (17 lines × 6) crates/native-sidecar/src/stdio.rs:2106 — crates/native-sidecar/src/stdio.rs:2106-2122 | crates/native-sidecar/src/stdio.rs:2137-2153 | crates/native-sidecar/src/stdio.rs:2168-2184 | crates/native-sidecar/src/stdio.rs:2204-2220 | crates/native-sidecar/src/stdio.rs:2237-2253 | crates/native-sidecar/src/stdio.rs:2448-2464 — 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 (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) toolchain/crates/libs/shims/src/nice.rs:49 — toolchain/crates/libs/shims/src/nice.rs:49-58 | toolchain/crates/libs/shims/src/nohup.rs:29-38 | toolchain/crates/libs/shims/src/stdbuf.rs:52-61 | toolchain/crates/libs/shims/src/xargs.rs:226-235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) crates/native-sidecar/src/execution/launch.rs:968 — crates/native-sidecar/src/execution/launch.rs:968-976 | crates/native-sidecar/src/execution/launch.rs:998-1006 | crates/native-sidecar/src/execution/launch.rs:1470-1478 | crates/native-sidecar/src/filesystem.rs:5407-5415 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 11) · ×1
  • Duplicated block (9 lines × 11) crates/vfs/src/posix/overlay_fs.rs:1816 — crates/vfs/src/posix/overlay_fs.rs:1816-1824 | crates/vfs/src/posix/overlay_fs.rs:1839-1847 | crates/vfs/src/posix/overlay_fs.rs:1961-1969 | crates/vfs/src/posix/overlay_fs.rs:1980-1988 | crates/vfs/src/posix/overlay_fs.rs:1994-2002 | crates/vfs/src/posix/overlay_fs.rs:2007-2015 | crates/vfs/src/posix/overlay_fs.rs:2020-2028 | crates/vfs/src/posix/overlay_fs.rs:2034-2042 | crates/vfs/src/posix/overlay_fs.rs:2054-2062 | crates/vfs/src/posix/overlay_fs.rs:2068-2076 | crates/vfs/src/posix/overlay_fs.rs:2129-2137 — 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.
D5 · Coupling · Unstable project @agentos-software/common · ×1
  • Unstable project @agentos-software/common — @agentos-software/common has instability 0.89 with 1 dependents.
P12 · CI test-gate honesty · CI test gate excludes suites by filter · ×1
  • CI test gate excludes suites by filter REDACTED:255 — `pnpm --dir packages/runtime-core test:pr` drops 182 test(s) in 28 file(s) (e.g. `packages/runtime-core/tests/integration/bridge-child-process.nightly.test.ts`, `packages/runtime-core/tests/integration/cross-runtime-network.nightly.test.ts`), and no other gate runs them before merge. Run what it excludes in another job before merge (a complementary selection), or remove the exclusion.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (80 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (80 clone groups) packages/runtime-browser/src/os-filesystem.ts:44 — 80 duplicated blocks under packages/ have copies in at least two of the sibling directories build-tools, core, manifest, runtime-browser, runtime-core — 68 of them are reported below, and 12 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 80 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 80 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 80 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 (331 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (331 matched lines × 2 locations) packages/runtime-browser/src/os-filesystem.ts:44 — packages/runtime-browser/src/os-filesystem.ts:44 · packages/runtime-core/src/test-runtime.ts:649 — the two spans are one implementation copied and then locally edited — 2203 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 (278 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (278 matched lines × 2 locations) REDACTED:1259 — REDACTED:1259 · REDACTED:1027 — the two spans are one implementation copied and then locally edited — 1499 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 (270 lines × 2 locations) · ×1
  • Duplicated block (270 lines × 2 locations) REDACTED:1759 — REDACTED:1759 · packages/runtime-core/src/test-runtime.ts:2461 — 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 (206 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (206 matched lines × 2 locations) REDACTED:2770 — REDACTED:2770 · REDACTED:2173 — the two spans are one implementation copied and then locally edited — 1242 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 (205 lines × 2 locations) · ×1
  • Duplicated block (205 lines × 2 locations) REDACTED:822 — REDACTED:822 · packages/runtime-core/src/test-runtime.ts:1385 — 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.
R10 · Code Duplication · Duplicated block with local edits (169 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (169 matched lines × 2 locations) REDACTED:2205 — REDACTED:2205 · packages/runtime-core/src/test-runtime.ts:2862 — the two spans are one implementation copied and then locally edited — 983 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 (160 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (160 matched lines × 2 locations) packages/core/src/runtime.ts:1 — packages/core/src/runtime.ts:1 · packages/runtime-core/src/test-runtime.ts:123 — the two spans are one implementation copied and then locally edited — 1016 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 (152 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (152 matched lines × 2 locations) REDACTED:2443 — REDACTED:2443 · packages/runtime-core/src/test-runtime.ts:3217 — the two spans are one implementation copied and then locally edited — 786 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 (135 lines × 2 locations) · ×1
  • Duplicated block (135 lines × 2 locations) REDACTED:322 — REDACTED:322 · packages/core/src/runtime.ts:203 — 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.
R10 · Code Duplication · Duplicated block (115 lines × 2 locations) · ×1
  • Duplicated block (115 lines × 2 locations) REDACTED:1052 — REDACTED:1052 · REDACTED:839 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (110 lines × 2 locations) · ×1
  • Duplicated block (110 lines × 2 locations) crates/execution/assets/runners/python-runner.mjs:479 — crates/execution/assets/runners/python-runner.mjs:479 · crates/execution/assets/runners/python-runner.mjs:706 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (109 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (109 matched lines × 2 locations) REDACTED:352 — REDACTED:352 · REDACTED:236 — the two spans are one implementation copied and then locally edited — 595 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 · Wholesale file copy (104 identical lines × 2 files) · ×1
  • Wholesale file copy (104 identical lines × 2 files) packages/core/src/sidecar/cargo.ts:1 — packages/core/src/sidecar/cargo.ts:1 · packages/runtime-core/src/cargo.ts:1 — these 2 files are line-for-line copies of one another — 104 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block with local edits (101 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (101 matched lines × 2 locations) packages/runtime-browser/src/converged-net-bridge.ts:70 — packages/runtime-browser/src/converged-net-bridge.ts:70 · packages/runtime-browser/src/converged-pty-bridge.ts:54 — the two spans are one implementation copied and then locally edited — 541 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 (98 lines × 2 locations) · ×1
  • Duplicated block (98 lines × 2 locations) packages/build-tools/bridge-src/builtins/child-process.ts:809 — packages/build-tools/bridge-src/builtins/child-process.ts:809 · packages/build-tools/bridge-src/builtins/child-process.ts:948 — 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 (95 lines × 2 locations) · ×1
  • Duplicated block (95 lines × 2 locations) REDACTED:1890 — REDACTED:1890 · REDACTED:1490 — 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 (88 lines × 2 locations) · ×1
  • Duplicated block (88 lines × 2 locations) REDACTED:2502 — REDACTED:2502 · REDACTED:1918 — 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 (87 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (87 matched lines × 2 locations) REDACTED:2087 — REDACTED:2087 · packages/runtime-core/src/test-runtime.ts:2747 — the two spans are one implementation copied and then locally edited — 578 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 (78 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (78 matched lines × 2 locations) packages/runtime-core/src/sidecar-process.ts:739 — packages/runtime-core/src/sidecar-process.ts:739 · packages/runtime-core/src/sidecar-process.ts:1581 — the two spans are one implementation copied and then locally edited — 352 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 (77 lines × 2 locations) · ×1
  • Duplicated block (77 lines × 2 locations) REDACTED:265 — REDACTED:265 · REDACTED:154 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (76 lines × 2 locations) · ×1
  • Duplicated block (76 lines × 2 locations) REDACTED:1387 — REDACTED:1387 · packages/runtime-core/src/test-runtime.ts:1972 — 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 (71 lines × 2 locations) · ×1
  • Duplicated block (71 lines × 2 locations) crates/execution/assets/undici-shims/http.js:3 — crates/execution/assets/undici-shims/http.js:3 · crates/execution/assets/undici-shims/https.js:3 — 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.
R10 · Code Duplication · Duplicated block with local edits (68 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (68 matched lines × 2 locations) packages/build-tools/bridge-src/builtins/builtin-modules.ts:349 — packages/build-tools/bridge-src/builtins/builtin-modules.ts:349 · packages/build-tools/bridge-src/builtins/stdin.ts:379 — the two spans are one implementation copied and then locally edited — 423 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 (54 lines × 2 locations) · ×1
  • Duplicated block (54 lines × 2 locations) REDACTED:763 — REDACTED:763 · packages/runtime-core/src/test-runtime.ts:1272 — 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 (52 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (52 matched lines × 2 locations) crates/execution/assets/runners/wasi-module.js:2709 — crates/execution/assets/runners/wasi-module.js:2709 · crates/execution/assets/runners/wasm-runner.mjs:12222 — the two spans are one implementation copied and then locally edited — 342 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 (52 lines × 2 locations) · ×1
  • Duplicated block (52 lines × 2 locations) REDACTED:1231 — REDACTED:1231 · packages/runtime-core/src/test-runtime.ts:1795 — 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 (50 lines × 2 locations) · ×1
  • Duplicated block (50 lines × 2 locations) REDACTED:55 — REDACTED:55 · packages/runtime-core/src/test-runtime.ts:58 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) REDACTED:2672 — REDACTED:2672 · REDACTED:2088 — 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 (45 lines × 2 locations) · ×1
  • Duplicated block (45 lines × 2 locations) packages/core/src/options-schema.ts:61 — packages/core/src/options-schema.ts:61 · packages/runtime-core/src/node-runtime-options-schema.ts:43 — 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 (44 lines × 2 locations) · ×1
  • Duplicated block (44 lines × 2 locations) REDACTED:758 — REDACTED:758 · REDACTED:641 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (43 lines × 2 locations) · ×1
  • Duplicated block (43 lines × 2 locations) crates/execution/assets/runners/wasm-runner.mjs:3428 — crates/execution/assets/runners/wasm-runner.mjs:3428 · crates/execution/assets/runners/wasm-runner.mjs:6345 — both copies are in the same file, so extract the 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 (38 lines × 2 locations) · ×1
  • Duplicated block (38 lines × 2 locations) secure-exec/src/index.ts:55 — secure-exec/src/index.ts:55 · secure-exec/src/typescript.ts:22 — 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.
R2 · Cyclomatic Complexity · Complex function toGeneratedRequestPayload (cyclomatic 116, cognitive 49) · ×1
  • Complex function toGeneratedRequestPayload (cyclomatic 116, cognitive 49) packages/runtime-core/src/request-payloads.ts:405 — toGeneratedRequestPayload has cyclomatic complexity 116 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 net_poll (cyclomatic 99, cognitive 227) · ×1
  • Complex function net_poll (cyclomatic 99, cognitive 227) crates/execution/assets/runners/wasm-runner.mjs:5344 — net_poll has cyclomatic complexity 99 and cognitive complexity 227; 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 _pollOneoff (cyclomatic 77, cognitive 134) · ×1
  • Complex function _pollOneoff (cyclomatic 77, cognitive 134) crates/execution/assets/runners/wasi-module.js:2495 — _pollOneoff has cyclomatic complexity 77 and cognitive complexity 134; 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 _pumpBridgeReads (cyclomatic 69, cognitive 122) · ×1
  • Complex function _pumpBridgeReads (cyclomatic 69, cognitive 122) packages/build-tools/bridge-src/builtins/net.ts:2735 — _pumpBridgeReads has cyclomatic complexity 69 and cognitive complexity 122; 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 fromGeneratedResponsePayload (cyclomatic 66, cognitive 29) · ×1
  • Complex function fromGeneratedResponsePayload (cyclomatic 66, cognitive 29) packages/runtime-core/src/response-payloads.ts:329 — fromGeneratedResponsePayload has cyclomatic complexity 66 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 http2Dispatch (cyclomatic 62, cognitive 81) · ×1
  • Complex function http2Dispatch (cyclomatic 62, cognitive 81) packages/build-tools/bridge-src/builtins/http2.ts:1994 — http2Dispatch has cyclomatic complexity 62 and cognitive complexity 81; 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 poll_oneoff (cyclomatic 61, cognitive 102) · ×1
  • Complex function poll_oneoff (cyclomatic 61, cognitive 102) crates/execution/assets/runners/wasm-runner.mjs:12064 — poll_oneoff has cyclomatic complexity 61 and cognitive complexity 102; 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 _fdRead (cyclomatic 58, cognitive 103) · ×1
  • Complex function _fdRead (cyclomatic 58, cognitive 103) crates/execution/assets/runners/wasi-module.js:1677 — _fdRead has cyclomatic complexity 58 and cognitive complexity 103; 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 net_recv (cyclomatic 56, cognitive 84) · ×1
  • Complex function net_recv (cyclomatic 56, cognitive 84) crates/execution/assets/runners/wasm-runner.mjs:6238 — net_recv has cyclomatic complexity 56 and cognitive complexity 84; 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 55, cognitive 73) · ×1
  • Complex function (anonymous) (cyclomatic 55, cognitive 73) packages/core/src/test/sandbox-agent.ts:238 — (anonymous) has cyclomatic complexity 55 and cognitive complexity 73; 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 decodeSpawnActions (cyclomatic 52, cognitive 97) · ×1
  • Complex function decodeSpawnActions (cyclomatic 52, cognitive 97) crates/execution/assets/runners/wasm-runner.mjs:1614 — decodeSpawnActions has cyclomatic complexity 52 and cognitive complexity 97; 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 _fdWrite (cyclomatic 51, cognitive 71) · ×1
  • Complex function _fdWrite (cyclomatic 51, cognitive 71) crates/execution/assets/runners/wasi-module.js:1404 — _fdWrite has cyclomatic complexity 51 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function spawnSync (cyclomatic 51, cognitive 60) · ×1
  • Complex function spawnSync (cyclomatic 51, cognitive 60) packages/build-tools/bridge-src/builtins/child-process.ts:1535 — spawnSync has cyclomatic complexity 51 and cognitive complexity 60; 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 fd_recvmsg_rights (cyclomatic 49, cognitive 77) · ×1
  • Complex function fd_recvmsg_rights (cyclomatic 49, cognitive 77) crates/execution/assets/runners/wasm-runner.mjs:8466 — fd_recvmsg_rights has cyclomatic complexity 49 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function proc_spawn_v2 (cyclomatic 49, cognitive 48) · ×1
  • Complex function proc_spawn_v2 (cyclomatic 49, cognitive 48) crates/execution/assets/runners/wasm-runner.mjs:6842 — proc_spawn_v2 has cyclomatic complexity 49 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 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 fd_read (cyclomatic 45, cognitive 78) · ×1
  • Complex function fd_read (cyclomatic 45, cognitive 78) crates/execution/assets/runners/wasm-runner.mjs:10639 — fd_read has cyclomatic complexity 45 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function spawn (cyclomatic 42, cognitive 59) · ×1
  • Complex function spawn (cyclomatic 42, cognitive 59) packages/build-tools/bridge-src/builtins/child-process.ts:1361 — spawn has cyclomatic complexity 42 and cognitive complexity 59; 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 path_open (cyclomatic 41, cognitive 56) · ×1
  • Complex function path_open (cyclomatic 41, cognitive 56) crates/execution/assets/runners/wasm-runner.mjs:10082 — path_open has cyclomatic complexity 41 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · crates/execution/assets/runners/wasm-runner.mjs · ×1
  • crates/execution/assets/runners/wasm-runner.mjs: 12045 lines of code crates/execution/assets/runners/wasm-runner.mjs:1 — crates/execution/assets/runners/wasm-runner.mjs has 12045 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 · packages/core/src/agent-os.ts · ×1
  • packages/core/src/agent-os.ts: 6149 lines of code packages/core/src/agent-os.ts:1 — packages/core/src/agent-os.ts has 6149 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 · packages/runtime-browser/src/runtime.ts · ×1
  • packages/runtime-browser/src/runtime.ts: 4831 lines of code packages/runtime-browser/src/runtime.ts:1 — packages/runtime-browser/src/runtime.ts has 4831 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 · packages/build-tools/bridge-src/builtins/http.ts · ×1
  • packages/build-tools/bridge-src/builtins/http.ts: 4648 lines of code packages/build-tools/bridge-src/builtins/http.ts:1 — packages/build-tools/bridge-src/builtins/http.ts has 4648 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 4312 lines of code REDACTED:1 — REDACTED has 4312 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 · packages/build-tools/bridge-src/builtins/net.ts · ×1
  • packages/build-tools/bridge-src/builtins/net.ts: 3798 lines of code packages/build-tools/bridge-src/builtins/net.ts:1 — packages/build-tools/bridge-src/builtins/net.ts has 3798 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 · packages/runtime-browser/src/worker.ts · ×1
  • packages/runtime-browser/src/worker.ts: 3562 lines of code packages/runtime-browser/src/worker.ts:1 — packages/runtime-browser/src/worker.ts has 3562 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 3428 lines of code REDACTED:1 — REDACTED has 3428 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 · packages/runtime-core/src/test-runtime.ts · ×1
  • packages/runtime-core/src/test-runtime.ts: 3233 lines of code packages/runtime-core/src/test-runtime.ts:1 — packages/runtime-core/src/test-runtime.ts has 3233 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 · crates/execution/assets/runners/wasi-module.js · ×1
  • crates/execution/assets/runners/wasi-module.js: 2685 lines of code crates/execution/assets/runners/wasi-module.js:1 — crates/execution/assets/runners/wasi-module.js has 2685 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 · packages/build-tools/bridge-src/builtins/http2.ts · ×1
  • packages/build-tools/bridge-src/builtins/http2.ts: 2473 lines of code packages/build-tools/bridge-src/builtins/http2.ts:1 — packages/build-tools/bridge-src/builtins/http2.ts has 2473 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2442 lines of code REDACTED:1 — REDACTED has 2442 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 · crates/execution/assets/runners/python-runner.mjs · ×1
  • crates/execution/assets/runners/python-runner.mjs: 2388 lines of code crates/execution/assets/runners/python-runner.mjs:1 — crates/execution/assets/runners/python-runner.mjs has 2388 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2345 lines of code REDACTED:1 — REDACTED has 2345 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 · packages/runtime-core/src/sidecar-process.ts · ×1
  • packages/runtime-core/src/sidecar-process.ts: 1954 lines of code packages/runtime-core/src/sidecar-process.ts:1 — packages/runtime-core/src/sidecar-process.ts has 1954 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 · packages/build-tools/bridge-src/builtins/child-process.ts · ×1
  • packages/build-tools/bridge-src/builtins/child-process.ts: 1810 lines of code packages/build-tools/bridge-src/builtins/child-process.ts:1 — packages/build-tools/bridge-src/builtins/child-process.ts has 1810 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 · packages/build-tools/bridge-src/global-exposure.ts · ×1
  • packages/build-tools/bridge-src/global-exposure.ts: 1681 lines of code packages/build-tools/bridge-src/global-exposure.ts:1 — packages/build-tools/bridge-src/global-exposure.ts has 1681 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 · packages/runtime-core/src/node-runtime.ts · ×1
  • packages/runtime-core/src/node-runtime.ts: 1397 lines of code packages/runtime-core/src/node-runtime.ts:1 — packages/runtime-core/src/node-runtime.ts has 1397 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 · packages/build-tools/bridge-src/builtins/dgram.ts · ×1
  • packages/build-tools/bridge-src/builtins/dgram.ts: 1323 lines of code packages/build-tools/bridge-src/builtins/dgram.ts:1 — packages/build-tools/bridge-src/builtins/dgram.ts has 1323 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 · packages/build-tools/bridge-src/builtins/crypto.ts · ×1
  • packages/build-tools/bridge-src/builtins/crypto.ts: 1257 lines of code packages/build-tools/bridge-src/builtins/crypto.ts:1 — packages/build-tools/bridge-src/builtins/crypto.ts has 1257 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 · packages/build-tools/bridge-src/builtins/process.ts · ×1
  • packages/build-tools/bridge-src/builtins/process.ts: 1167 lines of code packages/build-tools/bridge-src/builtins/process.ts:1 — packages/build-tools/bridge-src/builtins/process.ts has 1167 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 · packages/runtime-browser/src/runtime-driver.ts · ×1
  • packages/runtime-browser/src/runtime-driver.ts: 1104 lines of code packages/runtime-browser/src/runtime-driver.ts:1 — packages/runtime-browser/src/runtime-driver.ts has 1104 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 · packages/build-tools/bridge-src/builtins/builtin-modules.ts · ×1
  • packages/build-tools/bridge-src/builtins/builtin-modules.ts: 1056 lines of code packages/build-tools/bridge-src/builtins/builtin-modules.ts:1 — packages/build-tools/bridge-src/builtins/builtin-modules.ts has 1056 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 · packages/typescript/src/index.ts · ×1
  • packages/typescript/src/index.ts: 864 lines of code packages/typescript/src/index.ts:1 — packages/typescript/src/index.ts has 864 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 · packages/runtime-core/src/request-payloads.ts · ×1
  • packages/runtime-core/src/request-payloads.ts: 796 lines of code packages/runtime-core/src/request-payloads.ts:1 — packages/runtime-core/src/request-payloads.ts has 796 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 · packages/runtime-core/src/response-payloads.ts · ×1
  • packages/runtime-core/src/response-payloads.ts: 744 lines of code packages/runtime-core/src/response-payloads.ts:1 — packages/runtime-core/src/response-payloads.ts has 744 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 · packages/shell/src/main.ts · ×1
  • packages/shell/src/main.ts: 699 lines of code packages/shell/src/main.ts:1 — packages/shell/src/main.ts has 699 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 · packages/build-tools/bridge-src/builtins/misc-stubs.ts · ×1
  • packages/build-tools/bridge-src/builtins/misc-stubs.ts: 678 lines of code packages/build-tools/bridge-src/builtins/misc-stubs.ts:1 — packages/build-tools/bridge-src/builtins/misc-stubs.ts has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/runtime-core/src/protocol-client.ts · ×1
  • packages/runtime-core/src/protocol-client.ts: 563 lines of code packages/runtime-core/src/protocol-client.ts:1 — packages/runtime-core/src/protocol-client.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.
R3 · Large Files · packages/runtime-core/src/event-buffer.ts · ×1
  • packages/runtime-core/src/event-buffer.ts: 557 lines of code packages/runtime-core/src/event-buffer.ts:1 — packages/runtime-core/src/event-buffer.ts has 557 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 · packages/build-tools/bridge-src/builtins/timers.ts · ×1
  • packages/build-tools/bridge-src/builtins/timers.ts: 525 lines of code packages/build-tools/bridge-src/builtins/timers.ts:1 — packages/build-tools/bridge-src/builtins/timers.ts has 525 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 · packages/build-tools/bridge-src/builtins/console.ts · ×1
  • packages/build-tools/bridge-src/builtins/console.ts: 521 lines of code packages/build-tools/bridge-src/builtins/console.ts:1 — packages/build-tools/bridge-src/builtins/console.ts has 521 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 · packages/agentos-toolchain/src/aospkg.ts · ×1
  • packages/agentos-toolchain/src/aospkg.ts: 516 lines of code packages/agentos-toolchain/src/aospkg.ts:1 — packages/agentos-toolchain/src/aospkg.ts has 516 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 · scripts/pipboy/src/cli.ts · ×1
  • scripts/pipboy/src/cli.ts: 481 lines of code scripts/pipboy/src/cli.ts:1 — scripts/pipboy/src/cli.ts has 481 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 · packages/core/src/sandbox.ts · ×1
  • packages/core/src/sandbox.ts: 460 lines of code packages/core/src/sandbox.ts:1 — packages/core/src/sandbox.ts has 460 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 · packages/runtime-browser/src/driver.ts · ×1
  • packages/runtime-browser/src/driver.ts: 449 lines of code packages/runtime-browser/src/driver.ts:1 — packages/runtime-browser/src/driver.ts has 449 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 · packages/runtime-browser/src/os-filesystem.ts · ×1
  • packages/runtime-browser/src/os-filesystem.ts: 447 lines of code packages/runtime-browser/src/os-filesystem.ts:1 — packages/runtime-browser/src/os-filesystem.ts has 447 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 · packages/build-tools/bridge-src/builtins/stdin.ts · ×1
  • packages/build-tools/bridge-src/builtins/stdin.ts: 415 lines of code packages/build-tools/bridge-src/builtins/stdin.ts:1 — packages/build-tools/bridge-src/builtins/stdin.ts has 415 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 · packages/core/src/options-schema.ts · ×1
  • packages/core/src/options-schema.ts: 412 lines of code packages/core/src/options-schema.ts:1 — packages/core/src/options-schema.ts has 412 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 (~350 LoC) · ×1
  • Dead file (~350 LoC) packages/build-tools/bridge-src/polyfills/dom-events.ts — no import path from any entry point (354 application, 40 tooling, 445 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/build-tools/bridge-src/polyfills/abort.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~251 LoC) · ×1
  • Dead file (~251 LoC) packages/build-tools/bridge-src/polyfills/abort.ts — no import path from any entry point (354 application, 40 tooling, 445 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 (~169 LoC) · ×1
  • Dead file (~169 LoC) packages/playground/frontend/runtime-harness.js — no import path from any entry point (354 application, 40 tooling, 445 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 (~152 LoC) · ×1
  • Dead file (~152 LoC) packages/runtime-benchmarks/src/quick-gate.ts — no import path from any entry point (354 application, 40 tooling, 445 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 (~116 LoC) · ×1
  • Dead file (~116 LoC) packages/build-tools/bridge-src/polyfills/whatwg-url.ts — no import path from any entry point (354 application, 40 tooling, 445 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 (~88 LoC) · ×1
  • Dead file (~88 LoC) packages/runtime-browser/src/default-sidecar.ts — no import path from any entry point (354 application, 40 tooling, 445 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 (~79 LoC) · ×1
  • Dead file (~79 LoC) packages/build-tools/bridge-src/polyfills/blob-file.ts — no import path from any entry point (354 application, 40 tooling, 445 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 (~57 LoC) · ×1
  • Dead file (~57 LoC) packages/runtime-benchmarks/src/check-native-ops.ts — no import path from any entry point (354 application, 40 tooling, 445 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) packages/playground/scripts/setup-vendor.js — no import path from any entry point (354 application, 40 tooling, 445 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 (~19 LoC) · ×1
  • Dead file (~19 LoC) packages/core/src/sidecar/process.ts — no import path from any entry point (354 application, 40 tooling, 445 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
R8 · Dependency Hygiene · Unused dependency '@agentos-software/ripgrep' · ×1
  • Unused dependency '@agentos-software/ripgrep' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@rivet-dev/agentos-vm-test-harness' · ×1
  • Unused dependency '@rivet-dev/agentos-vm-test-harness' — Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'web-streams-polyfill' · ×1
  • Unused dependency 'web-streams-polyfill' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X14 · Bypassable address classification · IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
  • IP classification is bypassable through an IPv4-in-IPv6 embedding crates/kernel/src/network_policy.rs:52 — This function unwraps IPv4-MAPPED IPv6 (`to_ipv4_mapped`, line 53) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 52 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
Minor — 103 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate crates/execution/assets/runners/wasm-runner.mjs:5755 — `!Number.isInteger(port) || port < 0 || port > 65535` appears character-identically in 2 files — crates/execution/assets/runners/wasm-runner.mjs, packages/build-tools/bridge-src/builtins/net.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 REDACTED:2299 — `!knownCommand && !this.tryResolveMountedCommand(command)` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:1158 — `!parsed || !canUseDirectExec(driver, parsed[0]) || (driver === "wasmvm" && parsed[0] === "pwd")` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:795 — `!rule.operations || rule.operations.length === 0 || rule.operations.includes("read")` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 packages/build-tools/bridge-src/builtins/console.ts:384 — `!signal || typeof signal.addEventListener !== "function"` appears character-identically in 2 files — packages/build-tools/bridge-src/builtins/console.ts, packages/build-tools/bridge-src/builtins/events.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 REDACTED:2174 — `!this.client || !this.session || !this.vm` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:1357 — `!this.commandDirs || this.commandDirs.length === 0` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:2210 — `!this.proxy || !this.client || !this.session || !this.vm` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 packages/build-tools/bridge-src/builtins/http2.ts:484 — `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 2 files — packages/build-tools/bridge-src/builtins/http2.ts, packages/core/src/agent-os.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 REDACTED:1947 — `"size" in stat && typeof stat.size === "number"` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 crates/execution/assets/undici-shims/stream.js:147 — `Boolean(stream) && stream.readable !== false && stream.destroyed !== true` appears character-identically in 2 files — crates/execution/assets/undici-shims/stream.js, packages/build-tools/bridge-src/builtins/builtin-modules.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 packages/build-tools/bridge-src/builtins/dgram.ts:442 — `callback !== void 0 && typeof callback !== "function"` appears character-identically in 3 files — packages/build-tools/bridge-src/builtins/dgram.ts, packages/build-tools/bridge-src/builtins/http2.ts, packages/build-tools/bridge-src/builtins/net.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 packages/core/src/sidecar/cargo.ts:8 — `candidate.includes("/") || candidate.includes("\\")` appears character-identically in 2 files — packages/core/src/sidecar/cargo.ts, packages/runtime-core/src/cargo.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 REDACTED:1027 — `command === "sh" || command === "/bin/sh"` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/execution/assets/runners/wasi-module.js:2572 — `deadline != null && Date.now() >= deadline` appears character-identically in 2 files — crates/execution/assets/runners/wasi-module.js, crates/execution/assets/runners/wasm-runner.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 packages/core/src/agent-os.ts:1548 — `definition.examples && definition.examples.length > 0` appears character-identically in 2 files — packages/core/src/agent-os.ts, packages/runtime-core/src/test-runtime.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 REDACTED:1439 — `ensuredSidecarBinary && fsSync.existsSync(ensuredSidecarBinary) && !sidecarBinaryNeedsBuild()` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:2329 — `entry.exitCode !== null || !entry.pendingCloseStdin` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:1929 — `entry.name !== "." && entry.name !== ".."` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:1970 — `entry.onStdout.size === 0 && entry.onStderr.size === 0` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:1498 — `entryPath === "/home/agentos" || entryPath === "/workspace"` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:1492 — `entryPath === "/tmp" || entryPath === "/var/tmp"` appears character-identically in 2 files — REDACTED, packages/runtime-core/src/test-runtime.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 REDACTED:3016 — `error.message.includes("EEXIST") || message.includes("file exists")` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:2998 — `error.message.includes("ESRCH") || message.includes("no such process") || message.includes("has no active process")` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/agentos-toolchain/src/cli.ts:33 — `existsSync(source) && statSync(source).isDirectory()` appears character-identically in 2 files — packages/agentos-toolchain/src/cli.ts, packages/agentos-toolchain/src/pack.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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×14
  • Silent fallback default in catch crates/execution/assets/runners/wasi-module.js:1011 — `_mappedPathExists` swallows every exception into `return false` — 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 crates/execution/assets/runners/wasi-module.js:1035 — `_createParentExists` swallows every exception into `return false` — 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 crates/execution/assets/runners/wasm-runner.mjs:331 — `parseGuestPathMappings` 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 crates/execution/assets/runners/wasm-runner.mjs:2099 — `resolvedGuestPathIsReadOnly` swallows every exception into `return false` — 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 packages/build-tools/bridge-src/builtins/http2.ts:539 — `parseHttp2Headers` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:1414 — `latestMtimeMs` swallows every exception into `return 0` — 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 packages/runtime-benchmarks/bench-utils.ts:124 — `readMemInfo` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:43 — `readRssBytes` swallows every exception into `return 0` — 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 packages/runtime-benchmarks/src/focused/process-spawn.bench.ts:788 — `readLifecycleTraces` 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 packages/runtime-benchmarks/src/focused/process-spawn.bench.ts:817 — `readSidecarExecutePhases` 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 packages/runtime-browser/src/converged-execution-host-bridge.ts:92 — `parse` 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 packages/runtime-core/scripts/copy-wasm-commands.mjs:158 — `destIsPopulated` swallows every exception into `return false` — 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 packages/runtime-core/src/test-runtime.ts:1999 — `latestMtimeMs` swallows every exception into `return 0` — 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 scripts/benchmarks/memory.bench.ts:67 — `pidRssBytes` swallows every exception into `return 0` — 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.
X7 · Silent fallback defaults · Silent fallback default on Err · ×10
  • Silent fallback default on Err crates/client/src/agent_os.rs:2653 — `compact_json` turns every `Err` into `String::from("<invalid json>")` — 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/execution/src/python.rs:1671 — `build_python_runner_bootstrap` turns every `Err` into `String::from("\"\"")` — 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/execution/src/runtime_support.rs:46 — `file_fingerprint` turns every `Err` into `String::from("missing")` — 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/execution/src/wasm.rs:3579 — `wasm_warmup_metrics_emit_source` turns every `Err` into `String::from("\"\"")` — 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/execution/src/wasm.rs:4155 — `encode_wasm_guest_path_mappings` turns every `Err` into `String::from("[]")` — 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/native-sidecar/src/execution/network/http2.rs:1211 — `http2_error_payload` turns every `Err` into `String::from("{\"name\":\"Error\",\"code\":\"ERR_HTTP2_ERROR\",\"message\":\"HTTP/2 bridge error\"}")` — 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/v8-runtime/src/session.rs:3935 — `pending_guest_timer_count` turns every `Err` into `0` — 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/v8-runtime/src/session.rs:3959 — `pending_guest_immediate_count` turns every `Err` into `0` — 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 toolchain/stubs/uucore/src/lib/features/format/argument.rs:81 — `next_char` turns every `Err` into `b'\0'` — 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 toolchain/stubs/uucore/src/lib/features/fsext.rs:430 — `mount_dev_id` turns every `Err` into `String::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.
AX6 · Interface segregation · Fat interface · ×8
  • Fat interface: VirtualFileSystem (23 required operations) REDACTED:139 — `VirtualFileSystem` declares 23 required operations: `readFile`, `readTextFile`, `readDir`, `readDirWithTypes`, `writeFile`, `createDir`, `mkdir`, `exists`, `stat`, `removeFile`, `removeDir`, `rename`, `realpath`, `symlink`, `readlink`, `lstat`, `link`, `chmod`, `chown`, `utimes`, `truncate`, `pread`, `pwrite`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: Kernel (20 required operations) REDACTED:447 — `Kernel` declares 20 required operations: `mount`, `dispose`, `exec`, `spawn`, `openShell`, `connectTerminal`, `mountFs`, `unmountFs`, `readFile`, `writeFile`, `mkdir`, `readdir`, `readdirRecursive`, `stat`, `exists`, `removeFile`, `removeDir`, `removePath`, `rename`, `movePath`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: VirtualFileSystem (23 required operations) packages/core/src/runtime.ts:33 — `VirtualFileSystem` declares 23 required operations: `readFile`, `readTextFile`, `readDir`, `readDirWithTypes`, `writeFile`, `createDir`, `mkdir`, `exists`, `stat`, `removeFile`, `removeDir`, `rename`, `realpath`, `symlink`, `readlink`, `lstat`, `link`, `chmod`, `chown`, `utimes`, `truncate`, `pread`, `pwrite`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: Kernel (20 required operations) packages/core/src/runtime.ts:328 — `Kernel` declares 20 required operations: `mount`, `dispose`, `exec`, `spawn`, `openShell`, `connectTerminal`, `mountFs`, `unmountFs`, `readFile`, `writeFile`, `mkdir`, `readdir`, `readdirRecursive`, `stat`, `exists`, `removeFile`, `removeDir`, `removePath`, `rename`, `movePath`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: BenchVm (16 required operations) packages/runtime-benchmarks/src/lib/vm.ts:35 — `BenchVm` declares 16 required operations: `writeFile`, `mkdir`, `delete`, `readFile`, `readDir`, `readdir`, `readDirWithTypes`, `exec`, `execArgv`, `spawnNodeCapture`, `spawn`, `waitProcess`, `execWasmCommand`, `getResourceSnapshot`, `dispose`, `sidecarPid`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: VirtualFileSystem (23 required operations) packages/runtime-browser/src/runtime.ts:51 — `VirtualFileSystem` declares 23 required operations: `readFile`, `readTextFile`, `readDir`, `readDirWithTypes`, `writeFile`, `createDir`, `mkdir`, `exists`, `stat`, `removeFile`, `removeDir`, `rename`, `realpath`, `symlink`, `readlink`, `lstat`, `link`, `chmod`, `chown`, `utimes`, `truncate`, `pread`, `pwrite`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: VirtualFileSystem (23 required operations) packages/runtime-core/src/test-runtime.ts:155 — `VirtualFileSystem` declares 23 required operations: `readFile`, `readTextFile`, `readDir`, `readDirWithTypes`, `writeFile`, `createDir`, `mkdir`, `exists`, `stat`, `removeFile`, `removeDir`, `rename`, `realpath`, `symlink`, `readlink`, `lstat`, `link`, `chmod`, `chown`, `utimes`, `truncate`, `pread`, `pwrite`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: Kernel (21 required operations) packages/runtime-core/src/test-runtime.ts:476 — `Kernel` declares 21 required operations: `mount`, `dispose`, `exec`, `spawn`, `openShell`, `connectTerminal`, `mountFs`, `unmountFs`, `readFile`, `writeFile`, `mkdir`, `readdir`, `stat`, `exists`, `removeFile`, `removeDir`, `rename`, `pwrite`, `vmFetch`, `registerHostFunctions`, `getResourceSnapshot`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D30 · Dependency Vulnerabilities · Low CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D7 · Architectural Integrity · Classify ADR enforcement · ×4
  • Classify ADR enforcement: std patch: ExitStatusExt for wasm32-wasip1 toolchain/std-patches/0008-wasi-exit-status-ext.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: std patch: implement env::split_paths for wasm32-wasip1 toolchain/std-patches/0009-wasi-split-paths.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: tokio fs asyncify inline on wasi toolchain/std-patches/crates/tokio/0002-wasi-fs-asyncify-inline.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: tokio spawn_blocking inline on wasi toolchain/std-patches/crates/tokio/0003-wasi-spawn-blocking-inline.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
X4 · Structured logging · Interpolated log message defeats structured logging · ×2
  • Interpolated log message defeats structured logging crates/native-sidecar/src/service.rs:5398 — `warn!` at line 5398 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/native-sidecar/src/stdio.rs:3687 — `error!` at line 3687 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 4 of 205 project(s) overshoot their size bounds, lowering Project Cohesion to 9.6/10. The most over is `crates/kernel` (22754 LoC, 138 module-visible types across 1 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 7/147 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/execution/assets/undici-shims`, `crates/native-baseline`, `packages/agentos-toolchain`, `packages/build-tools` and 135 more.
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 'RESIDENT_TRIVIAL_CODE' · ×1
  • Unused export 'RESIDENT_TRIVIAL_CODE' packages/runtime-benchmarks/bench-utils.ts:38 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MAX_LIVE_RUNTIMES' · ×1
  • Unused export 'MAX_LIVE_RUNTIMES' packages/runtime-benchmarks/bench-utils.ts:42 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MAX_RESIDENT_RUNNERS' · ×1
  • Unused export 'MAX_RESIDENT_RUNNERS' packages/runtime-benchmarks/bench-utils.ts:46 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'SCENARIOS' · ×1
  • Unused export 'SCENARIOS' packages/runtime-benchmarks/bench-utils.ts:60 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'createBenchSidecar' · ×1
  • Unused export 'createBenchSidecar' packages/runtime-benchmarks/bench-utils.ts:79 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'createBootTimingRecorder' · ×1
  • Unused export 'createBootTimingRecorder' packages/runtime-benchmarks/bench-utils.ts:161 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'mergePhaseSamples' · ×1
  • Unused export 'mergePhaseSamples' packages/runtime-benchmarks/bench-utils.ts:167 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'summarizePhases' · ×1
  • Unused export 'summarizePhases' packages/runtime-benchmarks/bench-utils.ts:173 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'runLimited' · ×1
  • Unused export 'runLimited' packages/runtime-benchmarks/bench-utils.ts:179 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'LayerSamples' · ×1
  • Unused export 'LayerSamples' packages/runtime-benchmarks/src/lib/layers.ts:51 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'opSupportsWasmLayer' · ×1
  • Unused export 'opSupportsWasmLayer' packages/runtime-benchmarks/src/lib/layers.ts:170 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'compareBaseline' · ×1
  • Unused export 'compareBaseline' packages/runtime-benchmarks/src/lib/report.ts:115 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'resolveBenchCommandsDir' · ×1
  • Unused export 'resolveBenchCommandsDir' packages/runtime-benchmarks/src/lib/vm.ts:275 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'uploadFile' · ×1
  • Unused export 'uploadFile' scripts/publish/src/lib/r2.ts:86 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'rejectPendingRpcRequests' · ×1
  • Unused module-local declaration 'rejectPendingRpcRequests' crates/execution/assets/runners/python-runner.mjs:441 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'getSandboxAgentMountPluginConfig' · ×1
  • Unused module-local declaration 'getSandboxAgentMountPluginConfig' packages/core/src/agent-os.ts:934 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'getS3MountPluginConfig' · ×1
  • Unused module-local declaration 'getS3MountPluginConfig' packages/core/src/agent-os.ts:973 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'getGoogleDriveMountPluginConfig' · ×1
  • Unused module-local declaration 'getGoogleDriveMountPluginConfig' packages/core/src/agent-os.ts:1015 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'combineInstructions' · ×1
  • Unused module-local declaration 'combineInstructions' packages/core/src/agent-os.ts:1559 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Write-only private field '_softwareRoots' · ×1
  • Write-only private field '_softwareRoots' packages/core/src/agent-os.ts:2759 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field '_hostFunctionReference' · ×1
  • Write-only private field '_hostFunctionReference' packages/core/src/agent-os.ts:2766 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field '_env' · ×1
  • Write-only private field '_env' packages/core/src/agent-os.ts:2768 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Unused private method '_resolveVmPathToHostPath' · ×1
  • Unused private method '_resolveVmPathToHostPath' packages/core/src/agent-os.ts:5341 — Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used.
R7 · Dead Code · Unused module-local declaration 'shellSingleQuote' · ×1
  • Unused module-local declaration 'shellSingleQuote' REDACTED:355 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'isMissingHostProcessError' · ×1
  • Unused module-local declaration 'isMissingHostProcessError' REDACTED:3019 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 3/7 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 98/99 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~0.3 `!` null assertions per 1k TypeScript source lines — 32 assertion(s) across the 100133 source line(s) of the 286 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (12), packages/core/src/agent-os.ts (5), REDACTED (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Minor — 43 finding(s)
D12 · Dependency Hygiene · Outdated · ×37
  • Outdated: anyhow — `anyhow` is locked at 1.0.103 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: async-trait — `async-trait` is locked at 0.1.89 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in crates/client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` and commit the updated REDACTED.
  • Outdated: aws-config — `aws-config` is locked at 1.8.18 but 1.13.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-config` and commit the updated REDACTED.
  • Outdated: aws-credential-types — `aws-credential-types` is locked at 1.2.14 but 1.3.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-credential-types` and commit the updated REDACTED.
  • Outdated: aws-sdk-s3 — `aws-sdk-s3` is locked at 1.137.0 but 1.156.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-s3` and commit the updated REDACTED.
  • Outdated: blake3 — `blake3` is locked at 1.8.5 but 1.8.7 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/vfs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p blake3` and commit the updated REDACTED.
  • Outdated: bytes — `bytes` is locked at 1.12.0 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
  • Outdated: cc — `cc` is locked at 1.2.66 but 1.10.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/v8-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cc` and commit the updated REDACTED.
  • Outdated: crossbeam-channel — `crossbeam-channel` is locked at 0.5.15 but 0.5.17 is the current stable release on crates.io, and it already satisfies the `"0.5"` requirement declared in crates/v8-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam-channel` and commit the updated REDACTED.
  • Outdated: data-encoding — `data-encoding` is locked at 2.11.0 but 2.11.1 is the current stable release on crates.io, and it already satisfies the `"2.6"` requirement declared in toolchain/stubs/uucore/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p data-encoding` and commit the updated REDACTED.
  • Outdated: event-listener — `event-listener` is locked at 5.4.1 but 5.4.2 is the current stable release on crates.io, and it already satisfies the `"5.4"` requirement declared in crates/kernel/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p event-listener` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in software/gzip/native/crates/gzip/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 — `futures` 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 crates/client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
  • Outdated: glob — `glob` is locked at 0.3.3 but 0.3.4 is the current stable release on crates.io, and it already satisfies the `"0.3.1"` requirement declared in toolchain/stubs/uucore/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p glob` and commit the updated REDACTED.
  • Outdated: h2 — `h2` is locked at 0.4.15 but 0.4.20 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p h2` and commit the updated REDACTED.
  • Outdated: http — `http` is locked at 1.4.2 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http` and commit the updated REDACTED.
  • Outdated: icu_provider — `icu_provider` is locked at 2.2.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2.0.0"` requirement declared in toolchain/stubs/uucore/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p icu_provider` and commit the updated REDACTED.
  • Outdated: js-sys — `js-sys` is locked at 0.3.103 but 0.3.106 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/native-sidecar-browser/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p js-sys` 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 crates/v8-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.33 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: memchr — `memchr` is locked at 2.8.2 but 2.8.3 is the current stable release on crates.io, and it already satisfies the `"2.7.2"` requirement declared in toolchain/stubs/uucore/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memchr` and commit the updated REDACTED.
  • Outdated: memmap2 — `memmap2` is locked at 0.9.11 but 0.9.12 is the current stable release on crates.io, and it already satisfies the `"0.9"` requirement declared in crates/vfs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memmap2` and commit the updated REDACTED.
  • Outdated: regex — `regex` is locked at 1.12.4 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in software/coreutils/native/crates/expr/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
  • Outdated: rustix — `rustix` is locked at 1.1.4 but 1.1.6 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustix` and commit the updated REDACTED.
  • Outdated: rustls — `rustls` is locked at 0.23.41 but 0.23.46 is the current stable release on crates.io, and it already satisfies the `"0.23.37"` requirement declared in crates/native-sidecar/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls` and commit the updated REDACTED.
  • + 12 more in this group — see findings.md.
D10 · Test Quality · Skipped (documented) · ×6
  • Skipped (documented): (unnamed test) software/ssh/test/ssh.nightly.test.ts:313 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) software/ssh/test/ssh.nightly.test.ts:525 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) software/ssh/test/ssh.nightly.test.ts:543 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/core/tests/brush-interactive.nightly.test.ts:271 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) packages/core/tests/google-drive-backend.test.ts:42 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/core/tests/shared-sidecar-clean-exit.test.ts:32 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-dac08965923a4f7e932b56ff4ddfe25a/history.json --exit-code 0 --source .14artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-dac08965923a4f7e932b56ff4ddfe25a/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/watchdog-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 examples --exclude packages/build-tools/bridge-src/vendor --exclude packages/core/src/generated --exclude packages/playground/vendor --exclude packages/runtime-browser/src/generated --exclude packages/runtime-core/src/generated --exclude packages/runtime-core/tests/integration/projects/module-access-pass/vendor .119artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update79artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .12artifacts/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 39 file(s) — `packages/core/src/index.ts`, `packages/runtime-benchmarks/src/quick-gate.ts`, `packages/runtime-browser/src/sab-reactor.ts`, `packages/runtime-browser/src/worker.ts`, `packages/typescript/src/index.ts`, … (+34 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a1830c-acb5-7645-8cd0-e1acf26ae4d8 · 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