Public report — actors, published 29 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_f981775f204443c5a5b635e0e151882b
Filed 29 September 2026, 20:43 UTC
Public
Large · 331,668 LoC · 121 projects · rebuild ~3.3 person-years · weakest lens: Event-Driven (10%)
Findings by grade
280 critical1999 serious99 minor42 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 19:22 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
2313findings with an exact file:lineof 2378 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
69/135dimensions across the health lenses331668 LoC · 121 projects — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
This large-scale asset, representing a significant investment of approximately €480,000 to rebuild, is currently at risk with an overall health score of 30%. While the team has achieved strong maturity in documentation and testing practices, the system’s architecture and operational readiness are critically weak. This imbalance creates a fragile foundation where daily changes incur a hidden velocity tax, slowing delivery and increasing the likelihood of defects. The business must recognize that the cost of inaction is not merely technical debt but a continuous drag on the team’s ability to ship value.
The most pressing concern is the system’s event-driven fragility. With an event-driven health score of just 10%, the core logic for handling asynchronous workflows is severely compromised. This is not a minor code smell; it is a structural risk that threatens system stability and scalability. Because the asset is large, any failure in this area can ripple across thousands of lines of code, leading to potential outages or data inconsistencies that are difficult to diagnose and repair. The lack of robust event handling means the system is brittle, unable to gracefully handle the high volume of interactions it was designed for.
Closely linked is the issue of operational unreliability. The readiness score of 36% reveals that the system lacks essential safeguards for production stability. There are no whole-request timeouts, meaning external dependencies can hang indefinitely, consuming resources and blocking threads. Furthermore, disaster recovery is not codified in infrastructure-as-code, leaving the business exposed to data loss in the event of a catastrophic failure. These gaps mean that every deployment carries a higher risk of causing a service disruption, directly impacting customer trust and revenue.
However, the assessment is not entirely negative. The team has demonstrated strong discipline in code maturity and testing, with a maturity score of 83%. This indicates that the team knows how to write reliable code and has the processes to support it. The primary issue is not a lack of skill, but a lack of architectural alignment and operational rigor. The high score in event sourcing (100%) also suggests that the underlying data model is sound, providing a solid base for future improvements.
The highest-leverage action is to fix the async handler pattern. Moving awaited work off the main handler or making it fully asynchronous will pay for itself in one to two months by eliminating the annual drag on developer productivity. This single change addresses the core architectural flaw and unlocks the team’s potential. After this, the team should prioritize adding request timeouts and codifying disaster recovery procedures to stabilize operations. This focused approach ensures that immediate risks are mitigated while building a more resilient and maintainable system for the future.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
397 finding(s) are new versus the previous scan (2026-09-13) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €160,000–€790,000
0.7× (at 30% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~3.3 person-years of build effort (about ~€480,000 to rebuild). Its weakest lens is Event-Driven at 10% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.1) — vertical slice × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~3.3 person-years to rebuild), and its weakest lens is Event-Driven at 10%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Event-Driven first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 60.7–404.8 engineer-days every year, paid as drag on the ~1,214,400 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 2–5% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 299,441 line(s) changed over a 90-day window ⇒ ~1,214,400/year · D1/D2/D4/D6 code quality: averaging 7.4/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.4/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 7.4/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
2073 modules, 3415 dependencies. 17 dependency cycles across 73 modules, marked above the diagonal.
Showing the 40 most-connected modules; 2033 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
rivet_guard_core.request_context uses rivetkit_napi.cancellation_token. Changing rivetkit_napi.cancellation_token can break rivet_guard_core.request_context, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
rivetkit_core.actor.messages uses rivetkit_napi.cancellation_token. Changing rivetkit_napi.cancellation_token can break rivetkit_core.actor.messages, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→27 rivetkit_core.actor.messages depends on epoxy_protocol.versionedcycle✕
Type pairs
1 distinct (type in rivetkit_core.actor.messages → type in epoxy_protocol.versioned) reference.
rivet_api_builder.extract uses rivetkit_core.actor.messages. Changing rivetkit_core.actor.messages can break rivet_api_builder.extract, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
33→27 rivet_api_builder.extract depends on epoxy_protocol.versioned✕
Type pairs
1 distinct (type in rivet_api_builder.extract → type in epoxy_protocol.versioned) reference.
rivetkit_core.actor.context uses rivetkit_core.actor.config. Changing rivetkit_core.actor.config can break rivetkit_core.actor.context, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→15 rivetkit_core.actor.context depends on rivetkit_napi.cancellation_token✕
Type pairs
2 distinct (type in rivetkit_core.actor.context → type in rivetkit_napi.cancellation_token) references.
rivetkit_core.actor.context uses rivetkit_napi.cancellation_token. Changing rivetkit_napi.cancellation_token can break rivetkit_core.actor.context, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→23 rivetkit_core.actor.context depends on rivetkit_core.actor.messages✕
Type pairs
2 distinct (type in rivetkit_core.actor.context → type in rivetkit_core.actor.messages) references.
rivetkit_core.actor.context uses rivetkit_core.actor.messages. Changing rivetkit_core.actor.messages can break rivetkit_core.actor.context, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→24 rivetkit_core.actor.context depends on rivetkit_core.actor.sqlite✕
Type pairs
3 distinct (type in rivetkit_core.actor.context → type in rivetkit_core.actor.sqlite) references.
rivetkit_core.actor.context uses rivetkit_core.actor.sqlite. Changing rivetkit_core.actor.sqlite can break rivetkit_core.actor.context, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→27 rivetkit_core.actor.context depends on epoxy_protocol.versioned✕
Type pairs
1 distinct (type in rivetkit_core.actor.context → type in epoxy_protocol.versioned) reference.
rivetkit_core.registry uses rivetkit_napi.cancellation_token. Changing rivetkit_napi.cancellation_token can break rivetkit_core.registry, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→27 rivetkit_core.registry depends on epoxy_protocol.versioned✕
Type pairs
1 distinct (type in rivetkit_core.registry → type in epoxy_protocol.versioned) reference.
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 category
Findings
Severity
A05:2021 — Security Misconfiguration
261
High / Critical
A06:2021 — Vulnerable & Outdated Components
175
High / Critical
A03:2021 — Injection
89
High / Critical
A02:2021 — Cryptographic Failures
19
High / Critical
Roadmap
First, resolve the handler temporal coupling by moving awaited work off the synchronous handler or making the handler async to prevent blocking. Second, establish a robust disaster recovery strategy by codifying backups and geo-recovery in infrastructure as code, explicitly documenting RTO and RPO since persistence alone is insufficient. Third, harden outbound HTTP resilience by enforcing request timeouts on all clients and implementing retry logic with back-off for transient failures. Finally, improve dependency hygiene by removing unused packages and demoting type- or test-only dependencies, while enabling automated security and version update tooling to maintain long-term stability.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.
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.
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
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 — 280
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 — 1999
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 — 99
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 42
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. 63 of 69 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 6 documentation/naming judgement(s) are LLM-assisted and labelled advisory. 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 — 69 dimensions across the health lenses
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
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, 2313 of 2378 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.)
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.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — 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,375 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 385 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 MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for engine/sdks/typescript/envoy-protocol/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — 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 engine/sdks/typescript/envoy-protocol/ was NOT MEASURED: the dependency install for engine/sdks/typescript/envoy-protocol/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 engine/sdks/typescript/runner/ was NOT MEASURED: the dependency install for engine/sdks/typescript/runner/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 engine/sdks/typescript/test-runner/ was NOT MEASURED: the dependency install for engine/sdks/typescript/test-runner/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/actor-actions/ was NOT MEASURED: the dependency install for examples/actor-actions/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/ai-agent/ was NOT MEASURED: the dependency install for examples/ai-agent/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/ai-agent-effect/ was NOT MEASURED: the dependency install for examples/ai-agent-effect/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/ai-and-user-generated-actors-freestyle/ was NOT MEASURED: the dependency install for examples/ai-and-user-generated-actors-freestyle/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/ai-generated-actor/ was NOT MEASURED: the dependency install for examples/ai-generated-actor/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/chat-room/ was NOT MEASURED: the dependency install for examples/chat-room/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/chat-room-effect/ was NOT MEASURED: the dependency install for examples/chat-room-effect/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/collaborative-document/ was NOT MEASURED: the dependency install for examples/collaborative-document/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 examples/cross-actor-actions/ was NOT MEASURED: the dependency install for examples/cross-actor-actions/ failed in the analyzer sandbox (throw new Error(), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D12 Dependency Hygiene — 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 repository's production source is .cts, .py, .rs, .swift, .ts, .tsx, and no dependency manifest was found alongside it. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. The manifests this pass reads are: a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Cargo manifest, a Go module (REDACTED/go.sum), an OSGi MANIFEST.MF/target platform, a Maven POM, a Gradle version catalogue, an sbt build (build.sbt), composer.json, package.json, a Dart pubspec.yaml, a Swift Package.swift/Package.resolved, an Elixir mix.exs/mix.lock (Hex), a rebar.config / erlang.mk DEPS (Hex), a Ruby Gemfile/Gemfile.lock or .gemspec (Bundler/RubyGems). A source tree carrying none of them either declares its dependencies somewhere this pass does not look, or vendors them into the tree.
D30 Dependency Vulnerabilities — measured, with a gap in what it reached — 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. The solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan. 2 of 3 declared ecosystem(s) (npm,osv) WERE scanned and every vulnerability they reported is included in this result; nuget was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that nuget is free of known-vulnerable dependencies.
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. `engine/sdks/typescript/runner/src/actor.ts`, `frontend/packages/components/src/matchmaker/lobby-region.tsx`, `frontend/packages/components/src/ping.tsx`, `frontend/packages/components/src/tailwind-base.ts`, `frontend/src/app/forms/create-project-form.tsx`, … (+39 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.
AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, 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.
AX2 Stateful singletons — 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 Microsoft.Extensions.DependencyInjection singletons in C# and Spring/JSR-330/CDI singletons in Java and Kotlin only, and this repository's product is written in Go and Python and Swift, which was left unread, 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.
AX6 Interface segregation — 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
AX7 Slice cohesion — 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. 257 further occurrence(s) are not listed individually; the score already reflects all 297.
C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — 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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — 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. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — 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. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — 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 finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
P8 Schema migrations — 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. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
PF3 Async & latency hygiene — 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. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
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. 142 further occurrence(s) are not listed individually; the score already reflects all 182.
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. 104 further occurrence(s) are not listed individually; the score already reflects all 144.
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. 54 further occurrence(s) are not listed individually; the score already reflects all 94.
X1 Async correctness — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X12 Unreachable branch — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X13 Undrained process stream — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X14 Bypassable address classification — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X15 Unvalidated length from an untrusted reader — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X16 Unfloored truncation loop — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X17 Uncapped recursion over a caller-supplied document — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X18 Disposal-pattern correctness — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X19 Unrestored process-global state — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X2 Cancellation propagation — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X20 Mistyped argument guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X21 Side-effecting pattern guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X22 Contradicted release guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X23 Unguarded diagnostic materialisation — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X24 Document value interpolated into markup unescaped — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X25 Inert configuration knob — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X27 Collection changed while being enumerated — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X28 Index access outside its own emptiness guard — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X29 Per-element action decided by a fixed element — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X30 Support guard that admits what it rejects — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X32 Type resolved by simple name across every loaded assembly — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X4 Structured logging — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X5 Nullable reference types — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X7 Silent fallback defaults — 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. X7 measured this repository's Python, and its Go, Rust, Swift, TypeScript/JavaScript source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
Package restore incomplete — third-party types were unresolved in part of the solution — NuGet restore did not complete for one or more projects, so those projects were analysed with framework references only: every check keyed on a third-party type saw an error type there and reported nothing. Findings on those projects are a lower bound; run `dotnet restore` on them and rescan.
Repo exclusion declarations: 36 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.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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 REDACTED, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (6): D19, D20, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
154 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was native.buildNativeFactory at 138. A further 17 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 universaldb::utils::keys::key_from_str at 145 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: engine/packages/universaldb/src/utils/keys.rs (universaldb::utils::keys::key_from_str at 145), engine/packages/guard-core/src/utils.rs (rivet_guard_core::utils::err_into_response at 40), engine/packages/depot/src/conveyer/error.rs (SqliteStorageError::fmt at 25), engine/packages/engine/src/commands/config.rs (UpdateSubCommand::execute at 22), rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs (ActorEvent::kind at 19), and 3 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.
+ 91 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 pegboard finding(s) in Cyclomatic Complexity — start with mod.rs (4), runtime.rs (3), list_for_ns.rs (2). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 12 DatabaseKv finding(s) in Cyclomatic Complexity — start with debug.rs (5), repair.rs (5), mod.rs (2). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 11 depot finding(s) in Cyclomatic Complexity — start with doctor.rs (3), shared.rs (2), db_reclaimer.rs (2). — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 140 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 33 pegboard finding(s) in Cognitive Complexity — start with mod.rs (5), runtime.rs (4), metrics.rs (4). — One of this dimension's main actionable groups (33 warning-level).
Resolve the 26 depot finding(s) in Cognitive Complexity — start with shared.rs (6), doctor.rs (5), db_reclaimer.rs (3). — One of this dimension's main actionable groups (26 warning-level).
Resolve the 16 DatabaseKv finding(s) in Cognitive Complexity — start with debug.rs (8), repair.rs (5), mod.rs (3). — One of this dimension's main actionable groups (16 warning-level).
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.5 / 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 111 FileTooLong finding(s) in God Classes — start with mod.rs (8), lib.rs (6), index.ts (5). — One of this dimension's main actionable groups (111 warning-level).
Resolve the 103 FunctionTooLong finding(s) in God Classes — start with mod.rs (11), doctor.rs (6), lib.rs (6). — One of this dimension's main actionable groups (103 warning-level).
Resolve the 71 MethodTooLong finding(s) in God Classes — start with lib.rs (11), mod.rs (8), debug.rs (6). — One of this dimension's main actionable groups (71 warning-level).
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.
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.
605 duplicated block group(s) detected. A further 32 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 8 of the 637 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .ts (25% 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.
+ 174 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 40 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with lib.rs (3), epoxy.rs (3), history.rs (2). — One of this dimension's main actionable groups (40 warning-level).
Resolve the 38 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with debug.rs (4), signal.rs (4), mod.rs (4). — One of this dimension's main actionable groups (38 warning-level).
Resolve the 34 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with v6_to_v7.rs (4), v5_to_v6.rs (4), lib.rs (3). — One of this dimension's main actionable groups (34 warning-level).
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.
Do you agree with this assessment?
D5 · Coupling7.7 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
121 production modules (Cargo+npm+SwiftPM), 0 dependency cycle(s), 14 unstable depended-on module(s). Read from the build's own module declarations; 18 module(s) off the main sequence, with abstractness counted on 84 of the 121 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
Off the main sequence: RivetKitClient · ×18
Unstable project pegboard-envoy
Unstable project pegboard-gateway
Unstable project pegboard-gateway2
Unstable project pegboard-gateway3
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 1 Unstable project pegboard-envoy finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project pegboard-gateway finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
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.
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.
Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with shared_state.rs (3), default.rs, runtime.rs. — One of this dimension's main actionable groups (6 warning-level).
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.
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.
All 2 mechanizable ADR(s) are enforced: 2 by analyzers, 0 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
✓ On the Gold path — maintain.
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 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.
3943 test methods: 1713 unit, 2222 integration, 0 BDD, 8 e2e. The JavaScript/TypeScript suite contributes 1376 `it`/`test` case(s) across 184 test file(s) declaring at least one beside 36 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 2525 `#[test]` function(s) across 377 file(s) declaring at least one; its unit/integration split is Cargo's own — 314 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. The Python suite contributes 4 test function(s) across 4 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 2 test case(s) across 2 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Adequategated by 1 critical finding✓ 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.
11 skipped (11 with a documented reason), 5 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1375 tests. Measured on the JavaScript/TypeScript suite only — at least 385 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions (empty test): satisfies the same shared runtime interface as the NAPI adapterrivetkit-typescript/packages/rivetkit/tests/wasm-runtime.test.ts:240
No assertions: delivery failures retry with backoff then succeed · ×4integrations/workflow-world/tests/integration/dispatcher-loop.test.ts:75
Skipped (documented): should deploy successfully with Rivet Cloud · ×11examples/ai-and-user-generated-actors-freestyle/tests/deploy.test.ts:40
What to do
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with wasm-runtime.test.ts. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 4 No assertions finding(s) in Test Quality — start with dispatcher-loop.test.ts (2), nested-actions.test.ts (2). — One of this dimension's main actionable groups (4 warning-level).
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.
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.
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.
Top hotspots: rivetkit-typescript/packages/rivetkit/src/registry/native.ts (36×138=4968); rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs (24×44=1056); engine/packages/guard-core/src/proxy_service.rs (12×75=900) Repeated repair below the complexity floor: engine/packages/universaldb/src/driver/postgres/transaction_task.rs (3 of 5 changes were fixes); rivetkit-typescript/packages/rivetkit/src/registry/native-http.ts (3 of 5 changes were fixes); engine/packages/pegboard-gateway2/src/metrics_task.rs (3 of 4 changes were fixes)
Resolve the 55 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), mod.rs (4), config.rs (2). — One of this dimension's main actionable groups (55 warning-level).
Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with transaction_task.rs, native-http.ts, metrics_task.rs. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.2 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
135 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is engine/packages/depot-client/src/vfs.rs. Counted over 741 of the 1314 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×4
Further sole-owners (lower concentration)
What to do
Resolve the 4 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (4 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README is a clear project overview (Rivet Actors as lightweight in-memory processes for stateful workloads) with a backend code example and an outline of What is Rivet?, Features, Use Cases, How Actors Compare, Built-In Observability, Deployment Options, Just a Library, Self-Host, Rivet Cloud, Getting Started, Use with Your Coding Agent, Start From Scratch, Integrations, Projects in This Repository, Community, License. The container-runner/README and integrations directories each document their own tiers (development setup, example projects, local test harnesses) while the engine/packages/* READMEs cover per-package topics like depot storage, Epoxy's immutable-key consensus model, and telemetry with opt-out guidance. All documents are well-structured and complete within clip boundaries. The repository's READMEs are all directory-level documentation (icons, client, CLI, cloudflare-workers, devtools, engine-cli, MCP server, Next.js) and the architecture/design docs are separate markdown files. The root README is a single overview of RivetKit covering installation, usage, contributing, and license — it is the only document that needs to be judged for its own scope.
Documentation: no project overviewREADME.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR QualityExemplary◐ Sampled · advisory
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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyAdequate◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
4 API inconsistencies across a 400-member sample of 535 exposed types.
Three methods perform database execution with overlapping signatures. `exec` takes only SQL, while `run` and `execute` both take SQL and params. `run` and `execute` are functionally identical in signature and likely intent, creating unnecessary duplication.
Profiled execution methods are split between `exec` and `execute` roots. If `exec` and `execute` are redundant (see above), their profiled variants are too. Furthermore, having both `exec_profiled` and `execute_profiled` suggests a lack of unified naming convention for the base operations.
Two close methods with ambiguous distinction. `close` and `close_and_wait` likely differ by whether they wait for background workers to finish, but the naming is not immediately clear from the signature alone (no `wait` boolean or similar). This forces users to guess the semantics.
Two methods returning error strings with unclear distinction. `take_last_kv_error` implies retrieving a specific KV store error, while `clone_fatal_error` implies cloning a fatal error state. The return type is identical (`String`), and the intent is not obvious from the names alone, risking confusion about which error to retrieve.
What to do
Resolve the 1 Three methods perform database execution with overlapping signatures.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Profiled execution methods are split between `exec` and `execute` roots.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Two close methods with ambiguous distinction. `close` and… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
18 finding(s): 0 critical, 18 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 17 REDACTED finding(s) in Secrets (history) — start with REDACTED (11), REDACTED (4), REDACTED. — One of this dimension's main actionable groups (17 issue-level).
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
89 finding(s): 0 critical, 84 high, 5 medium, 0 low. 63 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 76 file(s) — `.claude/skills/stack-merge/scripts/detect_ralph.sh` (line 8), `.claude/skills/stack-merge/scripts/exec_merge.sh` (line 8), `.claude/skills/stack-merge/scripts/list_merge_path.sh` (line 8), `.claude/skills/stack-merge/scripts/validate.sh` (line 8), `container-runner/examples/unity-demo/Packages/com.firstgeargames.fishnet/Runtime/Transporting/Transports/Tugboat/LiteNetLib/NetManager.cs` (line 330, lines 1721–1722), … (+71 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. In 1 of those file(s) — `container-runner/examples/unity-demo/Packages/com.firstgeargames.fishnet/Runtime/Transporting/Transports/Tugboat/LiteNetLib/Utils/FastBitConverter.cs` — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 3 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
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
Resolve the 4 REDACTED finding(s) charged to Static Analysis (SAST) — the other 63 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (67 issue-level, 4 of them charged here).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
175 finding(s): 11 critical, 76 high, 76 medium, 12 low. Partial dependency scan: 2 of 3 declared ecosystem(s) were scanned (npm,osv), and the findings above are real and complete for them. nuget was not scanned (nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan), so this is not the whole dependency surface and the result is reported at reduced confidence.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 71 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (64), REDACTED (7). — One of this dimension's main actionable groups (71 issue-level).
Resolve the 10 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (10). — One of this dimension's main actionable groups (10 issue-level).
Resolve the 5 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 162 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (41), REDACTED (27), REDACTED (19). — One of this dimension's main actionable groups (162 warning-level).
Resolve the 75 High IaC finding(s) in IaC & Container Security — start with REDACTED (30), REDACTED (6), REDACTED (4). — One of this dimension's main actionable groups (75 issue-level).
Resolve the 24 Low IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (24 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 741 of the 1314 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
Resolve the 3 Change coupling finding(s) in Change Coupling — start with telemetry.rs, lib.rs, actor_context.rs. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with wasm-runtime.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 12 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels5.1 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×14) — frontend/packages/components/src/auto-form/fields/union.tsx:56, frontend/packages/components/src/datepicker.tsx:55, frontend/packages/components/src/datepicker.tsx:127, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×3) — frontend/src/app/feedback-button.tsx:64, frontend/src/components/actors/actor-logs-tab.tsx:21, frontend/src/routes/_context/orgs.$organization/projects.$project/ns.$namespace/logs.tsx:152
This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — frontend/src/app/forms/upsert-deployment-form.tsx:188, frontend/src/components/actors/actor-database.tsx:693
This UI-library field component has no label / aria-label / aria-labelledby / id / name, and nothing it renders carries one either. The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — frontend/src/app/help-button.tsx:151, frontend/src/app/metrics/metrics-time-range-select.tsx:20, frontend/src/app/settings-pages/mcp-connection.tsx:37
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). — frontend/src/components/actors/workflow/workflow-visualizer.tsx:277
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — frontend/src/components/ui/filters.tsx:421
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — scripts/debug/diff-viewer/server.js:86
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) — rivetkit-rust/packages/rivetkit-core/src/inspector_bundle/wasm-custom-tab-unavailable.html:2, scripts/debug/diff-viewer/server.js:74
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — scripts/debug/diff-viewer/server.js:74
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
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.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Do you agree with this assessment?
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 471 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.
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.
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.
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.
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.
`Actor` (slice 'rivetkit-swift~RivetKitSwiftUI') depends on `AnyEncodable` from slice 'rivetkit-swift~RivetKitClient'. — rivetkit-swift/Sources/RivetKitSwiftUI/Actor.swift:40
`ActorOptions` (slice 'rivetkit-swift~RivetKitSwiftUI') depends on `AnyEncodable` from slice 'rivetkit-swift~RivetKitClient'. — rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:12
`ActorObservable` (slice 'rivetkit-swift~RivetKitSwiftUI') depends on `ActorConnStatus` from slice 'rivetkit-swift~RivetKitClient'. — rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:37
`RivetKitContext` (slice 'rivetkit-swift~RivetKitSwiftUI') depends on `RivetKitClient` from slice 'rivetkit-swift~RivetKitClient'. — rivetkit-swift/Sources/RivetKitSwiftUI/Environment.swift:4
`ContentView` (slice 'rivetkit-swift~examples~hello-world-swiftui~client~HelloWorldApp') depends on `View` from slice 'rivetkit-swift~RivetKitSwiftUI'. — rivetkit-swift/examples/hello-world-swiftui/client/Sources/HelloWorldApp/ContentView.swift:4
`CounterPanel` (slice 'rivetkit-swift~examples~hello-world-swiftui~client~HelloWorldApp') depends on `View` from slice 'rivetkit-swift~RivetKitSwiftUI'. — rivetkit-swift/examples/hello-world-swiftui/client/Sources/HelloWorldApp/ContentView.swift:29
`ApiCtx` (slice 'rivet_api_builder') depends on `StandaloneCtx` from slice 'gasoline'. — engine/packages/api-builder/src/context.rs:11
`ApiError` (slice 'rivet_api_builder') depends on `Error` from slice 'rivet_cache'. — engine/packages/api-builder/src/error_response.rs:12
`ErrorResponse` (slice 'rivet_api_builder') depends on `Value` from slice 'universaldb'. — engine/packages/api-builder/src/error_response.rs:83
`ErrorExt` (slice 'rivet_api_builder') depends on `Value` from slice 'universaldb'. — engine/packages/api-builder/src/error_response.rs:117
`GlobalApiCtx` (slice 'rivet_api_builder') depends on `Config` from slice 'rivet_config'. — engine/packages/api-builder/src/global_context.rs:6
`LoggingMiddlewareState` (slice 'rivet_api_builder') depends on `Config` from slice 'rivet_config'. — engine/packages/api-builder/src/router.rs:24
`CachePurgeRequest` (slice 'rivet_api_peer') depends on `RawCacheKey` from slice 'rivet_cache'. — engine/packages/api-peer/src/internal.rs:19
`GetEpoxyStateResponse` (slice 'rivet_api_peer') depends on `ClusterConfig` from slice 'epoxy'. — engine/packages/api-peer/src/internal.rs:114
`SetEpoxyStateRequest` (slice 'rivet_api_peer') depends on `ClusterConfig` from slice 'epoxy'. — engine/packages/api-peer/src/internal.rs:143
`GetEpoxyReplicaDebugResponse` (slice 'rivet_api_peer') depends on `ClusterConfig` from slice 'epoxy'. — engine/packages/api-peer/src/internal.rs:184
`EpoxyReplicaDebugComputed` (slice 'rivet_api_peer') depends on `ReplicaStatus` from slice 'epoxy'. — engine/packages/api-peer/src/internal.rs:190
`CreateResponse` (slice 'rivet_api_peer') depends on `Namespace` from slice 'rivet_cli'. — engine/packages/api-peer/src/namespaces.rs:87
`ApiCtx` (slice 'rivet_api_public') depends on `ApiCtx` from slice 'rivet_api_builder'. — engine/packages/api-public/src/ctx.rs:12
`ListResponse` (slice 'rivet_api_public') depends on `Pagination` from slice 'rivet_api_types'. — engine/packages/api-public/src/runner_configs/list.rs:23
`CreateRequest` (slice 'rivet_api_types') depends on `CrashPolicy` from slice 'rivet_types'. — engine/packages/api-types/src/actors/create.rs:14
`CreateResponse` (slice 'rivet_api_types') depends on `Actor` from slice 'pegboard'. — engine/packages/api-types/src/actors/create.rs:28
`GetOrCreateRequest` (slice 'rivet_api_types') depends on `CrashPolicy` from slice 'rivet_types'. — engine/packages/api-types/src/actors/get_or_create.rs:14
`GetOrCreateResponse` (slice 'rivet_api_types') depends on `Actor` from slice 'pegboard'. — engine/packages/api-types/src/actors/get_or_create.rs:27
`ListResponse` (slice 'rivet_api_types') depends on `Actor` from slice 'pegboard'. — engine/packages/api-types/src/actors/list.rs:27
`ListResponse` (slice 'rivet_api_types') depends on `Datacenter` from slice 'rivet_api_util'. — engine/packages/api-types/src/datacenters/list.rs:9
`ListResponse` (slice 'rivet_api_types') depends on `Envoy` from slice 'rivet_types'. — engine/packages/api-types/src/envoys/list.rs:21
`ListResponse` (slice 'rivet_api_types') depends on `Namespace` from slice 'rivet_cli'. — engine/packages/api-types/src/namespaces/list.rs:22
`RunnerConfig` (slice 'rivet_api_types') depends on `Value` from slice 'universaldb'. — engine/packages/api-types/src/namespaces/runner_configs.rs:7
`ListQuery` (slice 'rivet_api_types') depends on `RunnerConfigVariant` from slice 'rivet_types'. — engine/packages/api-types/src/runner_configs/list.rs:13
`RunnerConfigResponse` (slice 'rivet_api_types') depends on `RunnerPoolError` from slice 'rivet_types'. — engine/packages/api-types/src/runner_configs/mod.rs:7
`ListResponse` (slice 'rivet_api_types') depends on `Runner` from slice 'pegboard'. — engine/packages/api-types/src/runners/list.rs:26
`CachePurgeRequest` (slice 'rivet_api_util') depends on `RawCacheKey` from slice 'rivet_cache'. — engine/packages/api-util/src/lib.rs:316
`CheckInput` (slice 'rivet_auth') depends on `TargetScope` from slice 'rivet_api_types'. — engine/packages/auth/src/check.rs:16
`JwtCredential` (slice 'rivet_auth') depends on `VerifiedJwt` from slice 'rivet_auth_jwt'. — engine/packages/auth/src/check.rs:31
`CacheInner` (slice 'rivet_cache') depends on `PubSub` from slice 'rivet_config'. — engine/packages/cache/src/inner.rs:16
`InFlightLeaseGuard` (slice 'rivet_cache') depends on `Cache` from slice 'rivet_config'. — engine/packages/cache/src/req_config.rs:21
`RequestConfig` (slice 'rivet_cache') depends on `Cache` from slice 'rivet_config'. — engine/packages/cache/src/req_config.rs:57
`NamespacesResponse` (slice 'rivet_cli') depends on `Pagination` from slice 'rivet_api_types'. — engine/packages/cli/src/cloud.rs:29
`ManagedPoolsListResponse` (slice 'rivet_cli') depends on `Pagination` from slice 'rivet_api_types'. — engine/packages/cli/src/cloud.rs:76
What to do
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
Do you agree with this assessment?
AX8 · Test isolation7.5 / 10Strong✓ 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.
`gasoline` (production) references the test project `rivet-test-deps`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
What to do
Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
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.
Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
`GameServer.arm_idle_timeout` is an event/message handler that blocks the executor on a synchronous wait (`block_on`/`blocking_recv`/`thread::sleep`/a blocking `recv()`) — it stalls the handler and serialises throughput, and on an async runtime can starve the reactor. Either move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`, if the result isn't needed inline) or make the handler itself `async` so it can `.await`. — container-runner/src/actor.rs:98
What to do
Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.
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.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 125 of 211 project(s) that lack one — worth up to 1.2 pts.
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.
3 ADR-shaped document(s) detected by content — `docs-internal/engine/sqlite/constraints-and-design-decisions.md`, `docs-internal/rivetkit-typescript/sqlite-ltx/archive/constraints.md`, `docs-internal/rivetkit-typescript/sqlite-ltx/archive/design-decisions.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
What to do
Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
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.
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.
Do you agree with this assessment?
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.
Only 59/64 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `rivetkit-typescript/packages/cli`, `rivetkit-typescript/packages/mcp-hub`, `rivetkit-typescript/packages/supabase`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.
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.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
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.
`reqwest::Client::new(` 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. 5 of the 11 files that make outbound calls are unbounded; the first 5 are listed. — container-runner/src/proxy.rs:34
`reqwest::Client::new(` 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) — engine/packages/cli/src/cloud.rs:134, rivetkit-rust/packages/client/src/remote_manager.rs:140
`hyper_util::client::legacy::Client::builder(` 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. — engine/packages/pools/src/db/clickhouse.rs:34
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rivetkit-typescript/packages/mcp-hub/src/index.ts:78
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.
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.
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) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`startLocalKitchenSinkServer` is async and calls mkdtempSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — examples/kitchen-sink/scripts/mock-agentic-loop.ts:512
`stopLocalKitchenSinkServer` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — examples/kitchen-sink/scripts/mock-agentic-loop.ts:573
`startLocalEngine` is async and calls mkdtempSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — examples/kitchen-sink/scripts/sqlite-cold-start-bench.ts:565, examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:989
`stopLocalEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — examples/kitchen-sink/scripts/sqlite-cold-start-bench.ts:598, examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:1050
`startEngine` is async and calls mkdtempSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — examples/kitchen-sink/scripts/sqlite-memory-soak.ts:582
`stopChild` is async and calls appendFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — examples/kitchen-sink/scripts/sqlite-memory-soak.ts:824
`stopEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — examples/kitchen-sink/scripts/sqlite-memory-soak.ts:848
`main` is async and calls mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — examples/kitchen-sink/scripts/sqlite-memory-soak.ts:1894, examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:1562
`runMatrix` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:1513
`registerLegacyCustomKit` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — frontend/packages/icons/scripts/generate-manifest.js:238
`main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — frontend/packages/icons/scripts/generate-manifest.js:288
`bundleWithEsbuild` is async and calls existsSync, rmSync, mkdirSync, writeFileSync, renameSync, statSync, readdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — frontend/packages/icons/scripts/vendor-icons.js:273
`startEngine` is async and calls mkdtempSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — integrations/workflow-world/scripts/conformance/run.ts:93, integrations/workflow-world/scripts/integration/run.ts:113
`run` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — integrations/workflow-world/scripts/conformance/run.ts:254, integrations/workflow-world/scripts/integration/run.ts:858
`acquireEngineStartLock` is async and calls mkdirSync, rmSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:103
`spawnSharedEngine` is async and calls mkdtempSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:259
`getOrStartSharedTestEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:375
`releaseSharedTestEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:437
`cleanup` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/rivetkit/tests/driver/engine-restart-serverless.ts:184
`load` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/sql-loader/src/hook.ts:5
`filesFromHookInput` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/format/agent-format.mjs:36
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.
Do you agree with this assessment?
R1 · Type Safety9.6 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
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.
14 duplicated blocks under the repository root have copies in at least two of the sibling directories engine, rivetkit-typescript, scripts, shared — 12 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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. — engine/sdks/typescript/runner/src/mod.ts:1
14 duplicated blocks under rivetkit-typescript/packages/ have copies in at least two of the sibling directories cli, cloudflare-workers, effect, engine-cli, rivetkit, supabase (+2 more sibling(s) not listed) — 11 of them are reported below, and 3 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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. — rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12
12 duplicated blocks under rivetkit-typescript/packages/rivetkit/src/ have copies in at least two of the sibling directories actor, client, common, db, engine-client, inspector (+3 more sibling(s) not listed) — 7 of them are reported below, and 5 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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. — REDACTED:18
5 duplicated blocks under scripts/api/ have copies in at least two of the sibling directories actors, gateway, runner-configs, runners — 4 of them are reported below, and 1 is 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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. — scripts/api/runner-configs/list.ts:5
engine/sdks/typescript/runner/src/mod.ts:1 · rivetkit-typescript/packages/engine-runner/src/mod.ts:1 — these 2 files are line-for-line copies of one another — 1074 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. — engine/sdks/typescript/runner/src/mod.ts:1
engine/sdks/typescript/runner/src/tunnel.ts:1 · rivetkit-typescript/packages/engine-runner/src/tunnel.ts:1 — these 2 files are line-for-line copies of one another — 607 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. — engine/sdks/typescript/runner/src/tunnel.ts:1
engine/sdks/typescript/runner/src/stringify.ts:1 · rivetkit-typescript/packages/engine-runner/src/stringify.ts:1 — these 2 files are line-for-line copies of one another — 216 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. — engine/sdks/typescript/runner/src/stringify.ts:1
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v1.ts:4 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts:4 — the two spans are one implementation copied and then locally edited — 1125 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. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v1.ts:4
engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts:2 · rivetkit-typescript/packages/engine-runner/src/websocket-tunnel-adapter.ts:2 — these 2 files are line-for-line copies of one another — 166 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. — engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts:2
integrations/workflow-world/scripts/conformance/run.ts:56 · integrations/workflow-world/scripts/integration/run.ts:76 — 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. — integrations/workflow-world/scripts/conformance/run.ts:56
engine/sdks/typescript/runner/src/actor.ts:1 · rivetkit-typescript/packages/engine-runner/src/actor.ts:1 — these 2 files are line-for-line copies of one another — 141 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. — engine/sdks/typescript/runner/src/actor.ts:1
rivetkit-typescript/packages/workflow-engine/src/context.ts:2004 · rivetkit-typescript/packages/workflow-engine/src/context.ts:2216 — the two spans are one implementation copied and then locally edited — 546 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. — rivetkit-typescript/packages/workflow-engine/src/context.ts:2004
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts:93 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:498 — the two spans are one implementation copied and then locally edited — 528 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. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts:93
engine/sdks/typescript/runner/src/utils.ts:1 · rivetkit-typescript/packages/engine-runner/src/utils.ts:1 — these 2 files are line-for-line copies of one another — 86 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. — engine/sdks/typescript/runner/src/utils.ts:1
rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:533 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:382 — the two spans are one implementation copied and then locally edited — 465 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. — rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:533
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:96 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:98 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:96
rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1986 · rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2085 — all 2 copies are in the same file, 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. — rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1986
rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12 · rivetkit-typescript/packages/workflow-engine/scripts/compile-bare.ts:15 — these 2 files are line-for-line copies of one another — 60 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. — rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12
rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:977 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:948 — the two spans are one implementation copied and then locally edited — 290 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:977
rivetkit-typescript/packages/rivetkit/src/inspector/client.browser.ts:293 · rivetkit-typescript/packages/rivetkit/src/inspector/client.browser.ts:346 — 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. — rivetkit-typescript/packages/rivetkit/src/inspector/client.browser.ts:293
rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:214 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:214
rivetkit-typescript/packages/cli/index.js:6 · rivetkit-typescript/packages/engine-cli/index.js:18 — the two spans are one implementation copied and then locally edited — 263 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. — rivetkit-typescript/packages/cli/index.js:6
rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:196 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:96 — the two spans are one implementation copied and then locally edited — 232 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. — rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:196
rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:325 · rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:432 — the two spans are one implementation copied and then locally edited — 347 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. — rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:325
rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:259 · rivetkit-typescript/packages/rivetkit/src/workflow/mod.ts:109 — the two spans are one implementation copied and then locally edited — 108 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. — rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:259
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:179 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:181 — 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. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:179
rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:127 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:184 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:231 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:127
engine/sdks/typescript/runner/src/websocket.ts:6 · rivetkit-typescript/packages/engine-runner/src/websocket.ts:6 — 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. — engine/sdks/typescript/runner/src/websocket.ts:6
rivetkit-typescript/packages/rivetkit/scripts/check-annotated-skips.ts:5 · rivetkit-typescript/packages/rivetkit/scripts/check-wait-for-comments.ts:5 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — rivetkit-typescript/packages/rivetkit/scripts/check-annotated-skips.ts:5
rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:132 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:167 — all 2 copies are in the same file, 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. — rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:132
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:5 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:5
scripts/debug/decode_epoxy_changelog.js:12 · scripts/debug/decode_runner_config.js:16 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/debug/decode_epoxy_changelog.js:12
rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2161 · rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:167 — 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. — rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2161
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:52 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:54 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:52
rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:677 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:751 — 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. — rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:677
rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:234 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:236 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:234
rivetkit-typescript/packages/effect/src/RivetError.ts:11 · rivetkit-typescript/packages/effect/src/RivetError.ts:46 · rivetkit-typescript/packages/effect/src/RivetError.ts:81 · rivetkit-typescript/packages/effect/src/RivetError.ts:116 · +19 more site(s) not listed — all 23 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — rivetkit-typescript/packages/effect/src/RivetError.ts:11
rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:920 · rivetkit-typescript/packages/rivetkit/src/client/utils.ts:181 — the two spans are one implementation copied and then locally edited — 133 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. — rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:920
rivetkit-typescript/packages/rivetkit/src/common/database/mod.ts:309 · rivetkit-typescript/packages/rivetkit/src/db/drizzle.ts:275 — 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. — rivetkit-typescript/packages/rivetkit/src/common/database/mod.ts:309
scripts/api/runner-configs/list.ts:5 · scripts/api/runners/list.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. — scripts/api/runner-configs/list.ts:5
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.
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.
main has cyclomatic complexity 89 and cognitive complexity 177; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/debug/logfmt_to_gantt.ts:104
(anonymous) has cyclomatic complexity 87 and cognitive complexity 127; 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. — integrations/workflow-world/src/actors/workflow-run.ts:568
(anonymous) has cyclomatic complexity 72 and cognitive complexity 89; 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. — rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4148
assertJsonCompatValue has cyclomatic complexity 42 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:77
executeLoop has cyclomatic complexity 33 and cognitive complexity 55; 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. — rivetkit-typescript/packages/workflow-engine/src/context.ts:1150
(anonymous) has cyclomatic complexity 33 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. — rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:309
executeStep has cyclomatic complexity 32 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — rivetkit-typescript/packages/workflow-engine/src/context.ts:790
main has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/skill-evals/src/index.ts:557
executeRace has cyclomatic complexity 30 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/workflow-engine/src/context.ts:2228
buildNativeFactory has cyclomatic complexity 29 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4033
bumpPackageJsons has cyclomatic complexity 28 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/publish/src/lib/version.ts:187
executeWorkflow has cyclomatic complexity 26 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/workflow-engine/src/index.ts:953
encodeJsonCompatValue has cyclomatic complexity 25 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:280
create has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — integrations/workflow-world/src/index.ts:340
flush has cyclomatic complexity 23 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 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. — rivetkit-typescript/packages/workflow-engine/src/storage.ts:240
collectTurnText has cyclomatic complexity 22 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/skill-evals/src/index.ts:243
convertExpr has cyclomatic complexity 21 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/vbare-gen-converters/index.ts:182
decodeOne has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/debug/decode_fdb_tuple.js:140
unwrapDeep has cyclomatic complexity 20 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/registry/write-through-proxy.ts:63
createPlatformServerlessRunner has cyclomatic complexity 20 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/tests/platforms/shared-platform-harness.ts:480
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files4.2 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
47 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: rivetkit-typescript/packages/rivetkit/src/registry/native.ts (5324), rivetkit-typescript/packages/workflow-engine/src/context.ts (2389), rivetkit-typescript/packages/rivetkit/src/actor/config.ts (2345), engine/sdks/typescript/runner/src/mod.ts (1714), rivetkit-typescript/packages/engine-runner/src/mod.ts (1678), rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts (1443) (+41 more).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage5.7 / 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.
engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts:2 imports '../src/index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts
frontend/src/app/billing/plan-badge.stories.tsx:5 imports './billing-plan-badge', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/billing/plan-badge.stories.tsx
frontend/src/app/byoc/agent-instructions.test.ts:2 imports './agent-instructions', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/byoc/agent-instructions.test.ts
frontend/src/app/byoc/cluster-config.test.ts:2 imports './cluster-config', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/byoc/cluster-config.test.ts
frontend/src/app/byoc/setup-links.test.ts:2 imports '../../content/byoc', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/byoc/setup-links.test.ts
frontend/src/app/env-variables.stories.tsx:5 imports './env-variables', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/env-variables.stories.tsx
frontend/src/app/onboarding-skeleton.stories.tsx:3 imports './onboarding-skeleton', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/onboarding-skeleton.stories.tsx
frontend/src/app/pool-switcher.stories.tsx:4 imports './pool-switcher', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/pool-switcher.stories.tsx
frontend/src/app/runner-config-table.stories.tsx:10 imports './runner-config-table', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/runner-config-table.stories.tsx
frontend/src/app/runner-pool-error-popover.stories.tsx:6 imports './runner-pool-error-popover', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/runner-pool-error-popover.stories.tsx
frontend/src/app/serverless-connection-check.stories.tsx:4 imports './serverless-connection-check', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/serverless-connection-check.stories.tsx
frontend/src/app/serverless-health-error.test.ts:2 imports './serverless-health-error', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/serverless-health-error.test.ts
frontend/src/app/settings-pages/settings-card.stories.tsx:5 imports './settings-card', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/settings-pages/settings-card.stories.tsx
frontend/src/app/settings-pages/whats-new-panel.stories.tsx:5 imports './whats-new-panel', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/app/settings-pages/whats-new-panel.stories.tsx
frontend/src/components/actors/actor-inspector-protocol.test.ts:6 imports './actor-inspector-context', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/actors/actor-inspector-protocol.test.ts
frontend/src/components/actors/actor-schedules-tab.test.ts:3 imports './actor-schedules-format', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/actors/actor-schedules-tab.test.ts
frontend/src/components/actors/queries/index.test.ts:2 imports './index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/actors/queries/index.test.ts
frontend/src/components/actors/workflow/workflow-to-xyflow.test.ts:2 imports './workflow-example-data', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/actors/workflow/workflow-to-xyflow.test.ts
frontend/src/components/actors/workflow/xyflow-nodes.stories.tsx:14 imports './workflow-example-data', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (2 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/actors/workflow/xyflow-nodes.stories.tsx
frontend/src/components/lazy-icon.stories.tsx:5 imports './lazy-icon', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/lazy-icon.stories.tsx
frontend/src/components/mcp/scope.test.ts:2 imports './scope', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/mcp/scope.test.ts
frontend/src/components/onboarding/agent-os/agent-os-onboarding.stories.tsx:4 imports './agent-select-step', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (4 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/onboarding/agent-os/agent-os-onboarding.stories.tsx
frontend/src/components/products/product-picker.stories.tsx:3 imports './product-picker', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/products/product-picker.stories.tsx
frontend/src/components/ui/icon-picker.stories.tsx:5 imports './icon-picker', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/components/ui/icon-picker.stories.tsx
frontend/src/content/agent-prompts.test.ts:2 imports './agent-prompts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/content/agent-prompts.test.ts
frontend/src/lib/errors.test.ts:3 imports './errors', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/lib/errors.test.ts
frontend/src/lib/format-value.test.ts:2 imports './format-value', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — frontend/src/lib/format-value.test.ts
rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts:7 imports '../../src/common/bare/generated/actor-runtime-socket-protocol/v1', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts
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. (×12) — engine/sdks/typescript/runner/src/mod.ts, engine/sdks/typescript/runner/src/tunnel.ts, integrations/workflow-world/scripts/integration/run.ts, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
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.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
This repository declares test tooling, and the ✓ above records that declaration — but engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts and 27 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts
Do you agree with this assessment?
R7 · Dead Code7.4 / 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) (~39 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — engine/sdks/typescript/envoy-protocol
1 file(s) (~4 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — rivetkit-typescript/packages/engine-runner-protocol
6 file(s) (~455 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. — scripts/api
Unreachable from the 161 application, 68 tooling and 414 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 (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.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 (×3) — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts, rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts, rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v1.ts
no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.ts, rivetkit-typescript/packages/rivetkit/src/common/actor-persist.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 — rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts
no import path from any entry point (161 application, 68 tooling, 414 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 (×21) — rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.ts, rivetkit-typescript/packages/rivetkit/runtime/index.ts, rivetkit-typescript/packages/rivetkit/src/utils/router.ts, …
no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/dynamic/instance.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 — rivetkit-typescript/packages/rivetkit/src/dynamic/isolate-runtime.ts
no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/utils/router.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 — rivetkit-typescript/packages/rivetkit/src/common/cors.ts
Nothing imports this binding — it is safe to review for removal. (×9) — rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:163, rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:171, rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:175, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
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.
Declared in the root package.json 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.
Declared in engine/sdks/typescript/test-runner/package.json 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.
Declared in frontend/package.json 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.
Every import is type-only — move it to devDependencies. — engine/sdks/typescript/test-runner/src/index.ts:7
Only test files import it — move it to devDependencies. — frontend/src/app/settings-pages/settings-card.stories.tsx:2
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
`https://analytics.ahrefs.com/analytics.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. — frontend/index.html:4
No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — frontend/Caddyfile:13
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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.
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.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 21 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 60 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — not 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
AX2 Stateful singletons — 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
AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 18 — an image could not be pulled) — rivet-engine Pulling game Pulling rivet-engine Error Get "https://registry-1.docker.io/v2/": Forbidden game Warning context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: game Pulling rivet-engine Pulling rivet-engine Error Get "https://registry-1.docker.io/v2/": Forbidden game Warning context canceled WARNING: Some service image(s) must be built from source by running: docker compose build game Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D12 Dependency Hygiene — Dependency hygiene not measured — this repository's dependencies are not NuGet
D14 License Compliance — Not scored — this repository's 730 shipped crate(s) were read from its REDACTED, but crates.io could not be asked for the licence of 63 of them (HTTP 429 Unknown Error), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
D17 Explicit Debt — the C# workspace loaded 0 projects, so explicit-debt density could not be measured
D18 Solution Shape — D18 scores the shape of a C#/VB .NET solution; this repository's .NET projects are all F# (.fsproj), which the C#/VB workspace does not load, so the dimension does not apply.
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. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — none of 3 ADRs are conformance-checkable — unverifiable.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — 44 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.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — engine/sdks/typescript/envoy-protocol/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 82 value object(s); 6 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 this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — Drizzle is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — no coverage report found on disk — 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, or wire coverage collection into CI, to enable this cross-layer check
PF2 Allocation hygiene — Not applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift has 4,362 production line(s), 1 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — 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.
D30 · Dependency Vulnerabilities· High vulnerability · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
AC2 · Forms & labels· <input> without a programmatic label · ×4
<input> without a programmatic label frontend/src/components/actors/actor-logs-tab.tsx:21— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label frontend/src/components/ui/filters.tsx:421— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label frontend/src/routes/_context/orgs.$organization/projects.$project/ns.$namespace/logs.tsx:152— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label scripts/debug/diff-viewer/server.js:86— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<html> without a lang rivetkit-rust/packages/rivetkit-core/src/inspector_bundle/wasm-custom-tab-unavailable.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang scripts/debug/diff-viewer/server.js:74— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label frontend/src/app/feedback-button.tsx:64— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels· <button> with no accessible text · ×1
<button> with no accessible text frontend/src/components/actors/workflow/workflow-visualizer.tsx:277— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AX8 · Test isolation· Production project references a test project · ×1
Production project references a test project: gasoline → rivet-test-deps — `gasoline` (production) references the test project `rivet-test-deps`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
D10 · Test Quality· No assertions (empty test) · ×1
No assertions (empty test): satisfies the same shared runtime interface as the NAPI adapter rivetkit-typescript/packages/rivetkit/tests/wasm-runtime.test.ts:240— Test method has an empty body — it asserts nothing and exercises no code.
Blocking wait inside a handler: GameServer.arm_idle_timeout container-runner/src/actor.rs:98— `GameServer.arm_idle_timeout` is an event/message handler that blocks the executor on a synchronous wait (`block_on`/`blocking_recv`/`thread::sleep`/a blocking `recv()`) — it stalls the handler and serialises throughput, and on an async runtime can starve the reactor. Either move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`, if the result isn't needed inline) or make the handler itself `async` so it can `.await`.
FileTooLong: registry/native.ts rivetkit-typescript/packages/rivetkit/src/registry/native.ts— FileTooLong — 4022 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3522 over it, 8.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/versioned.rs engine/packages/runner-protocol/src/versioned.rs— FileTooLong — 2896 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 88 free functions. The bar is 500 significant lines; this is 2396 over it, 5.79× 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/doctor.rs engine/packages/depot/src/doctor.rs— FileTooLong — 2705 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 2205 over it, 5.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: kv/mod.rs engine/packages/gasoline/src/db/kv/mod.rs— FileTooLong — 2633 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: DatabaseKv (4 blocks, 52-3483). The bar is 500 significant lines; this is 2133 over it, 5.27× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/vfs.rs engine/packages/depot-client/src/vfs.rs— FileTooLong — 2632 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 52 free functions. The bar is 500 significant lines; this is 2132 over it, 5.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs— FileTooLong — 2414 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 71 free functions. The bar is 500 significant lines; this is 1914 over it, 4.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: actor/metrics.rs rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs— FileTooLong — 2334 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 1834 over it, 4.67× 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: compaction/shared.rs engine/packages/depot/src/compaction/shared.rs— FileTooLong — 2329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 1829 over it, 4.66× 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: kv/repair.rs engine/packages/gasoline/src/db/kv/repair.rs— FileTooLong — 2045 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: DatabaseKv (284-2960). The bar is 500 significant lines; this is 1545 over it, 4.09× 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/ws_to_tunnel_task.rs engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs— FileTooLong — 1950 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 76 free functions. The bar is 500 significant lines; this is 1450 over it, 3.90× 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: actor/config.ts rivetkit-typescript/packages/rivetkit/src/actor/config.ts— FileTooLong — 1888 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1388 over it, 3.78× 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: kv/debug.rs engine/packages/gasoline/src/db/kv/debug.rs— FileTooLong — 1826 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: DatabaseKv (3 blocks, 43-2261). The bar is 500 significant lines; this is 1326 over it, 3.65× 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/context.ts rivetkit-typescript/packages/workflow-engine/src/context.ts— FileTooLong — 1739 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1239 over it, 3.48× 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: keys/history.rs engine/packages/gasoline/src/db/kv/keys/history.rs— FileTooLong — 1580 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 1080 over it, 3.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: actor/task.rs rivetkit-rust/packages/rivetkit-core/src/actor/task.rs— FileTooLong — 1528 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: ActorTask (2 blocks, 332-2336). The bar is 500 significant lines; this is 1028 over it, 3.06× 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/shared_state.rs engine/packages/pegboard-gateway3/src/shared_state.rs— FileTooLong — 1502 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 1002 over it, 3.00× 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/proxy_service.rs engine/packages/guard-core/src/proxy_service.rs— FileTooLong — 1336 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: ProxyService (3 blocks, 353-2060). The bar is 500 significant lines; this is 836 over it, 2.67× 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: keys/ns.rs engine/packages/pegboard/src/keys/ns.rs— FileTooLong — 1330 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 830 over it, 2.66× 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: actor/context.rs rivetkit-rust/packages/rivetkit-core/src/actor/context.rs— FileTooLong — 1299 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 799 over it, 2.60× 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: conveyer/read.rs engine/packages/depot/src/conveyer/read.rs— FileTooLong — 1260 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: Db (58-1214). The bar is 500 significant lines; this is 760 over it, 2.52× 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: sqlite/mod.rs rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs— FileTooLong — 1211 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: SqliteDb (5 blocks, 104-1527). The bar is 500 significant lines; this is 711 over it, 2.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: compaction/types.rs engine/packages/depot/src/compaction/types.rs— FileTooLong — 1207 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 707 over it, 2.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: actors/workflow-run.ts integrations/workflow-world/src/actors/workflow-run.ts— FileTooLong — 1173 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: workflowRun (539-1479). The bar is 500 significant lines; this is 673 over it, 2.35× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: actor/schedule.rs rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs— FileTooLong — 1142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 64% of them inside a single declaration: ActorContext (172-1150). The bar is 500 significant lines; this is 642 over it, 2.28× 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/mod.ts engine/sdks/typescript/runner/src/mod.ts— FileTooLong — 1103 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: Runner (203-1977). The bar is 500 significant lines; this is 603 over it, 2.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FunctionTooLong: native.buildNativeFactory rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4033— FunctionTooLong — buildNativeFactory runs 1167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1067 over it, 11.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: traces.createTraces rivetkit-typescript/packages/traces/src/traces.ts:141— FunctionTooLong — createTraces runs 803 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 703 over it, 8.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.
FunctionTooLong: pegboard::workflows::actor::pegboard_actor engine/packages/pegboard/src/workflows/actor/mod.rs:37— FunctionTooLong — pegboard::workflows::actor::pegboard_actor runs 570 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 470 over it, 5.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: database-vfs.createDatabaseVfs rivetkit-typescript/packages/rivetkit/src/agent-os/fs/database-vfs.ts:142— FunctionTooLong — createDatabaseVfs runs 347 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 247 over it, 3.47× 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: pegboard::workflows::actor2::process_signal engine/packages/pegboard/src/workflows/actor2/mod.rs:635— FunctionTooLong — pegboard::workflows::actor2::process_signal runs 333 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 233 over it, 3.33× 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: docker-compose.generateDockerCompose self-host/compose/template/src/docker-compose.ts:6— FunctionTooLong — generateDockerCompose runs 315 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 215 over it, 3.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot::doctor::doctor engine/packages/depot/src/doctor.rs:432— FunctionTooLong — depot::doctor::doctor runs 307 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 207 over it, 3.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.
FunctionTooLong: rivetkit_napi::napi_actor_events::dispatch_event rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:381— FunctionTooLong — rivetkit_napi::napi_actor_events::dispatch_event runs 300 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: logfmt_to_gantt.main scripts/debug/logfmt_to_gantt.ts:104— FunctionTooLong — main runs 299 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 199 over it, 2.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pegboard::workflows::actor::runtime::spawn_actor engine/packages/pegboard/src/workflows/actor/runtime.rs:644— FunctionTooLong — pegboard::workflows::actor::runtime::spawn_actor runs 292 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 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivetkit_wasm::dispatch_event rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:722— FunctionTooLong — rivetkit_wasm::dispatch_event runs 277 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 177 over it, 2.77× 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: rivet_engine::util::wf::print_history engine/packages/engine/src/util/wf/mod.rs:130— FunctionTooLong — rivet_engine::util::wf::print_history runs 271 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 171 over it, 2.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot::workflows::db_hot_compactor::install_hot_chunk_tx engine/packages/depot/src/workflows/db_hot_compactor.rs:912— FunctionTooLong — depot::workflows::db_hot_compactor::install_hot_chunk_tx runs 260 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 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot::doctor::load_storage_facts engine/packages/depot/src/doctor.rs:1252— FunctionTooLong — depot::doctor::load_storage_facts runs 248 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 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pegboard_runner::ws_to_tunnel_task::handle_message_mk2 engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:142— FunctionTooLong — pegboard_runner::ws_to_tunnel_task::handle_message_mk2 runs 237 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 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivet_guard::routing::pegboard_gateway::handle_actor_v2 engine/packages/guard/src/routing/pegboard_gateway/mod.rs:518— FunctionTooLong — rivet_guard::routing::pegboard_gateway::handle_actor_v2 runs 224 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 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: universaldb::driver::postgres::resolver::drain_batch engine/packages/universaldb/src/driver/postgres/resolver/mod.rs:419— FunctionTooLong — universaldb::driver::postgres::resolver::drain_batch runs 222 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 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.
FunctionTooLong: rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:44— FunctionTooLong — rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner runs 220 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 120 over it, 2.20× 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: pegboard_outbound::serverless_outbound_req engine/packages/pegboard-outbound/src/lib.rs:396— FunctionTooLong — pegboard_outbound::serverless_outbound_req runs 213 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 113 over it, 2.13× 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: depot::compaction::shared::read_commit_delta_reclaim_window engine/packages/depot/src/compaction/shared.rs:972— FunctionTooLong — depot::compaction::shared::read_commit_delta_reclaim_window runs 209 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 109 over it, 2.09× 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: depot::workflows::db_reclaimer::reclaim_fdb_job_tx engine/packages/depot/src/workflows/db_reclaimer.rs:641— FunctionTooLong — depot::workflows::db_reclaimer::reclaim_fdb_job_tx runs 209 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 109 over it, 2.09× 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: pegboard_runner::ws_to_tunnel_task::handle_message_mk1 engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:501— FunctionTooLong — pegboard_runner::ws_to_tunnel_task::handle_message_mk1 runs 209 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 109 over it, 2.09× 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: pegboard::workflows::runner::pegboard_runner engine/packages/pegboard/src/workflows/runner.rs:62— FunctionTooLong — pegboard::workflows::runner::pegboard_runner runs 209 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 109 over it, 2.09× 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: depot::conveyer::commit::publish::publish_commit engine/packages/depot/src/conveyer/commit/publish.rs:73— FunctionTooLong — depot::conveyer::commit::publish::publish_commit runs 200 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 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pegboard::workflows::serverless::conn::outbound_req_inner engine/packages/pegboard/src/workflows/serverless/conn.rs:198— FunctionTooLong — pegboard::workflows::serverless::conn::outbound_req_inner runs 192 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 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Db.get_pages_with_options engine/packages/depot/src/conveyer/read.rs:70— MethodTooLong — get_pages_with_options runs 788 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 688 over it, 7.88× 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: SubCommand.execute engine/packages/engine/src/commands/udb/cli.rs:156— MethodTooLong — execute runs 631 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 531 over it, 6.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DatabaseKv.pull_workflows engine/packages/gasoline/src/db/kv/mod.rs:1138— MethodTooLong — pull_workflows runs 604 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 504 over it, 6.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ProxyService.handle_websocket_upgrade engine/packages/guard-core/src/proxy_service.rs:1113— MethodTooLong — handle_websocket_upgrade runs 591 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 491 over it, 5.91× 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: ActorMetricCollectors.new rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:986— MethodTooLong — new runs 474 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 374 over it, 4.74× 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: PegboardGateway2.handle_websocket_inner engine/packages/pegboard-gateway2/src/lib.rs:347— MethodTooLong — handle_websocket_inner runs 427 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 327 over it, 4.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PegboardGateway3.handle_websocket_inner engine/packages/pegboard-gateway3/src/lib.rs:119— MethodTooLong — handle_websocket_inner runs 413 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 313 over it, 4.13× 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: InFlightRequestHandle.send_message_admitted engine/packages/pegboard-gateway3/src/shared_state.rs:821— MethodTooLong — send_message_admitted runs 343 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 243 over it, 3.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.
MethodTooLong: RegistryDispatcher.handle_actor_connect_websocket rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:93— MethodTooLong — handle_actor_connect_websocket runs 302 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 202 over it, 3.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Db.commit_with_options engine/packages/depot/src/conveyer/commit/apply.rs:48— MethodTooLong — commit_with_options runs 295 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 195 over it, 2.95× 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: PegboardEnvoyWs.handle_websocket engine/packages/pegboard-envoy/src/lib.rs:74— MethodTooLong — handle_websocket runs 280 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 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: PegboardGateway.handle_websocket_inner engine/packages/pegboard-gateway/src/lib.rs:253— MethodTooLong — handle_websocket_inner runs 259 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 159 over it, 2.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ProxyService.process engine/packages/guard-core/src/proxy_service.rs:376— MethodTooLong — process runs 233 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 133 over it, 2.33× 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: RegistryDispatcher.handle_inspector_fetch rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:22— MethodTooLong — handle_inspector_fetch runs 199 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 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RegistryDispatcher.handle_inspector_websocket rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs:166— MethodTooLong — handle_inspector_websocket runs 191 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 91 over it, 1.91× 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: DatabaseKv.get_workflow_history engine/packages/gasoline/src/db/kv/debug.rs:772— MethodTooLong — get_workflow_history runs 187 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 87 over it, 1.87× 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: InFlightRequestHandle.send_message engine/packages/pegboard-gateway2/src/shared_state.rs:596— MethodTooLong — send_message runs 186 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 86 over it, 1.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: SqliteProfileCollectors.new rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:752— MethodTooLong — new runs 186 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 86 over it, 1.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: DatabaseKv.inspect_loop_iteration_mismatch engine/packages/gasoline/src/db/kv/repair.rs:817— MethodTooLong — inspect_loop_iteration_mismatch runs 183 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 83 over it, 1.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.
MethodTooLong: DatabaseKv.inspect_missing_init_state engine/packages/gasoline/src/db/kv/repair.rs:1269— MethodTooLong — inspect_missing_init_state runs 183 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 83 over it, 1.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.
MethodTooLong: ProxyService.handle_http_request engine/packages/guard-core/src/proxy_service.rs:833— MethodTooLong — handle_http_request runs 181 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 81 over it, 1.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DatabaseKv.inspect_orphaned_sleep_state engine/packages/gasoline/src/db/kv/repair.rs:1782— MethodTooLong — inspect_orphaned_sleep_state runs 180 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 80 over it, 1.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: Db.commit_finalize engine/packages/depot/src/conveyer/commit/stage.rs:387— MethodTooLong — commit_finalize runs 170 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 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: Runner.#openPegboardWebSocket engine/sdks/typescript/runner/src/mod.ts:756— MethodTooLong — #openPegboardWebSocket 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: DatabaseKv.silence_workflows engine/packages/gasoline/src/db/kv/debug.rs:430— MethodTooLong — silence_workflows runs 163 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 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: rivetkit-typescript/packages/rivetkit/src/registry/native.ts rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4033— rivetkit-typescript/packages/rivetkit/src/registry/native.ts changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in native.buildNativeFactory at line 4033. 11 of those changes were fix/bug commits, and the other 25 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit/src/registry/native.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: rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:722— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in rivetkit_wasm::dispatch_event at line 722. 6 of those changes were fix/bug commits, and the other 18 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit-wasm/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: engine/packages/guard-core/src/proxy_service.rs engine/packages/guard-core/src/proxy_service.rs:1113— engine/packages/guard-core/src/proxy_service.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in ProxyService::handle_websocket_upgrade at line 1113. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/guard-core/src/proxy_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: rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:381— rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in rivetkit_napi::napi_actor_events::dispatch_event at line 381. 4 of those changes were fix/bug commits, and the other 9 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_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: rivetkit-rust/packages/rivetkit/src/start.rs rivetkit-rust/packages/rivetkit/src/start.rs:359— rivetkit-rust/packages/rivetkit/src/start.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in rivetkit::start::handle_actor_event at line 359. 4 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-rust/packages/rivetkit/src/start.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: engine/sdks/rust/envoy-client/src/envoy.rs engine/sdks/rust/envoy-client/src/envoy.rs:448— engine/sdks/rust/envoy-client/src/envoy.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in rivet_envoy_client::envoy::envoy_loop at line 448. 3 of those changes were fix/bug commits, and the other 6 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/sdks/rust/envoy-client/src/envoy.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: engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:685— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in pegboard_envoy::ws_to_tunnel_task::dispatch_message at line 685. 1 of those changes was a fix/bug commit, and the other 10 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/pegboard-envoy/src/ws_to_tunnel_task.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: engine/packages/pegboard-gateway2/src/lib.rs engine/packages/pegboard-gateway2/src/lib.rs:347— engine/packages/pegboard-gateway2/src/lib.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in PegboardGateway2::handle_websocket_inner at line 347. 2 of those changes were fix/bug commits, and the other 6 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/pegboard-gateway2/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: engine/packages/guard-core/src/utils.rs engine/packages/guard-core/src/utils.rs:391— engine/packages/guard-core/src/utils.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in rivet_guard_core::utils::err_into_response at line 391. 2 of those changes were fix/bug commits, and the other 5 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/guard-core/src/utils.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: rivetkit-rust/packages/rivetkit-core/src/actor/context.rs rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1347— rivetkit-rust/packages/rivetkit-core/src/actor/context.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ActorContext::prepare_state_deltas at line 1347. 1 of those changes was a fix/bug commit, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-rust/packages/rivetkit-core/src/actor/context.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: rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:327— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ActorHandleRaw.#sendActionAttempts at line 327. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit/src/client/actor-handle.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: engine/packages/universaldb/src/driver/postgres/resolver/mod.rs engine/packages/universaldb/src/driver/postgres/resolver/mod.rs:419— engine/packages/universaldb/src/driver/postgres/resolver/mod.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in universaldb::driver::postgres::resolver::drain_batch at line 419. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/universaldb/src/driver/postgres/resolver/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.
Hotspot: engine/packages/guard-core/src/response_body.rs engine/packages/guard-core/src/response_body.rs:149— engine/packages/guard-core/src/response_body.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ResponseBody::poll_frame at line 149. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/guard-core/src/response_body.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: engine/packages/engine/src/commands/udb/cli.rs engine/packages/engine/src/commands/udb/cli.rs:156— engine/packages/engine/src/commands/udb/cli.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in SubCommand::execute at line 156. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/engine/src/commands/udb/cli.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: engine/packages/pegboard-gateway3/src/lib.rs engine/packages/pegboard-gateway3/src/lib.rs:119— engine/packages/pegboard-gateway3/src/lib.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in PegboardGateway3::handle_websocket_inner at line 119. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/pegboard-gateway3/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: rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:22— rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in RegistryDispatcher::handle_inspector_fetch at line 22. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-rust/packages/rivetkit-core/src/registry/inspector.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: engine/packages/gasoline/src/db/kv/mod.rs engine/packages/gasoline/src/db/kv/mod.rs:1138— engine/packages/gasoline/src/db/kv/mod.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in DatabaseKv::pull_workflows at line 1138. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/gasoline/src/db/kv/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.
Hotspot: engine/packages/pegboard-gateway3/src/shared_state.rs engine/packages/pegboard-gateway3/src/shared_state.rs:821— engine/packages/pegboard-gateway3/src/shared_state.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in InFlightRequestHandle::send_message_admitted at line 821. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/pegboard-gateway3/src/shared_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.
Hotspot: rivetkit-rust/packages/rivetkit-core/src/actor/config.rs rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:258— rivetkit-rust/packages/rivetkit-core/src/actor/config.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ActorConfig::from_input at line 258. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-rust/packages/rivetkit-core/src/actor/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: scripts/publish/src/lib/version.ts scripts/publish/src/lib/version.ts:187— scripts/publish/src/lib/version.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in version.bumpPackageJsons at line 187. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- scripts/publish/src/lib/version.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: engine/packages/config/src/config/mod.rs engine/packages/config/src/config/mod.rs:260— engine/packages/config/src/config/mod.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Root::validate_and_set_defaults at line 260. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/config/src/config/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.
Hotspot: engine/sdks/rust/envoy-client/src/connection/native.rs engine/sdks/rust/envoy-client/src/connection/native.rs:96— engine/sdks/rust/envoy-client/src/connection/native.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in rivet_envoy_client::connection::native::single_connection at line 96. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/sdks/rust/envoy-client/src/connection/native.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: scripts/publish/src/lib/packages.ts scripts/publish/src/lib/packages.ts:118— scripts/publish/src/lib/packages.ts changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in packages.discoverPackages at line 118. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- scripts/publish/src/lib/packages.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: rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:309— rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in index.RegistryConfigSchema at line 309. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit/src/registry/config/index.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: engine/sdks/rust/envoy-client/src/connection/wasm.rs engine/sdks/rust/envoy-client/src/connection/wasm.rs:102— engine/sdks/rust/envoy-client/src/connection/wasm.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in rivet_envoy_client::connection::wasm::imp::single_connection at line 102. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/sdks/rust/envoy-client/src/connection/wasm.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.
+ 30 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium CVE · ×49
Duplicated block (9 lines × 2) engine/packages/depot/src/workflows/db_reclaimer.rs:293— engine/packages/depot/src/workflows/db_reclaimer.rs:293-301 | engine/packages/depot/src/workflows/db_reclaimer.rs:855-863 — both copies are in the same file, so extract the block into 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) engine/packages/engine/src/commands/depot_transfer.rs:744— engine/packages/engine/src/commands/depot_transfer.rs:744-752 | engine/packages/engine/src/commands/depot_transfer.rs:835-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 (9 lines × 2) engine/packages/engine/src/commands/udb/key_parser.rs:247— engine/packages/engine/src/commands/udb/key_parser.rs:247-255 | engine/packages/engine/src/util/udb.rs:34-42 — 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) engine/packages/gasoline/src/ctx/workflow.rs:1039— engine/packages/gasoline/src/ctx/workflow.rs:1039-1047 | engine/packages/gasoline/src/ctx/workflow.rs:1085-1093 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/keys/history.rs:637— engine/packages/gasoline/src/db/kv/keys/history.rs:637-645 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:182-190 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/history.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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) engine/packages/gasoline/src/db/kv/keys/history.rs:753— engine/packages/gasoline/src/db/kv/keys/history.rs:753-761 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:269-277 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/history.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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) engine/packages/pegboard/src/actor_kv/mod.rs:543— engine/packages/pegboard/src/actor_kv/mod.rs:543-551 | engine/packages/pegboard/src/actor_kv/preload.rs:364-372 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) engine/packages/pegboard/src/workflows/actor/metrics.rs:177— engine/packages/pegboard/src/workflows/actor/metrics.rs:177-185 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:166-174 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) engine/packages/pegboard/src/workflows/actor2/alloc_serverful/hash.rs:545— engine/packages/pegboard/src/workflows/actor2/alloc_serverful/hash.rs:545-553 | engine/packages/pegboard/src/workflows/actor2/alloc_serverful/newest_ping_timestamp.rs:27-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) engine/packages/pegboard/src/workflows/actor2/mod.rs:984— engine/packages/pegboard/src/workflows/actor2/mod.rs:984-992 | engine/packages/pegboard/src/workflows/actor2/mod.rs:1107-1115 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard-envoy/src/lib.rs:309— engine/packages/pegboard-envoy/src/lib.rs:309-317 | engine/packages/pegboard-runner/src/lib.rs:211-219 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-runner/src/lib.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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 (9 lines × 2) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:694— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:694-702 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:161-169 — before extracting anything, compare `engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs` and `engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) engine/packages/pegboard-envoy/src/ping_task.rs:26— engine/packages/pegboard-envoy/src/ping_task.rs:26-34 | engine/packages/pegboard-runner/src/ping_task.rs:25-33 — 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) engine/packages/pegboard-gateway/src/lib.rs:104— engine/packages/pegboard-gateway/src/lib.rs:104-112 | engine/packages/pegboard-gateway2/src/lib.rs:131-139 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (9 lines × 2) engine/packages/runner-protocol/src/versioned.rs:1459— engine/packages/runner-protocol/src/versioned.rs:1459-1467 | engine/packages/runner-protocol/src/versioned.rs:1798-1806 — both copies are in the same file, so extract the block into 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) engine/packages/universaldb/src/driver/postgres/database.rs:334— engine/packages/universaldb/src/driver/postgres/database.rs:334-342 | engine/packages/universaldb/src/driver/rocksdb/database.rs:73-81 — 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) engine/packages/universaldb/src/driver/postgres/transaction.rs:118— engine/packages/universaldb/src/driver/postgres/transaction.rs:118-126 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:142-150 — `engine/packages/universaldb/src/driver/postgres/transaction.rs` and `engine/packages/universaldb/src/driver/rocksdb/transaction.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) engine/sdks/rust/data/src/versioned/namespace_runner_config.rs:228— engine/sdks/rust/data/src/versioned/namespace_runner_config.rs:228-236 | engine/sdks/rust/data/src/versioned/namespace_runner_config.rs:448-457 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/client/src/remote_manager.rs:756— rivetkit-rust/packages/client/src/remote_manager.rs:756-764 | rivetkit-rust/packages/client/src/remote_manager.rs:800-808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:428— rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:428-436 | rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:481-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:677— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:677-685 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:708-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:815— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:815-823 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:839-847 — both copies are in the same file, so extract the block into 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) engine/packages/depot-client/src/vfs.rs:88— engine/packages/depot-client/src/vfs.rs:88-96 | engine/packages/depot-client/src/worker.rs:947-955 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) engine/packages/gasoline/src/ctx/operation.rs:76— engine/packages/gasoline/src/ctx/operation.rs:76-84 | engine/packages/gasoline/src/ctx/standalone.rs:131-139 — before extracting anything, compare `engine/packages/gasoline/src/ctx/operation.rs` and `engine/packages/gasoline/src/ctx/standalone.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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) engine/packages/gasoline/src/ctx/operation.rs:114— engine/packages/gasoline/src/ctx/operation.rs:114-122 | engine/packages/gasoline/src/ctx/standalone.rs:169-177 — before extracting anything, compare `engine/packages/gasoline/src/ctx/operation.rs` and `engine/packages/gasoline/src/ctx/standalone.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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) engine/packages/api-util/src/lib.rs:37— engine/packages/api-util/src/lib.rs:37-46 | engine/packages/api-util/src/lib.rs:75-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) engine/packages/depot-client/src/vfs.rs:2225— engine/packages/depot-client/src/vfs.rs:2225-2234 | engine/packages/depot-client/src/vfs.rs:2351-2360 — both copies are in the same file, so extract the block into 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) engine/packages/depot-client/src/vfs.rs:2239— engine/packages/depot-client/src/vfs.rs:2239-2248 | engine/packages/depot-client/src/vfs.rs:2366-2375 — both copies are in the same file, so extract the block into 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) engine/packages/engine/src/commands/udb/cli.rs:524— engine/packages/engine/src/commands/udb/cli.rs:524-533 | engine/packages/engine/src/commands/udb/cli.rs:570-579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) engine/packages/gasoline/src/db/debug.rs:457— engine/packages/gasoline/src/db/debug.rs:457-466 | engine/packages/gasoline/src/history/event.rs:71-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) engine/packages/gasoline/src/db/kv/keys/history.rs:1859— engine/packages/gasoline/src/db/kv/keys/history.rs:1859-1868 | engine/packages/gasoline/src/db/kv/keys/history.rs:1913-1922 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/keys/history.rs:1925— engine/packages/gasoline/src/db/kv/keys/history.rs:1925-1934 | engine/packages/gasoline/src/db/kv/mod.rs:319-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) engine/packages/gasoline/src/db/kv/keys/signal.rs:179— engine/packages/gasoline/src/db/kv/keys/signal.rs:179-188 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:629-638 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/signal.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) engine/packages/gasoline/src/db/kv/keys/signal.rs:227— engine/packages/gasoline/src/db/kv/keys/signal.rs:227-236 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:677-686 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/signal.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) engine/packages/gasoline/src/db/kv/keys/signal.rs:275— engine/packages/gasoline/src/db/kv/keys/signal.rs:275-284 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:580-589 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/signal.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) engine/packages/gasoline/src/db/kv/keys/signal.rs:407— engine/packages/gasoline/src/db/kv/keys/signal.rs:407-416 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:1196-1205 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/signal.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:631— engine/packages/guard/src/routing/pegboard_gateway/mod.rs:631-643 | engine/packages/guard/src/routing/pegboard_gateway/mod.rs:882-891 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/keys/envoy.rs:749— engine/packages/pegboard/src/keys/envoy.rs:749-758 | engine/packages/pegboard/src/keys/runner.rs:801-810 — before extracting anything, compare `engine/packages/pegboard/src/keys/envoy.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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) engine/packages/pegboard/src/keys/ns.rs:147— engine/packages/pegboard/src/keys/ns.rs:147-156 | engine/packages/pegboard/src/keys/ns.rs:268-277 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/ops/runner_config/delete.rs:46— engine/packages/pegboard/src/ops/runner_config/delete.rs:46-55 | engine/packages/pegboard/src/ops/runner_config/upsert.rs:163-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) engine/packages/pegboard/src/workflows/actor/runtime.rs:1211— engine/packages/pegboard/src/workflows/actor/runtime.rs:1211-1220 | engine/packages/pegboard/src/workflows/actor2/runtime.rs:826-835 — `engine/packages/pegboard/src/workflows/actor/runtime.rs` and `engine/packages/pegboard/src/workflows/actor2/runtime.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) engine/packages/pegboard/src/workflows/actor2/mod.rs:977— engine/packages/pegboard/src/workflows/actor2/mod.rs:977-986 | engine/packages/pegboard/src/workflows/actor2/mod.rs:1044-1053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) engine/packages/pegboard/src/workflows/runner.rs:913— engine/packages/pegboard/src/workflows/runner.rs:913-922 | engine/packages/pegboard/src/workflows/runner2.rs:621-630 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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) engine/packages/pegboard/src/workflows/runner.rs:947— engine/packages/pegboard/src/workflows/runner.rs:947-956 | engine/packages/pegboard/src/workflows/runner2.rs:655-664 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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) engine/packages/pools/src/pools.rs:26— engine/packages/pools/src/pools.rs:26-35 | engine/packages/pools/src/pools.rs:59-68 — both copies are in the same file, so extract the block into 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) engine/sdks/rust/envoy-client/src/actor/http.rs:591— engine/sdks/rust/envoy-client/src/actor/http.rs:591-600 | engine/sdks/rust/envoy-client/src/actor/http.rs:698-707 — both copies are in the same file, so extract the block into 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) engine/sdks/rust/envoy-client/src/connection/native.rs:81— engine/sdks/rust/envoy-client/src/connection/native.rs:81-90 | engine/sdks/rust/envoy-client/src/connection/wasm.rs:87-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:723— rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:723-732 | rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:743-752 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:109— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:109-118 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:133-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1015— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1015-1024 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1059-1068 — both copies are in the same file, so extract the block into 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) engine/packages/api-peer/src/actors/list.rs:22— engine/packages/api-peer/src/actors/list.rs:22-29 | engine/packages/api-public/src/actors/list.rs:72-79 — 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) engine/packages/api-util/src/lib.rs:50— engine/packages/api-util/src/lib.rs:50-57 | engine/packages/api-util/src/lib.rs:88-95 — both copies are in the same file, so extract the block into 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) engine/packages/depot/src/conveyer/quota.rs:57— engine/packages/depot/src/conveyer/quota.rs:57-64 | engine/packages/depot/src/conveyer/quota.rs:81-88 — both copies are in the same file, so extract the block into 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) engine/packages/epoxy/src/ops/propose.rs:791— engine/packages/epoxy/src/ops/propose.rs:791-798 | engine/packages/epoxy/src/ops/propose.rs:922-929 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/debug.rs:1707— engine/packages/gasoline/src/db/kv/debug.rs:1707-1714 | engine/packages/gasoline/src/db/kv/debug.rs:1743-1750 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/repair.rs:526— engine/packages/gasoline/src/db/kv/repair.rs:526-533 | engine/packages/gasoline/src/db/kv/repair.rs:604-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) engine/packages/guard-core/src/response_body.rs:170— engine/packages/guard-core/src/response_body.rs:170-177 | engine/packages/guard-core/src/response_body.rs:183-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) engine/packages/pegboard-gateway/src/lib.rs:207— engine/packages/pegboard-gateway/src/lib.rs:207-214 | engine/packages/pegboard-gateway3/src/http_stream/request.rs:300-307 — 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) engine/packages/util/src/async_counter.rs:17— engine/packages/util/src/async_counter.rs:17-24 | engine/sdks/rust/envoy-client/src/async_counter.rs:22-29 — 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) engine/sdks/rust/envoy-client/src/actor/http.rs:574— engine/sdks/rust/envoy-client/src/actor/http.rs:574-581 | engine/sdks/rust/envoy-client/src/actor/http.rs:650-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) rivetkit-python/client/src/events/async/client.rs:43— rivetkit-python/client/src/events/async/client.rs:43-50 | rivetkit-python/client/src/simple/async/client.rs:43-50 — before extracting anything, compare `rivetkit-python/client/src/events/async/client.rs` and `rivetkit-python/client/src/simple/async/client.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) rivetkit-python/client/src/events/async/client.rs:64— rivetkit-python/client/src/events/async/client.rs:64-71 | rivetkit-python/client/src/simple/async/client.rs:62-69 — before extracting anything, compare `rivetkit-python/client/src/events/async/client.rs` and `rivetkit-python/client/src/simple/async/client.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) rivetkit-python/client/src/events/async/client.rs:85— rivetkit-python/client/src/events/async/client.rs:85-92 | rivetkit-python/client/src/simple/async/client.rs:81-88 — before extracting anything, compare `rivetkit-python/client/src/events/async/client.rs` and `rivetkit-python/client/src/simple/async/client.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) rivetkit-rust/packages/client/src/protocol/codec.rs:133— rivetkit-rust/packages/client/src/protocol/codec.rs:133-140 | rivetkit-rust/packages/client/src/protocol/codec.rs:143-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:329— rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:329-336 | rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:557-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:346— rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:346-353 | rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:405-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:443— rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:443-450 | rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:488-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) engine/packages/gasoline/src/db/kv/debug.rs:2603— engine/packages/gasoline/src/db/kv/debug.rs:2603-2610 | engine/packages/gasoline/src/db/kv/mod.rs:3818-3825 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/debug.rs` and `engine/packages/gasoline/src/db/kv/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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) engine/packages/logs/src/unix.rs:28— engine/packages/logs/src/unix.rs:28-35 | engine/packages/logs/src/windows.rs:38-45 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 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) engine/packages/logs/src/unix.rs:117— engine/packages/logs/src/unix.rs:117-124 | engine/packages/logs/src/windows.rs:141-148 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 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) engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:160— engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:160-167 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:160-167 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 127 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) engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:341— engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:341-348 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:453-460 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 127 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) engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:482— engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:482-489 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:594-601 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 127 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) engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:698— engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:698-705 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:810-817 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 127 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) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:160— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:160-167 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:168-175 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 164 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.
pegboard::workflows::actor::pegboard_actor (cognitive 175) engine/packages/pegboard/src/workflows/actor/mod.rs:37— pegboard::workflows::actor::pegboard_actor has cognitive complexity 175 (threshold 15). Drivers by points: if/else 43 (111 pts), match/switch 16 (59 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::workflows::actor2::process_signal (cognitive 88) engine/packages/pegboard/src/workflows/actor2/mod.rs:635— pegboard::workflows::actor2::process_signal has cognitive complexity 88 (threshold 15). Drivers by points: if/else 20 (58 pts), match/switch 11 (27 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 55). 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.
pegboard::actor_kv::preload::batch_preload (cognitive 58) engine/packages/pegboard/src/actor_kv/preload.rs:53— pegboard::actor_kv::preload::batch_preload has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (51 pts), loops 4 (6 pts), boolean chains 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.
pegboard::workflows::actor::runtime::spawn_actor (cognitive 53) engine/packages/pegboard/src/workflows/actor/runtime.rs:644— pegboard::workflows::actor::runtime::spawn_actor has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (47 pts), match/switch 4 (6 pts) (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pegboard::ops::runner::list_for_ns::pegboard_runner_list_for_ns (cognitive 52) engine/packages/pegboard/src/ops/runner/list_for_ns.rs:25— pegboard::ops::runner::list_for_ns::pegboard_runner_list_for_ns has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 4 (12 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::ops::actor::create::pegboard_actor_create (cognitive 42) engine/packages/pegboard/src/ops/actor/create.rs:44— pegboard::ops::actor::create::pegboard_actor_create has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (30 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 2 (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.
pegboard::workflows::actor_migration_fix_backfill::backfill_chunk (cognitive 42) engine/packages/pegboard/src/workflows/actor_migration_fix_backfill.rs:67— pegboard::workflows::actor_migration_fix_backfill::backfill_chunk has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pegboard::workflows::runner::pegboard_runner (cognitive 40) engine/packages/pegboard/src/workflows/runner.rs:62— pegboard::workflows::runner::pegboard_runner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 4 (9 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::workflows::actor2::listen_for_signals (cognitive 40) engine/packages/pegboard/src/workflows/actor2/mod.rs:469— pegboard::workflows::actor2::listen_for_signals has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (39 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pegboard::ops::runner_config::upsert::pegboard_runner_config_upsert (cognitive 39) engine/packages/pegboard/src/ops/runner_config/upsert.rs:16— pegboard::ops::runner_config::upsert::pegboard_runner_config_upsert has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (31 pts), match/switch 3 (5 pts), loops 1 (2 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.
pegboard::ops::actor::list_for_ns::pegboard_actor_list_for_ns (cognitive 36) engine/packages/pegboard/src/ops/actor/list_for_ns.rs:40— pegboard::ops::actor::list_for_ns::pegboard_actor_list_for_ns has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 3 (6 pts), 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.
pegboard::workflows::actor::runtime::allocate_actor_v2 (cognitive 36) engine/packages/pegboard/src/workflows/actor/runtime.rs:238— pegboard::workflows::actor::runtime::allocate_actor_v2 has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 3, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::ops::envoy::evict_actors::pegboard_envoy_evict_actors (cognitive 33) engine/packages/pegboard/src/ops/envoy/evict_actors.rs:29— pegboard::ops::envoy::evict_actors::pegboard_envoy_evict_actors has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::workflows::serverless::conn::outbound_req_inner (cognitive 33) engine/packages/pegboard/src/workflows/serverless/conn.rs:198— pegboard::workflows::serverless::conn::outbound_req_inner has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 8 (19 pts), if/else 10 (13 pts), loops 1 (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.
pegboard::workflows::actor::handle_stopped (cognitive 30) engine/packages/pegboard/src/workflows/actor/mod.rs:1047— pegboard::workflows::actor::handle_stopped has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 5 (10 pts), loops 1 (2 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.
pegboard::workflows::runner::allocate_pending_actors (cognitive 27) engine/packages/pegboard/src/workflows/runner.rs:976— pegboard::workflows::runner::allocate_pending_actors has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (24 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.
pegboard::workflows::actor2::alloc_serverful::hash::allocate_with_rng (cognitive 26) engine/packages/pegboard/src/workflows/actor2/alloc_serverful/hash.rs:112— pegboard::workflows::actor2::alloc_serverful::hash::allocate_with_rng has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (24 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.
pegboard::workflows::runner2::allocate_pending_actors (cognitive 25) engine/packages/pegboard/src/workflows/runner2.rs:686— pegboard::workflows::runner2::allocate_pending_actors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::workflows::actor_runner_name_selector_backfill::backfill_batch (cognitive 23) engine/packages/pegboard/src/workflows/actor_runner_name_selector_backfill.rs:126— pegboard::workflows::actor_runner_name_selector_backfill::backfill_batch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::ops::serverless_metadata::fetch::pegboard_serverless_metadata_fetch (cognitive 23) engine/packages/pegboard/src/ops/serverless_metadata/fetch.rs:156— pegboard::ops::serverless_metadata::fetch::pegboard_serverless_metadata_fetch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 5 (7 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pegboard::workflows::actor::metrics::record_kv_metrics (cognitive 22) engine/packages/pegboard/src/workflows/actor/metrics.rs:211— pegboard::workflows::actor::metrics::record_kv_metrics has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::workflows::actor2::metrics::record_kv_metrics (cognitive 22) engine/packages/pegboard/src/workflows/actor2/metrics.rs:202— pegboard::workflows::actor2::metrics::record_kv_metrics has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::workflows::actor2::runtime::handle_stopped (cognitive 21) engine/packages/pegboard/src/workflows/actor2/runtime.rs:558— pegboard::workflows::actor2::runtime::handle_stopped has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 6 (10 pts) (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.
pegboard::workflows::actor2::runtime::allocate (cognitive 20) engine/packages/pegboard/src/workflows/actor2/runtime.rs:185— pegboard::workflows::actor2::runtime::allocate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (19 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pegboard::workflows::actor::metrics::pegboard_actor_metrics (cognitive 20) engine/packages/pegboard/src/workflows/actor/metrics.rs:45— pegboard::workflows::actor::metrics::pegboard_actor_metrics has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (7 lines × 2) engine/packages/cli/src/commands/deploy.rs:123— engine/packages/cli/src/commands/deploy.rs:123-129 | engine/packages/cli/src/commands/token.rs:84-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) engine/packages/depot/src/conveyer/commit/test_hooks.rs:43— engine/packages/depot/src/conveyer/commit/test_hooks.rs:43-49 | engine/packages/depot/src/takeover.rs:91-97 — 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) engine/packages/depot/src/workflows/db_reclaimer.rs:283— engine/packages/depot/src/workflows/db_reclaimer.rs:283-289 | engine/packages/depot/src/workflows/db_reclaimer.rs:845-851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) engine/packages/depot-client/src/query.rs:309— engine/packages/depot-client/src/query.rs:309-315 | engine/packages/depot-client/src/query.rs:386-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) engine/packages/engine/src/util/wf/mod.rs:57— engine/packages/engine/src/util/wf/mod.rs:57-63 | engine/packages/engine/src/util/wf/signal.rs:25-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) engine/packages/gasoline/src/db/kv/debug.rs:1918— engine/packages/gasoline/src/db/kv/debug.rs:1918-1924 | engine/packages/gasoline/src/db/kv/debug.rs:2103-2109 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard-envoy/src/conn.rs:101— engine/packages/pegboard-envoy/src/conn.rs:101-107 | engine/packages/pegboard-runner/src/conn.rs:49-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) engine/packages/pegboard-gateway3/src/http_stream/handler.rs:163— engine/packages/pegboard-gateway3/src/http_stream/handler.rs:163-169 | engine/packages/pegboard-gateway3/src/lib.rs:783-789 — 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) engine/packages/universaldb/src/driver/postgres/transaction.rs:158— engine/packages/universaldb/src/driver/postgres/transaction.rs:158-164 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:182-188 — `engine/packages/universaldb/src/driver/postgres/transaction.rs` and `engine/packages/universaldb/src/driver/rocksdb/transaction.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) engine/sdks/rust/envoy-client/src/actor.rs:768— engine/sdks/rust/envoy-client/src/actor.rs:768-774 | engine/sdks/rust/envoy-client/src/actor.rs:1016-1022 — both copies are in the same file, so extract the block into 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) engine/sdks/rust/envoy-client/src/tunnel.rs:387— engine/sdks/rust/envoy-client/src/tunnel.rs:387-393 | engine/sdks/rust/envoy-client/src/tunnel.rs:579-585 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:492— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:492-498 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:603-609 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:951— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:951-957 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1413-1419 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:512— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:512-518 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:569-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:777— rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:777-783 | rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:805-811 — both copies are in the same file, so extract the block into 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) engine/packages/depot/src/compaction/shared.rs:3529— engine/packages/depot/src/compaction/shared.rs:3529-3535 | engine/packages/depot/src/conveyer/commit/helpers.rs:15-21 — 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) engine/packages/depot/src/conveyer/branch/shared.rs:159— engine/packages/depot/src/conveyer/branch/shared.rs:159-165 | engine/packages/depot/src/conveyer/restore_point/resolve.rs:434-440 — 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) engine/packages/gasoline/src/db/kv/keys/worker.rs:41— engine/packages/gasoline/src/db/kv/keys/worker.rs:41-47 | engine/packages/pegboard/src/keys/runner.rs:133-139 — 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) engine/packages/pegboard/src/keys/actor.rs:326— engine/packages/pegboard/src/keys/actor.rs:326-332 | engine/packages/pegboard/src/keys/runner.rs:409-416 — before extracting anything, compare `engine/packages/pegboard/src/keys/actor.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 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) engine/packages/pegboard/src/keys/actor.rs:414— engine/packages/pegboard/src/keys/actor.rs:414-420 | engine/packages/pegboard/src/keys/runner.rs:454-461 — before extracting anything, compare `engine/packages/pegboard/src/keys/actor.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 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) engine/packages/pegboard/src/keys/actor.rs:458— engine/packages/pegboard/src/keys/actor.rs:458-464 | engine/packages/pegboard/src/keys/runner.rs:499-506 — before extracting anything, compare `engine/packages/pegboard/src/keys/actor.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 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) engine/packages/pegboard/src/keys/envoy.rs:1365— engine/packages/pegboard/src/keys/envoy.rs:1365-1371 | engine/packages/pegboard/src/keys/runner.rs:257-263 — before extracting anything, compare `engine/packages/pegboard/src/keys/envoy.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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) engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:1112— engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:1112-1118 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:1183-1189 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 151 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) engine/packages/pegboard/src/workflows/actor/runtime.rs:1473— engine/packages/pegboard/src/workflows/actor/runtime.rs:1473-1481 | engine/packages/pegboard/src/workflows/actor2/runtime.rs:797-803 — `engine/packages/pegboard/src/workflows/actor/runtime.rs` and `engine/packages/pegboard/src/workflows/actor2/runtime.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/runner_config.rs:118— rivetkit-rust/packages/rivetkit-core/src/registry/runner_config.rs:118-124 | rivetkit-rust/packages/rivetkit-core/src/registry/runner_config.rs:155-161 — both copies are in the same file, so extract the block into 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) engine/packages/cli/src/commands/logs.rs:95— engine/packages/cli/src/commands/logs.rs:95-100 | engine/packages/cli/src/commands/logs.rs:129-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) engine/packages/engine/src/commands/depot_transfer.rs:303— engine/packages/engine/src/commands/depot_transfer.rs:303-308 | engine/packages/engine/src/commands/depot_transfer.rs:413-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) engine/packages/gasoline/src/db/kv/debug.rs:2361— engine/packages/gasoline/src/db/kv/debug.rs:2361-2366 | engine/packages/gasoline/src/db/kv/mod.rs:3691-3696 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/debug.rs` and `engine/packages/gasoline/src/db/kv/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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) engine/packages/pegboard/src/workflows/actor2/alloc_serverful/random_full_range.rs:37— engine/packages/pegboard/src/workflows/actor2/alloc_serverful/random_full_range.rs:37-42 | engine/packages/pegboard/src/workflows/actor2/alloc_serverful/random_ping_timestamp.rs:129-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/packages/runner-protocol/src/versioned.rs:1377— engine/packages/runner-protocol/src/versioned.rs:1377-1382 | engine/packages/runner-protocol/src/versioned.rs:1719-1724 — both copies are in the same file, so extract the block into 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) engine/packages/term/src/format.rs:8— engine/packages/term/src/format.rs:8-13 | engine/packages/term/src/format.rs:22-27 — both copies are in the same file, so extract the block into 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) engine/sdks/rust/envoy-client/src/handle.rs:832— engine/sdks/rust/envoy-client/src/handle.rs:832-837 | engine/sdks/rust/envoy-client/src/handle.rs:871-876 — both copies are in the same file, so extract the block into 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) rivetkit-python/client/src/events/async/handle.rs:27— rivetkit-python/client/src/events/async/handle.rs:27-32 | rivetkit-python/client/src/simple/async/handle.rs:47-52 — 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) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1134— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1134-1139 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1236-1241 — both copies are in the same file, so extract the block into 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) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:800— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:800-805 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:867-872 — both copies are in the same file, so extract the block into 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) engine/packages/api-public/src/actors/list_names.rs:34— engine/packages/api-public/src/actors/list_names.rs:34-39 | engine/packages/api-public/src/runners.rs:90-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 (6 lines × 2) engine/packages/depot/src/doctor.rs:3401— engine/packages/depot/src/doctor.rs:3401-3406 | engine/packages/depot/src/inspect.rs:739-744 — 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) engine/packages/depot-client-embedded/src/lib.rs:206— engine/packages/depot-client-embedded/src/lib.rs:206-211 | engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:2454-2459 — 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) engine/packages/namespace/src/utils.rs:6— engine/packages/namespace/src/utils.rs:6-11 | engine/packages/pegboard/src/utils.rs:37-42 — 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) engine/packages/pegboard/src/keys/actor.rs:56— engine/packages/pegboard/src/keys/actor.rs:56-61 | engine/packages/pegboard/src/keys/runner.rs:44-50 — before extracting anything, compare `engine/packages/pegboard/src/keys/actor.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 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) engine/packages/pegboard-gateway2/src/shared_state.rs:29— engine/packages/pegboard-gateway2/src/shared_state.rs:29-34 | engine/packages/pegboard-gateway3/src/shared_state.rs:35-40 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/shared_state.rs:60— engine/packages/pegboard-gateway2/src/shared_state.rs:60-65 | engine/packages/pegboard-gateway3/src/shared_state.rs:66-71 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/sdks/rust/envoy-client/src/handle.rs:907— engine/sdks/rust/envoy-client/src/handle.rs:907-912 | engine/sdks/rust/envoy-client/src/tunnel.rs:56-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:308— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:308-313 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:80-85 — before extracting anything, compare `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs` and `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 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) engine/packages/api-public/src/runner_configs/delete.rs:32— engine/packages/api-public/src/runner_configs/delete.rs:32-37 | engine/packages/api-public/src/runner_configs/list.rs:51-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 both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/packages/api-public/src/runner_configs/refresh_metadata.rs:58— engine/packages/api-public/src/runner_configs/refresh_metadata.rs:58-63 | engine/packages/api-public/src/runner_configs/upsert.rs:45-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/packages/api-public/src/actors/reschedule.rs:34— engine/packages/api-public/src/actors/reschedule.rs:34-39 | engine/packages/api-public/src/actors/sleep.rs:34-39 — 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) engine/packages/api-public/src/actors/delete.rs:37— engine/packages/api-public/src/actors/delete.rs:37-42 | engine/packages/api-public/src/actors/kv_get.rs:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/packages/gasoline/src/db/kv/keys/workflow.rs:49— engine/packages/gasoline/src/db/kv/keys/workflow.rs:49-54 | engine/packages/types/src/keys/backfill.rs:45-50 — 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) rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:32— rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:32-37 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1927-1932 — 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) engine/packages/depot/src/compaction/companion.rs:396— engine/packages/depot/src/compaction/companion.rs:396-408 | engine/packages/depot/src/compaction/companion.rs:471-483 — both copies are in the same file, so extract the block into 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) engine/packages/depot/src/doctor.rs:2868— engine/packages/depot/src/doctor.rs:2868-2880 | engine/packages/depot/src/doctor.rs:2907-2919 — both copies are in the same file, so extract the block into 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) engine/packages/error-macros/src/lib.rs:346— engine/packages/error-macros/src/lib.rs:346-358 | engine/packages/error-macros/src/lib.rs:436-448 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/ctx/workflow.rs:768— engine/packages/gasoline/src/ctx/workflow.rs:768-780 | engine/packages/gasoline/src/ctx/workflow.rs:1104-1116 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/ops/envoy/drain.rs:63— engine/packages/pegboard/src/ops/envoy/drain.rs:63-75 | engine/packages/pegboard/src/ops/runner/drain.rs:72-84 — 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) engine/packages/pegboard/src/workflows/actor/metrics.rs:188— engine/packages/pegboard/src/workflows/actor/metrics.rs:188-200 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:179-191 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) engine/packages/pegboard/src/workflows/actor/runtime.rs:891— engine/packages/pegboard/src/workflows/actor/runtime.rs:891-903 | engine/packages/pegboard/src/workflows/actor/runtime.rs:943-955 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/actor/runtime.rs:1412— engine/packages/pegboard/src/workflows/actor/runtime.rs:1412-1424 | engine/packages/pegboard/src/workflows/runner2.rs:934-946 — 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) engine/packages/pegboard/src/workflows/actor/setup.rs:117— engine/packages/pegboard/src/workflows/actor/setup.rs:117-129 | engine/packages/pegboard/src/workflows/actor/setup.rs:224-236 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/actor2/mod.rs:723— engine/packages/pegboard/src/workflows/actor2/mod.rs:723-735 | engine/packages/pegboard/src/workflows/actor2/mod.rs:943-955 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/runner.rs:356— engine/packages/pegboard/src/workflows/runner.rs:356-368 | engine/packages/pegboard/src/workflows/runner2.rs:174-186 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:638— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:638-650 | engine/sdks/rust/envoy-client/src/connection/mod.rs:332-344 — 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) engine/packages/pegboard-gateway2/src/shared_state.rs:199— engine/packages/pegboard-gateway2/src/shared_state.rs:199-211 | engine/packages/pegboard-gateway3/src/shared_state.rs:206-218 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/shared_state.rs:417— engine/packages/pegboard-gateway2/src/shared_state.rs:417-429 | engine/packages/pegboard-gateway3/src/shared_state.rs:452-464 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/universaldb/src/driver/postgres/database.rs:386— engine/packages/universaldb/src/driver/postgres/database.rs:386-398 | engine/packages/universaldb/src/driver/rocksdb/database.rs:126-138 — 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) engine/packages/universalpubsub/src/driver/nats/mod.rs:155— engine/packages/universalpubsub/src/driver/nats/mod.rs:155-167 | engine/packages/universalpubsub/src/driver/nats/mod.rs:195-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) rivetkit-python/client/src/events/async/handle.rs:46— rivetkit-python/client/src/events/async/handle.rs:46-58 | rivetkit-python/client/src/simple/async/handle.rs:66-78 — 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) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:976— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:976-988 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3140-3152 — before extracting anything, compare `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs` and `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 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) engine/packages/runner-protocol/src/util.rs:2— engine/packages/runner-protocol/src/util.rs:2-14 | engine/sdks/rust/envoy-protocol/src/util.rs:2-14 — 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) engine/packages/gasoline/src/ctx/operation.rs:132— engine/packages/gasoline/src/ctx/operation.rs:132-144 | engine/packages/gasoline/src/ctx/standalone.rs:187-199 — before extracting anything, compare `engine/packages/gasoline/src/ctx/operation.rs` and `engine/packages/gasoline/src/ctx/standalone.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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) engine/packages/pegboard-gateway2/src/shared_state.rs:1177— engine/packages/pegboard-gateway2/src/shared_state.rs:1177-1189 | engine/packages/pegboard-gateway3/src/shared_state.rs:2087-2099 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) rivetkit-python/client/src/events/async/client.rs:27— rivetkit-python/client/src/events/async/client.rs:27-39 | rivetkit-python/client/src/simple/async/client.rs:27-39 — before extracting anything, compare `rivetkit-python/client/src/events/async/client.rs` and `rivetkit-python/client/src/simple/async/client.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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) rivetkit-python/client/src/events/sync/client.rs:24— rivetkit-python/client/src/events/sync/client.rs:24-36 | rivetkit-python/client/src/simple/sync/client.rs:24-36 — before extracting anything, compare `rivetkit-python/client/src/events/sync/client.rs` and `rivetkit-python/client/src/simple/sync/client.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) engine/packages/depot/src/workflows/db_reclaimer.rs:171— engine/packages/depot/src/workflows/db_reclaimer.rs:171-186 | engine/packages/depot/src/workflows/db_reclaimer.rs:697-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 (13 lines × 2) engine/packages/gasoline/src/db/kv/debug.rs:2050— engine/packages/gasoline/src/db/kv/debug.rs:2050-2062 | engine/packages/gasoline/src/db/kv/debug.rs:2223-2235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 3 more in this group — see findings.md.
R4 · Test Coverage· This test file cannot be loaded · ×28
This test file cannot be loaded engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts— engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts:2 imports '../src/index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/billing/plan-badge.stories.tsx— frontend/src/app/billing/plan-badge.stories.tsx:5 imports './billing-plan-badge', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/byoc/agent-instructions.test.ts— frontend/src/app/byoc/agent-instructions.test.ts:2 imports './agent-instructions', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/byoc/cluster-config.test.ts— frontend/src/app/byoc/cluster-config.test.ts:2 imports './cluster-config', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/byoc/setup-links.test.ts— frontend/src/app/byoc/setup-links.test.ts:2 imports '../../content/byoc', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/env-variables.stories.tsx— frontend/src/app/env-variables.stories.tsx:5 imports './env-variables', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/onboarding-skeleton.stories.tsx— frontend/src/app/onboarding-skeleton.stories.tsx:3 imports './onboarding-skeleton', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/pool-switcher.stories.tsx— frontend/src/app/pool-switcher.stories.tsx:4 imports './pool-switcher', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/runner-config-table.stories.tsx— frontend/src/app/runner-config-table.stories.tsx:10 imports './runner-config-table', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/runner-pool-error-popover.stories.tsx— frontend/src/app/runner-pool-error-popover.stories.tsx:6 imports './runner-pool-error-popover', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/serverless-connection-check.stories.tsx— frontend/src/app/serverless-connection-check.stories.tsx:4 imports './serverless-connection-check', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/serverless-health-error.test.ts— frontend/src/app/serverless-health-error.test.ts:2 imports './serverless-health-error', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/settings-pages/settings-card.stories.tsx— frontend/src/app/settings-pages/settings-card.stories.tsx:5 imports './settings-card', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/app/settings-pages/whats-new-panel.stories.tsx— frontend/src/app/settings-pages/whats-new-panel.stories.tsx:5 imports './whats-new-panel', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/actors/actor-inspector-protocol.test.ts— frontend/src/components/actors/actor-inspector-protocol.test.ts:6 imports './actor-inspector-context', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/actors/actor-schedules-tab.test.ts— frontend/src/components/actors/actor-schedules-tab.test.ts:3 imports './actor-schedules-format', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/actors/queries/index.test.ts— frontend/src/components/actors/queries/index.test.ts:2 imports './index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/actors/workflow/workflow-to-xyflow.test.ts— frontend/src/components/actors/workflow/workflow-to-xyflow.test.ts:2 imports './workflow-example-data', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/actors/workflow/xyflow-nodes.stories.tsx— frontend/src/components/actors/workflow/xyflow-nodes.stories.tsx:14 imports './workflow-example-data', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (2 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/lazy-icon.stories.tsx— frontend/src/components/lazy-icon.stories.tsx:5 imports './lazy-icon', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/mcp/scope.test.ts— frontend/src/components/mcp/scope.test.ts:2 imports './scope', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/onboarding/agent-os/agent-os-onboarding.stories.tsx— frontend/src/components/onboarding/agent-os/agent-os-onboarding.stories.tsx:4 imports './agent-select-step', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (4 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/products/product-picker.stories.tsx— frontend/src/components/products/product-picker.stories.tsx:3 imports './product-picker', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/components/ui/icon-picker.stories.tsx— frontend/src/components/ui/icon-picker.stories.tsx:5 imports './icon-picker', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded frontend/src/content/agent-prompts.test.ts— frontend/src/content/agent-prompts.test.ts:2 imports './agent-prompts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
ClassTooLong: DatabaseKv engine/packages/gasoline/src/db/kv/mod.rs:52— ClassTooLong — 2330 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 4 blocks, lines 52-3483. The bar is 400 significant lines; this is 1930 over it, 5.83× 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: ActorTask rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:332— ClassTooLong — 1337 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 2 blocks, lines 332-2336. The bar is 400 significant lines; this is 937 over it, 3.34× 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: ProxyService engine/packages/guard-core/src/proxy_service.rs:353— ClassTooLong — 1088 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 3 blocks, lines 353-2060. The bar is 400 significant lines; this is 688 over it, 2.72× 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: Runner engine/sdks/typescript/runner/src/mod.ts:203— ClassTooLong — 1019 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 619 over it, 2.55× 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: Runner rivetkit-typescript/packages/engine-runner/src/mod.ts:203— ClassTooLong — 993 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 593 over it, 2.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: ActorMetrics rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:117— ClassTooLong — 902 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 6 blocks, lines 117-2884. The bar is 400 significant lines; this is 502 over it, 2.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SqliteDb rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:231— ClassTooLong — 885 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 85 methods, 5 blocks, lines 104-1527. The bar is 400 significant lines; this is 485 over it, 2.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ActorConnRaw rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:140— ClassTooLong — 857 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 457 over it, 2.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PegboardGateway2 engine/packages/pegboard-gateway2/src/lib.rs:73— ClassTooLong — 838 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 4 blocks, lines 73-1246. The bar is 400 significant lines; this is 438 over it, 2.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: WorkflowCtx engine/packages/gasoline/src/ctx/workflow.rs:50— ClassTooLong — 743 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 5 blocks, lines 50-1299. The bar is 400 significant lines; this is 343 over it, 1.86× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WasmCoreRuntime rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:260— ClassTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded), 118 methods. The bar is 400 significant lines; this is 326 over it, 1.82× 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: NapiCoreRuntime rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:266— ClassTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded), 126 methods. The bar is 400 significant lines; this is 307 over it, 1.77× 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: SubCommand engine/packages/engine/src/commands/udb/cli.rs:22— ClassTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 2 blocks, lines 22-1085. The bar is 400 significant lines; this is 285 over it, 1.71× 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: Tunnel engine/sdks/typescript/runner/src/tunnel.ts:41— ClassTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 282 over it, 1.71× 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: Tunnel rivetkit-typescript/packages/engine-runner/src/tunnel.ts:41— ClassTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 277 over it, 1.69× 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: ActorHandleRaw rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:83— ClassTooLong — 674 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 274 over it, 1.69× 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: PegboardGateway3 engine/packages/pegboard-gateway3/src/lib.rs:71— ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 4 blocks, lines 71-927. The bar is 400 significant lines; this is 222 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: InFlightRequestHandle engine/packages/pegboard-gateway3/src/shared_state.rs:773— ClassTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 2 blocks, lines 773-1581. The bar is 400 significant lines; this is 201 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.
ClassTooLong: ActorContextHandleAdapter rivetkit-typescript/packages/rivetkit/src/registry/native.ts:2718— ClassTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 185 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: EnvoyHandle engine/sdks/rust/envoy-client/src/handle.rs:16— ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 53 methods, 3 blocks, lines 16-905. The bar is 400 significant lines; this is 179 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PegboardGateway engine/packages/pegboard-gateway/src/lib.rs:64— ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 5 blocks, lines 64-869. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ActorMetricCollectors rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:170— ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 2 blocks, lines 170-1583. The bar is 400 significant lines; this is 147 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WorkflowContext rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:451— ClassTooLong — 545 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 145 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Registry rivetkit-typescript/packages/rivetkit/src/registry/index.ts:143— ClassTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 119 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RemoteManager rivetkit-rust/packages/client/src/remote_manager.rs:34— ClassTooLong — 508 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, 2 blocks, lines 34-837. The bar is 400 significant lines; this is 108 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.
depot::compaction::shared::read_commit_delta_reclaim_window (cognitive 62) engine/packages/depot/src/compaction/shared.rs:972— depot::compaction::shared::read_commit_delta_reclaim_window has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 7 (14 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::workflows::db_hot_compactor::install_hot_chunk_tx (cognitive 44) engine/packages/depot/src/workflows/db_hot_compactor.rs:912— depot::workflows::db_hot_compactor::install_hot_chunk_tx has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (33 pts), loops 6, boolean chains 4, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::doctor::detect_unsupported (cognitive 44) engine/packages/depot/src/doctor.rs:1007— depot::doctor::detect_unsupported has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::compaction::shared::read_hot_input_snapshot (cognitive 43) engine/packages/depot/src/compaction/shared.rs:573— depot::compaction::shared::read_hot_input_snapshot has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::workflows::db_reclaimer::reclaim_fdb_job_tx (cognitive 40) engine/packages/depot/src/workflows/db_reclaimer.rs:641— depot::workflows::db_reclaimer::reclaim_fdb_job_tx has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (29 pts), loops 6 (7 pts), boolean chains 2, match/switch 1 (2 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, 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.
depot::workflows::db_reclaimer::cleanup_repair_fdb_outputs_tx (cognitive 37) engine/packages/depot/src/workflows/db_reclaimer.rs:1328— depot::workflows::db_reclaimer::cleanup_repair_fdb_outputs_tx has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::doctor::build_mirrored_resolver_image (cognitive 36) engine/packages/depot/src/doctor.rs:1929— depot::doctor::build_mirrored_resolver_image has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (30 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::conveyer::read::scan_source_delta_history (cognitive 34) engine/packages/depot/src/conveyer/read.rs:1575— depot::conveyer::read::scan_source_delta_history has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (3 pts), match/switch 1 (2 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.
depot::doctor::build_sequential_replay (cognitive 32) engine/packages/depot/src/doctor.rs:1662— depot::doctor::build_sequential_replay has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (9 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.
depot::doctor::load_storage_facts (cognitive 29) engine/packages/depot/src/doctor.rs:1252— depot::doctor::load_storage_facts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 7, match/switch 2 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::recovery::scan_hot_shard_history_branch (cognitive 28) engine/packages/depot/src/recovery.rs:376— depot::recovery::scan_hot_shard_history_branch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (27 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.
depot::conveyer::commit::truncate::collect_truncate_cleanup (cognitive 25) engine/packages/depot/src/conveyer/commit/truncate.rs:38— depot::conveyer::commit::truncate::collect_truncate_cleanup has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 7 (12 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.
depot::conveyer::debug::load_pages_from_hot_tier (cognitive 25) engine/packages/depot/src/conveyer/debug.rs:225— depot::conveyer::debug::load_pages_from_hot_tier has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (7 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.
depot::doctor::doctor (cognitive 25) engine/packages/depot/src/doctor.rs:432— depot::doctor::doctor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 3, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
depot::compaction::shared::resolve_bucket_catalog_forks (cognitive 24) engine/packages/depot/src/compaction/shared.rs:177— depot::compaction::shared::resolve_bucket_catalog_forks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 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.
depot::conveyer::read::point_read_pidx_owners (cognitive 24) engine/packages/depot/src/conveyer/read.rs:1411— depot::conveyer::read::point_read_pidx_owners has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::compaction::shared::read_stale_pidx_chunk (cognitive 23) engine/packages/depot/src/compaction/shared.rs:1766— depot::compaction::shared::read_stale_pidx_chunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::compaction::shared::write_staged_hot_shards (cognitive 23) engine/packages/depot/src/compaction/shared.rs:2775— depot::compaction::shared::write_staged_hot_shards has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), match/switch 1 (3 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.
depot::conveyer::read::sqlite_page::overflow_head_pages (cognitive 23) engine/packages/depot/src/conveyer/read/sqlite_page.rs:110— depot::conveyer::read::sqlite_page::overflow_head_pages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::compaction::shared::read_dead_shard_versions_chunk (cognitive 20) engine/packages/depot/src/compaction/shared.rs:1984— depot::compaction::shared::read_dead_shard_versions_chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (5 pts), match/switch 2, 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.
depot::workflows::db_reclaimer::sweep_commit_delta_chunk_tx (cognitive 20) engine/packages/depot/src/workflows/db_reclaimer.rs:150— depot::workflows::db_reclaimer::sweep_commit_delta_chunk_tx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3, 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.
depot::metrics::record_hot_stage (cognitive 19) engine/packages/depot/src/metrics.rs:783— depot::metrics::record_hot_stage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
depot::workflows::db_manager::manager_effects_after_refresh (cognitive 17) engine/packages/depot/src/workflows/db_manager.rs:748— depot::workflows::db_manager::manager_effects_after_refresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7 (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.
depot::recovery::scan_range_bounded (cognitive 17) engine/packages/depot/src/recovery.rs:707— depot::recovery::scan_range_bounded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot::conveyer::branch::catalog::list_databases_in_bucket_branch (cognitive 16) engine/packages/depot/src/conveyer/branch/catalog.rs:35— depot::conveyer::branch::catalog::list_databases_in_bucket_branch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sync-over-async blocking examples/kitchen-sink/scripts/mock-agentic-loop.ts:512— `startLocalKitchenSinkServer` is async and calls mkdtempSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/mock-agentic-loop.ts:573— `stopLocalKitchenSinkServer` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-cold-start-bench.ts:565— `startLocalEngine` is async and calls mkdtempSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-cold-start-bench.ts:598— `stopLocalEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-memory-soak.ts:582— `startEngine` is async and calls mkdtempSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-memory-soak.ts:824— `stopChild` is async and calls appendFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-memory-soak.ts:848— `stopEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-memory-soak.ts:1894— `main` is async and calls mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:989— `startLocalEngine` is async and calls mkdtempSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:1050— `stopLocalEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:1513— `runMatrix` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking examples/kitchen-sink/scripts/sqlite-realworld-bench.ts:1562— `main` is async and calls mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking frontend/packages/icons/scripts/generate-manifest.js:238— `registerLegacyCustomKit` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking frontend/packages/icons/scripts/generate-manifest.js:288— `main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking frontend/packages/icons/scripts/vendor-icons.js:273— `bundleWithEsbuild` is async and calls existsSync, rmSync, mkdirSync, writeFileSync, renameSync, statSync, readdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking integrations/workflow-world/scripts/conformance/run.ts:93— `startEngine` is async and calls mkdtempSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking integrations/workflow-world/scripts/conformance/run.ts:254— `run` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking integrations/workflow-world/scripts/integration/run.ts:113— `startEngine` is async and calls mkdtempSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking integrations/workflow-world/scripts/integration/run.ts:858— `run` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:103— `acquireEngineStartLock` is async and calls mkdirSync, rmSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:259— `spawnSharedEngine` is async and calls mkdtempSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:375— `getOrStartSharedTestEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rivetkit-typescript/packages/rivetkit/tests/shared-engine.ts:437— `releaseSharedTestEngine` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rivetkit-typescript/packages/rivetkit/tests/driver/engine-restart-serverless.ts:184— `cleanup` is async and calls rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rivetkit-typescript/packages/sql-loader/src/hook.ts:5— `load` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Duplicated block (12 lines × 2) engine/packages/api-peer/src/actors/reschedule.rs:41— engine/packages/api-peer/src/actors/reschedule.rs:41-52 | engine/packages/api-peer/src/actors/sleep.rs:41-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) engine/packages/cache/src/req_config.rs:154— engine/packages/cache/src/req_config.rs:154-165 | engine/packages/cache/src/req_config.rs:266-277 — both copies are in the same file, so extract the block into 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) engine/packages/cli/src/cloud.rs:181— engine/packages/cli/src/cloud.rs:181-192 | engine/packages/cli/src/cloud.rs:213-224 — both copies are in the same file, so extract the block into 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) engine/packages/depot-client/src/query.rs:557— engine/packages/depot-client/src/query.rs:557-568 | engine/packages/depot-client/src/query.rs:601-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/packages/epoxy/src/workflows/coordinator/replica_status_change.rs:27— engine/packages/epoxy/src/workflows/coordinator/replica_status_change.rs:27-38 | engine/packages/epoxy/src/workflows/coordinator/replica_status_change.rs:44-55 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/mod.rs:755— engine/packages/gasoline/src/db/kv/mod.rs:755-766 | engine/packages/gasoline/src/db/kv/mod.rs:769-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/packages/gasoline-runtime/src/workflows/pruner.rs:115— engine/packages/gasoline-runtime/src/workflows/pruner.rs:115-126 | engine/packages/gasoline-runtime/src/workflows/pruner.rs:153-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:550— engine/packages/guard/src/routing/pegboard_gateway/mod.rs:550-561 | engine/packages/guard/src/routing/pegboard_gateway/mod.rs:845-856 — both copies are in the same file, so extract the block into 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) engine/packages/guard-core/src/proxy_service.rs:845— engine/packages/guard-core/src/proxy_service.rs:845-856 | engine/packages/guard-core/src/proxy_service.rs:1032-1043 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard-gateway2/src/lib.rs:471— engine/packages/pegboard-gateway2/src/lib.rs:471-482 | engine/packages/pegboard-gateway3/src/lib.rs:216-228 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (12 lines × 2) engine/packages/pegboard-gateway2/src/ping_task.rs:18— engine/packages/pegboard-gateway2/src/ping_task.rs:18-29 | engine/packages/pegboard-gateway3/src/ping_task.rs:18-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:289— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:289-300 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:654-665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:444— engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:444-455 | engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:469-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/packages/universaldb/src/versionstamp.rs:67— engine/packages/universaldb/src/versionstamp.rs:67-78 | engine/packages/universaldb/src/versionstamp.rs:123-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/sdks/rust/data/src/versioned/namespace_runner_config.rs:157— engine/sdks/rust/data/src/versioned/namespace_runner_config.rs:157-168 | engine/sdks/rust/data/src/versioned/namespace_runner_config.rs:269-281 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/client/src/remote_manager.rs:340— rivetkit-rust/packages/client/src/remote_manager.rs:340-351 | rivetkit-rust/packages/client/src/remote_manager.rs:405-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:85— rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:85-96 | rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:206-217 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:151— rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:151-162 | rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:531-542 — both copies are in the same file, so extract the block into 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) rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:63— rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:63-74 | rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:85-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1460— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1460-1471 | rivetkit-typescript/packages/rivetkit-napi/src/database.rs:367-378 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) engine/packages/depot/src/conveyer/restore_point/resolve.rs:300— engine/packages/depot/src/conveyer/restore_point/resolve.rs:300-311 | engine/packages/depot/src/conveyer/restore_point/resolve.rs:350-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/packages/api-public/src/actors/reschedule.rs:61— engine/packages/api-public/src/actors/reschedule.rs:61-72 | engine/packages/api-public/src/actors/sleep.rs:60-71 — 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) engine/packages/api-peer/src/namespaces.rs:19— engine/packages/api-peer/src/namespaces.rs:19-30 | engine/packages/api-peer/src/runners.rs:31-42 — 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) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:256— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:256-267 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:394-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/packages/depot/src/doctor.rs:3139— engine/packages/depot/src/doctor.rs:3139-3149 | engine/packages/depot/src/doctor.rs:3196-3206 — both copies are in the same file, so extract the block into 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) engine/packages/epoxy/src/replica/messages/accept.rs:50— engine/packages/epoxy/src/replica/messages/accept.rs:50-60 | engine/packages/epoxy/src/replica/messages/accept.rs:71-82 — both copies are in the same file, so extract the block into 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) engine/packages/error-macros/src/lib.rs:78— engine/packages/error-macros/src/lib.rs:78-88 | engine/packages/error-macros/src/lib.rs:178-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/packages/error-macros/src/lib.rs:369— engine/packages/error-macros/src/lib.rs:369-379 | engine/packages/error-macros/src/lib.rs:459-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/packages/gasoline/src/builder/common/signal.rs:132— engine/packages/gasoline/src/builder/common/signal.rs:132-142 | engine/packages/gasoline/src/builder/workflow/signal.rs:148-158 — `engine/packages/gasoline/src/builder/common/signal.rs` and `engine/packages/gasoline/src/builder/workflow/signal.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) engine/packages/pegboard/src/workflows/actor/destroy.rs:154— engine/packages/pegboard/src/workflows/actor/destroy.rs:154-164 | engine/packages/pegboard/src/workflows/actor2/mod.rs:1264-1274 — 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) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1484— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1484-1494 | engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1523-1533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:504— engine/packages/pegboard-gateway2/src/lib.rs:504-514 | engine/packages/pegboard-gateway3/src/lib.rs:250-260 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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) engine/packages/pegboard-gateway2/src/lib.rs:637— engine/packages/pegboard-gateway2/src/lib.rs:637-647 | engine/packages/pegboard-gateway3/src/lib.rs:383-393 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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) engine/packages/pegboard-gateway2/src/shared_state.rs:1165— engine/packages/pegboard-gateway2/src/shared_state.rs:1165-1175 | engine/packages/pegboard-gateway3/src/shared_state.rs:2075-2085 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/universaldb/src/driver/postgres/transaction.rs:88— engine/packages/universaldb/src/driver/postgres/transaction.rs:88-98 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:112-122 — `engine/packages/universaldb/src/driver/postgres/transaction.rs` and `engine/packages/universaldb/src/driver/rocksdb/transaction.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:212— engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:212-222 | engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:533-543 — both copies are in the same file, so extract the block into 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) engine/packages/universalpubsub/src/driver/memory/mod.rs:120— engine/packages/universalpubsub/src/driver/memory/mod.rs:120-130 | engine/packages/universalpubsub/src/driver/memory/mod.rs:141-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/sdks/rust/envoy-client/src/actor.rs:215— engine/sdks/rust/envoy-client/src/actor.rs:215-225 | engine/sdks/rust/envoy-client/src/actor.rs:230-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/sdks/rust/envoy-client/src/handle.rs:854— engine/sdks/rust/envoy-client/src/handle.rs:854-864 | engine/sdks/rust/envoy-client/src/handle.rs:894-904 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/client/src/remote_manager.rs:317— rivetkit-rust/packages/client/src/remote_manager.rs:317-327 | rivetkit-rust/packages/client/src/remote_manager.rs:382-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:197— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:197-207 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:333-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:457— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:457-467 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:477-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:631— rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:631-641 | rivetkit-rust/packages/rivetkit-core/src/serverless.rs:159-169 — 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) engine/packages/depot-client/src/vfs.rs:2205— engine/packages/depot-client/src/vfs.rs:2205-2215 | engine/packages/depot-client/src/vfs.rs:2331-2341 — both copies are in the same file, so extract the block into 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) engine/packages/error-macros/src/lib.rs:19— engine/packages/error-macros/src/lib.rs:19-29 | engine/packages/error-macros/src/lib.rs:245-255 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/runner.rs:672— engine/packages/pegboard/src/workflows/runner.rs:672-682 | engine/packages/pegboard/src/workflows/runner2.rs:529-539 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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) engine/packages/pegboard/src/ops/envoy/list.rs:120— engine/packages/pegboard/src/ops/envoy/list.rs:120-130 | engine/packages/pegboard/src/ops/runner/list_for_ns.rs:198-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
TooManyMethods: ActorContext rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:70— TooManyMethods — 352 methods, declared across 6 files: actor/context.rs (151), actor/state.rs (57), actor/schedule.rs (44), actor/sleep.rs (43), +2 more file(s). The bar is 30 methods; this is 322 over it, 11.73× 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: NapiCoreRuntime rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:266— TooManyMethods — 126 methods. The bar is 30 methods; this is 96 over it, 4.20× the bar. Most of these members implement runtime.CoreRuntime (120 of 126 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: WasmCoreRuntime rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:260— TooManyMethods — 118 methods. The bar is 30 methods; this is 88 over it, 3.93× the bar. Most of these members implement runtime.CoreRuntime (116 of 118 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: SqliteDb rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:231— TooManyMethods — 85 methods, declared across 2 files: sqlite/mod.rs (62), sqlite/tx.rs (23). The bar is 30 methods; this is 55 over it, 2.83× 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: ActorContext rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:52— TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.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: WorkflowContextImpl rivetkit-typescript/packages/workflow-engine/src/context.ts:343— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActorTask rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:332— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× 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: EnvoyHandle engine/sdks/rust/envoy-client/src/handle.rs:16— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× 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: Ctx rivetkit-rust/packages/rivetkit/src/context.rs:33— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: Runner engine/sdks/typescript/runner/src/mod.ts:203— 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: Runner rivetkit-typescript/packages/engine-runner/src/mod.ts:203— 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: ActorMetrics rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:117— 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: WorkflowCtx engine/packages/gasoline/src/ctx/workflow.rs:50— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: ActorConnection rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:34— 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: Transaction engine/packages/universaldb/src/transaction.rs:73— 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: WasmActorContext rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1187— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RegistryDispatcher rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:180— TooManyMethods — 41 methods, declared across 5 files: registry/inspector.rs (13), registry/mod.rs (11), registry/inspector_ws.rs (9), registry/http.rs (5), +1 more file(s). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DatabaseKv engine/packages/gasoline/src/db/kv/mod.rs:52— TooManyMethods — 37 methods, declared across 3 files: kv/repair.rs (23), kv/mod.rs (8), kv/debug.rs (6). The bar is 30 methods; this is 7 over it, 1.23× 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: ActorContextHandleAdapter rivetkit-typescript/packages/rivetkit/src/registry/native.ts:2718— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActorConnRaw rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:140— 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: ConnHandle rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:147— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActorObservable rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:37— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (14 lines × 2) engine/packages/api-public/src/actors/utils.rs:144— engine/packages/api-public/src/actors/utils.rs:144-157 | engine/packages/guard/src/routing/pegboard_gateway/resolve_actor_query.rs:195-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) engine/packages/depot/src/conveyer/restore_point.rs:79— engine/packages/depot/src/conveyer/restore_point.rs:79-92 | engine/packages/depot/src/conveyer/restore_point.rs:103-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) engine/packages/gasoline/src/ctx/standalone.rs:88— engine/packages/gasoline/src/ctx/standalone.rs:88-101 | engine/packages/gasoline/src/ctx/standalone.rs:105-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) engine/packages/gasoline/src/db/kv/keys/history.rs:1570— engine/packages/gasoline/src/db/kv/keys/history.rs:1570-1583 | engine/packages/gasoline/src/db/kv/keys/history.rs:1642-1655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:225— engine/packages/guard/src/routing/pegboard_gateway/mod.rs:225-238 | engine/packages/guard/src/routing/pegboard_gateway/mod.rs:990-1003 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/actor/keys.rs:134— engine/packages/pegboard/src/workflows/actor/keys.rs:134-147 | engine/packages/pegboard/src/workflows/actor2/keys.rs:129-142 — `engine/packages/pegboard/src/workflows/actor/keys.rs` and `engine/packages/pegboard/src/workflows/actor2/keys.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) engine/packages/pegboard/src/workflows/actor/mod.rs:231— engine/packages/pegboard/src/workflows/actor/mod.rs:231-244 | engine/packages/pegboard/src/workflows/actor/mod.rs:868-881 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/actor/runtime.rs:841— engine/packages/pegboard/src/workflows/actor/runtime.rs:841-854 | engine/packages/pegboard/src/workflows/actor/runtime.rs:976-989 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) engine/packages/pegboard/src/workflows/actor2/alloc_serverful/newest_ping_timestamp.rs:17— engine/packages/pegboard/src/workflows/actor2/alloc_serverful/newest_ping_timestamp.rs:17-30 | engine/packages/pegboard/src/workflows/actor2/alloc_serverful/random_ping_timestamp.rs:113-126 — 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 (14 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:1070— engine/packages/pegboard-gateway2/src/lib.rs:1070-1083 | engine/packages/pegboard-gateway3/src/lib.rs:771-784 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (14 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:552— engine/packages/pegboard-gateway2/src/shared_state.rs:552-565 | engine/packages/pegboard-gateway3/src/shared_state.rs:609-622 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (14 lines × 2) engine/packages/universaldb/src/driver/postgres/transaction.rs:290— engine/packages/universaldb/src/driver/postgres/transaction.rs:290-303 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:314-327 — `engine/packages/universaldb/src/driver/postgres/transaction.rs` and `engine/packages/universaldb/src/driver/rocksdb/transaction.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) engine/sdks/rust/envoy-client/src/handle.rs:839— engine/sdks/rust/envoy-client/src/handle.rs:839-852 | engine/sdks/rust/envoy-client/src/handle.rs:879-892 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:652— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:652-665 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:734-747 — both copies are in the same file, so extract the block into 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) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1101— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1101-1114 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:278-291 — before extracting anything, compare `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs` and `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 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 (14 lines × 2) engine/packages/pegboard-gateway3/src/shared_state.rs:1061— engine/packages/pegboard-gateway3/src/shared_state.rs:1061-1074 | engine/packages/pegboard-gateway3/src/shared_state.rs:1098-1111 — both copies are in the same file, so extract the block into 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) engine/packages/depot/src/workflows/db_reclaimer.rs:685— engine/packages/depot/src/workflows/db_reclaimer.rs:685-698 | engine/packages/depot/src/workflows/db_reclaimer.rs:1344-1357 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/repair.rs:2550— engine/packages/gasoline/src/db/kv/repair.rs:2550-2563 | engine/packages/gasoline/src/db/kv/repair.rs:2687-2700 — both copies are in the same file, so extract the block into 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) engine/packages/test-snapshot-gen/src/lib.rs:193— engine/packages/test-snapshot-gen/src/lib.rs:193-206 | engine/packages/test-snapshot-gen/src/test_cluster.rs:99-112 — before extracting anything, compare `engine/packages/test-snapshot-gen/src/lib.rs` and `engine/packages/test-snapshot-gen/src/test_cluster.rs` as WHOLE FILES: this scan already matched 5 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) engine/packages/test-snapshot-gen/src/lib.rs:315— engine/packages/test-snapshot-gen/src/lib.rs:315-328 | engine/packages/test-snapshot-gen/src/test_cluster.rs:221-234 — before extracting anything, compare `engine/packages/test-snapshot-gen/src/lib.rs` and `engine/packages/test-snapshot-gen/src/test_cluster.rs` as WHOLE FILES: this scan already matched 5 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.
Off the main sequence: RivetKitClient — RivetKitClient: 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: rivet-config — rivet-config: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 37 project(s), so it's rigid to change.
Off the main sequence: rivet-depot-client-types — rivet-depot-client-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: rivet-envoy-protocol — rivet-envoy-protocol: 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: rivet-logs — rivet-logs: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: rivet-term — rivet-term: 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: rivetkit-engine-process — rivetkit-engine-process: 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: rivetkit-shared-types — rivetkit-shared-types: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: rivetkit-core — rivetkit-core: abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: rivet-error — rivet-error: abstractness 0.00, instability 0.05, distance 0.95 — zone of pain — concrete and depended on by 20 project(s), so it's rigid to change.
Off the main sequence: rivet-runtime — rivet-runtime: abstractness 0.00, instability 0.19, distance 0.81 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Off the main sequence: rivet-data — rivet-data: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: rivet-auth-policy — rivet-auth-policy: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: rivet-outbound-guard — rivet-outbound-guard: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: rivet-pools — rivet-pools: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
Off the main sequence: rivet-util-serde — rivet-util-serde: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: @rivetkit/traces — @rivetkit/traces: abstractness 0.27, instability 0.00, distance 0.73 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: universaldb — universaldb: abstractness 0.12, instability 0.15, distance 0.72 — zone of pain — concrete and depended on by 22 project(s), so it's rigid to change.
pegboard::workflows::actor::pegboard_actor (cyclomatic 70) engine/packages/pegboard/src/workflows/actor/mod.rs:37— pegboard::workflows::actor::pegboard_actor 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.
pegboard::workflows::actor2::process_signal (cyclomatic 51) engine/packages/pegboard/src/workflows/actor2/mod.rs:635— pegboard::workflows::actor2::process_signal has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pegboard::workflows::actor::handle_stopped (cyclomatic 25) engine/packages/pegboard/src/workflows/actor/mod.rs:1047— pegboard::workflows::actor::handle_stopped has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pegboard::ops::runner_config::upsert::pegboard_runner_config_upsert (cyclomatic 25) engine/packages/pegboard/src/ops/runner_config/upsert.rs:16— pegboard::ops::runner_config::upsert::pegboard_runner_config_upsert 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.
pegboard::actor_kv::preload::batch_preload (cyclomatic 23) engine/packages/pegboard/src/actor_kv/preload.rs:53— pegboard::actor_kv::preload::batch_preload 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.
pegboard::workflows::runner::pegboard_runner (cyclomatic 23) engine/packages/pegboard/src/workflows/runner.rs:62— pegboard::workflows::runner::pegboard_runner 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.
pegboard::workflows::actor::runtime::allocate_actor_v2 (cyclomatic 22) engine/packages/pegboard/src/workflows/actor/runtime.rs:238— pegboard::workflows::actor::runtime::allocate_actor_v2 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.
pegboard::workflows::serverless::conn::outbound_req_inner (cyclomatic 22) engine/packages/pegboard/src/workflows/serverless/conn.rs:198— pegboard::workflows::serverless::conn::outbound_req_inner 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.
pegboard::workflows::actor2::runtime::handle_stopped (cyclomatic 21) engine/packages/pegboard/src/workflows/actor2/runtime.rs:558— pegboard::workflows::actor2::runtime::handle_stopped has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pegboard::workflows::actor::runtime::spawn_actor (cyclomatic 21) engine/packages/pegboard/src/workflows/actor/runtime.rs:644— pegboard::workflows::actor::runtime::spawn_actor 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.
pegboard::ops::actor::create::pegboard_actor_create (cyclomatic 20) engine/packages/pegboard/src/ops/actor/create.rs:44— pegboard::ops::actor::create::pegboard_actor_create 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.
pegboard::workflows::actor2::alloc_serverful::hash::allocate_with_rng (cyclomatic 18) engine/packages/pegboard/src/workflows/actor2/alloc_serverful/hash.rs:112— pegboard::workflows::actor2::alloc_serverful::hash::allocate_with_rng 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.
pegboard::ops::serverless_metadata::fetch::pegboard_serverless_metadata_fetch (cyclomatic 18) engine/packages/pegboard/src/ops/serverless_metadata/fetch.rs:156— pegboard::ops::serverless_metadata::fetch::pegboard_serverless_metadata_fetch 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.
pegboard::workflows::actor_migration_fix_backfill::backfill_chunk (cyclomatic 18) engine/packages/pegboard/src/workflows/actor_migration_fix_backfill.rs:67— pegboard::workflows::actor_migration_fix_backfill::backfill_chunk 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.
pegboard::ops::actor::list_for_ns::pegboard_actor_list_for_ns (cyclomatic 16) engine/packages/pegboard/src/ops/actor/list_for_ns.rs:40— pegboard::ops::actor::list_for_ns::pegboard_actor_list_for_ns 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.
pegboard::ops::runner::list_for_ns::pegboard_runner_list_for_ns (cyclomatic 16) engine/packages/pegboard/src/ops/runner/list_for_ns.rs:25— pegboard::ops::runner::list_for_ns::pegboard_runner_list_for_ns 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.
pegboard::workflows::actor2::listen_for_signals (cyclomatic 16) engine/packages/pegboard/src/workflows/actor2/mod.rs:469— pegboard::workflows::actor2::listen_for_signals 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.
DatabaseKv::prune_signals_inner (cognitive 58) engine/packages/gasoline/src/db/kv/debug.rs:2094— DatabaseKv::prune_signals_inner has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (47 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DatabaseKv::pull_workflows (cognitive 57) engine/packages/gasoline/src/db/kv/mod.rs:1138— DatabaseKv::pull_workflows has cognitive complexity 57 (threshold 15). Drivers by points: if/else 31 (43 pts), loops 9, boolean chains 5 (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.
DatabaseKv::find_workflows (cognitive 46) engine/packages/gasoline/src/db/kv/debug.rs:301— DatabaseKv::find_workflows has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 4 (12 pts), boolean chains 5, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DatabaseKv::prune_workflow_history_inner (cognitive 46) engine/packages/gasoline/src/db/kv/debug.rs:1910— DatabaseKv::prune_workflow_history_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 3 (6 pts), boolean chains 3, match/switch 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.
DatabaseKv::find_signals (cognitive 37) engine/packages/gasoline/src/db/kv/debug.rs:1050— DatabaseKv::find_signals has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 2 (6 pts), boolean chains 4, 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.
DatabaseKv::publish_metrics (cognitive 35) engine/packages/gasoline/src/db/kv/mod.rs:676— DatabaseKv::publish_metrics has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (6 pts), 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.
DatabaseKv::backfill_dead_workflows (cognitive 29) engine/packages/gasoline/src/db/kv/debug.rs:1328— DatabaseKv::backfill_dead_workflows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseKv::verify_deallocate_set_error (cognitive 26) engine/packages/gasoline/src/db/kv/repair.rs:2315— DatabaseKv::verify_deallocate_set_error has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 7 (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.
DatabaseKv::inspect_missing_init_state (cognitive 25) engine/packages/gasoline/src/db/kv/repair.rs:1269— DatabaseKv::inspect_missing_init_state has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DatabaseKv::inspect_deallocate_set_error (cognitive 22) engine/packages/gasoline/src/db/kv/repair.rs:1552— DatabaseKv::inspect_deallocate_set_error has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DatabaseKv::silence_workflows (cognitive 20) engine/packages/gasoline/src/db/kv/debug.rs:430— DatabaseKv::silence_workflows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (7 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.
DatabaseKv::inspect_orphaned_sleep_state (cognitive 19) engine/packages/gasoline/src/db/kv/repair.rs:1782— DatabaseKv::inspect_orphaned_sleep_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DatabaseKv::get_workflows_inner (cognitive 18) engine/packages/gasoline/src/db/kv/debug.rs:45— DatabaseKv::get_workflows_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseKv::prune_workflows (cognitive 17) engine/packages/gasoline/src/db/kv/debug.rs:1464— DatabaseKv::prune_workflows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseKv::inspect_loop_iteration_mismatch (cognitive 17) engine/packages/gasoline/src/db/kv/repair.rs:817— DatabaseKv::inspect_loop_iteration_mismatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 4, match/switch 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.
DatabaseKv::pull_next_signals (cognitive 16) engine/packages/gasoline/src/db/kv/mod.rs:2490— DatabaseKv::pull_next_signals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (15 lines × 2) engine/packages/api-builder/src/error_response.rs:40— engine/packages/api-builder/src/error_response.rs:40-54 | engine/packages/guard-core/src/utils.rs:437-451 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) engine/packages/depot/src/conveyer/ltx.rs:174— engine/packages/depot/src/conveyer/ltx.rs:174-188 | engine/packages/depot/src/conveyer/ltx.rs:411-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) engine/packages/depot/src/workflows/db_reclaimer.rs:264— engine/packages/depot/src/workflows/db_reclaimer.rs:264-278 | engine/packages/depot/src/workflows/db_reclaimer.rs:820-834 — both copies are in the same file, so extract the block into 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) engine/packages/epoxy/src/replica/messages/accept.rs:19— engine/packages/epoxy/src/replica/messages/accept.rs:19-33 | engine/packages/epoxy/src/replica/messages/prepare.rs:18-32 — before extracting anything, compare `engine/packages/epoxy/src/replica/messages/accept.rs` and `engine/packages/epoxy/src/replica/messages/prepare.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) engine/packages/pegboard/src/workflows/actor/keys.rs:80— engine/packages/pegboard/src/workflows/actor/keys.rs:80-94 | engine/packages/pegboard/src/workflows/actor2/keys.rs:75-89 — `engine/packages/pegboard/src/workflows/actor/keys.rs` and `engine/packages/pegboard/src/workflows/actor2/keys.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) engine/packages/pegboard/src/workflows/actor/metrics.rs:212— engine/packages/pegboard/src/workflows/actor/metrics.rs:212-226 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:203-217 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) engine/packages/pegboard/src/workflows/actor/metrics.rs:314— engine/packages/pegboard/src/workflows/actor/metrics.rs:314-328 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:309-323 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) engine/packages/pegboard-envoy/src/tunnel_to_ws_task.rs:81— engine/packages/pegboard-envoy/src/tunnel_to_ws_task.rs:81-95 | engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:66-80 — 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) engine/packages/pegboard-gateway2/src/lib.rs:354— engine/packages/pegboard-gateway2/src/lib.rs:354-368 | engine/packages/pegboard-gateway3/src/lib.rs:127-141 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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) engine/packages/pegboard-gateway2/src/lib.rs:570— engine/packages/pegboard-gateway2/src/lib.rs:570-584 | engine/packages/pegboard-gateway3/src/lib.rs:316-330 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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) engine/packages/pegboard-gateway2/src/shared_state.rs:916— engine/packages/pegboard-gateway2/src/shared_state.rs:916-930 | engine/packages/pegboard-gateway3/src/shared_state.rs:1383-1397 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/shared_state.rs:1244— engine/packages/pegboard-gateway2/src/shared_state.rs:1244-1258 | engine/packages/pegboard-gateway3/src/shared_state.rs:2167-2181 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/shared_state.rs:1345— engine/packages/pegboard-gateway2/src/shared_state.rs:1345-1359 | engine/packages/pegboard-gateway3/src/shared_state.rs:2287-2301 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:58— engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:58-72 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:99-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:1063— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:1063-1077 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:1084-1098 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1048— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1048-1062 | engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1065-1079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) engine/packages/gasoline/src/db/kv/keys/history.rs:1934— engine/packages/gasoline/src/db/kv/keys/history.rs:1934-1938 | engine/packages/gasoline/src/db/kv/keys/history.rs:2046-2050 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/db/kv/keys/workflow.rs:1339— engine/packages/gasoline/src/db/kv/keys/workflow.rs:1339-1343 | engine/packages/namespace/src/keys/metric.rs:207-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) engine/packages/pegboard-envoy/src/lib.rs:84— engine/packages/pegboard-envoy/src/lib.rs:84-88 | engine/packages/pegboard-runner/src/lib.rs:73-77 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-runner/src/lib.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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) engine/packages/universaldb/src/driver/postgres/transaction_task.rs:231— engine/packages/universaldb/src/driver/postgres/transaction_task.rs:231-235 | engine/packages/universaldb/src/driver/postgres/transaction_task.rs:258-262 — both copies are in the same file, so extract the block into 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) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:670— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:670-674 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:689-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 (5 lines × 2) engine/packages/universaldb/src/driver/postgres/transaction.rs:205— engine/packages/universaldb/src/driver/postgres/transaction.rs:205-209 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:229-233 — `engine/packages/universaldb/src/driver/postgres/transaction.rs` and `engine/packages/universaldb/src/driver/rocksdb/transaction.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) engine/packages/pegboard/src/workflows/runner_pool_error_tracker.rs:97— engine/packages/pegboard/src/workflows/runner_pool_error_tracker.rs:97-101 | engine/packages/pegboard/src/workflows/serverless/receiver.rs:63-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) engine/packages/postgres-util/src/lib.rs:27— engine/packages/postgres-util/src/lib.rs:27-31 | engine/packages/postgres-util/src/lib.rs:53-62 — both copies are in the same file, so extract the block into 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) engine/packages/depot-client/src/query.rs:50— engine/packages/depot-client/src/query.rs:50-54 | engine/packages/depot-client/src/query.rs:92-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) rivetkit-rust/packages/client/src/remote_manager.rs:197— rivetkit-rust/packages/client/src/remote_manager.rs:197-201 | rivetkit-rust/packages/client/src/remote_manager.rs:258-262 — both copies are in the same file, so extract the block into 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) engine/packages/depot/src/workflows/db_reclaimer.rs:337— engine/packages/depot/src/workflows/db_reclaimer.rs:337-341 | engine/packages/depot/src/workflows/db_reclaimer.rs:894-898 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/keys/ns.rs:346— engine/packages/pegboard/src/keys/ns.rs:346-350 | engine/packages/pegboard/src/keys/ns.rs:481-485 — both copies are in the same file, so extract the block into 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) engine/sdks/rust/envoy-client/src/utils.rs:98— engine/sdks/rust/envoy-client/src/utils.rs:98-102 | rivetkit-rust/packages/rivetkit-core/src/lib.rs:69-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1032— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1032-1036 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1040-1044 — both copies are in the same file, so extract the block into 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) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:171— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:171-175 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:273-277 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:171` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:197— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:197-201 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:305-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:197` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) engine/packages/depot/src/doctor.rs:3273— engine/packages/depot/src/doctor.rs:3273-3288 | engine/packages/depot/src/doctor.rs:3324-3339 — both copies are in the same file, so extract the block into 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) engine/packages/engine/src/commands/udb/cli.rs:1186— engine/packages/engine/src/commands/udb/cli.rs:1186-1201 | engine/packages/engine/src/commands/udb/cli.rs:1215-1230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) engine/packages/epoxy/src/replica/messages/accept.rs:62— engine/packages/epoxy/src/replica/messages/accept.rs:62-77 | engine/packages/epoxy/src/replica/messages/accept.rs:84-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) engine/packages/pegboard/src/workflows/actor/metrics.rs:344— engine/packages/pegboard/src/workflows/actor/metrics.rs:344-359 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:341-356 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) engine/packages/pegboard/src/workflows/runner.rs:478— engine/packages/pegboard/src/workflows/runner.rs:478-493 | engine/packages/pegboard/src/workflows/runner2.rs:451-466 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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 (16 lines × 2) engine/packages/pegboard/src/workflows/runner.rs:714— engine/packages/pegboard/src/workflows/runner.rs:714-729 | engine/packages/pegboard/src/workflows/runner2.rs:576-591 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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 (16 lines × 2) engine/packages/pegboard-envoy/src/actor_event_demuxer.rs:108— engine/packages/pegboard-envoy/src/actor_event_demuxer.rs:108-123 | engine/packages/pegboard-runner/src/actor_event_demuxer.rs:98-113 — 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) engine/packages/pegboard-gateway2/src/lib.rs:652— engine/packages/pegboard-gateway2/src/lib.rs:652-667 | engine/packages/pegboard-gateway3/src/lib.rs:398-413 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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) engine/packages/pegboard-gateway2/src/shared_state.rs:84— engine/packages/pegboard-gateway2/src/shared_state.rs:84-99 | engine/packages/pegboard-gateway3/src/shared_state.rs:90-105 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/shared_state.rs:514— engine/packages/pegboard-gateway2/src/shared_state.rs:514-529 | engine/packages/pegboard-gateway3/src/shared_state.rs:571-586 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/shared_state.rs:1119— engine/packages/pegboard-gateway2/src/shared_state.rs:1119-1134 | engine/packages/pegboard-gateway3/src/shared_state.rs:1597-1612 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway3/src/shared_state.rs:694— engine/packages/pegboard-gateway3/src/shared_state.rs:694-709 | engine/sdks/rust/envoy-client/src/http.rs:264-279 — 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) engine/sdks/rust/envoy-client/src/actor.rs:670— engine/sdks/rust/envoy-client/src/actor.rs:670-685 | engine/sdks/rust/envoy-client/src/actor.rs:786-801 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:62— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:62-77 | rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:457-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:223— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:223-238 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:344-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
rivet_envoy_client::envoy::envoy_loop (cognitive 67) engine/sdks/rust/envoy-client/src/envoy.rs:448— rivet_envoy_client::envoy::envoy_loop has cognitive complexity 67 (threshold 15). Drivers by points: if/else 10 (37 pts), loops 7 (23 pts), match/switch 3 (7 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::actor::actor_inner (cognitive 54) engine/sdks/rust/envoy-client/src/actor.rs:164— rivet_envoy_client::actor::actor_inner has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (40 pts), match/switch 4 (13 pts), loops 1 (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.
rivet_envoy_client::actor::http::send_response (cognitive 44) engine/sdks/rust/envoy-client/src/actor/http.rs:719— rivet_envoy_client::actor::http::send_response has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::actor::handle_hws_restore (cognitive 34) engine/sdks/rust/envoy-client/src/actor.rs:904— rivet_envoy_client::actor::handle_hws_restore has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (27 pts), match/switch 1 (3 pts), boolean chains 2, loops 2 (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.
rivet_envoy_client::connection::native::single_connection (cognitive 33) engine/sdks/rust/envoy-client/src/connection/native.rs:96— rivet_envoy_client::connection::native::single_connection has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::connection::wasm::imp::single_connection (cognitive 33) engine/sdks/rust/envoy-client/src/connection/wasm.rs:102— rivet_envoy_client::connection::wasm::imp::single_connection has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 5 (8 pts), loops 3 (6 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.
rivet_envoy_client::actor::http::handle_req_chunk (cognitive 29) engine/sdks/rust/envoy-client/src/actor/http.rs:446— rivet_envoy_client::actor::http::handle_req_chunk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::tunnel::handle_tunnel_message (cognitive 24) engine/sdks/rust/envoy-client/src/tunnel.rs:93— rivet_envoy_client::tunnel::handle_tunnel_message has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, 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.
rivet_envoy_client::events::handle_send_events (cognitive 20) engine/sdks/rust/envoy-client/src/events.rs:10— rivet_envoy_client::events::handle_send_events has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (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.
rivet_envoy_client::connection::native::connection_loop (cognitive 20) engine/sdks/rust/envoy-client/src/connection/native.rs:30— rivet_envoy_client::connection::native::connection_loop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 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.
rivet_envoy_client::connection::wasm::imp::connection_loop (cognitive 20) engine/sdks/rust/envoy-client/src/connection/wasm.rs:36— rivet_envoy_client::connection::wasm::imp::connection_loop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 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.
rivet_envoy_client::actor::handle_ws_open (cognitive 17) engine/sdks/rust/envoy-client/src/actor.rs:615— rivet_envoy_client::actor::handle_ws_open has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
rivet_envoy_client::tunnel::handle_request_start (cognitive 16) engine/sdks/rust/envoy-client/src/tunnel.rs:330— rivet_envoy_client::tunnel::handle_request_start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 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.
DatabaseKv::pull_workflows (cyclomatic 40) engine/packages/gasoline/src/db/kv/mod.rs:1138— DatabaseKv::pull_workflows 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.
DatabaseKv::find_workflows (cyclomatic 27) engine/packages/gasoline/src/db/kv/debug.rs:301— DatabaseKv::find_workflows 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.
DatabaseKv::prune_workflow_history_inner (cyclomatic 24) engine/packages/gasoline/src/db/kv/debug.rs:1910— DatabaseKv::prune_workflow_history_inner 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.
DatabaseKv::prune_signals_inner (cyclomatic 23) engine/packages/gasoline/src/db/kv/debug.rs:2094— DatabaseKv::prune_signals_inner 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.
DatabaseKv::inspect_missing_init_state (cyclomatic 22) engine/packages/gasoline/src/db/kv/repair.rs:1269— DatabaseKv::inspect_missing_init_state has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DatabaseKv::find_signals (cyclomatic 20) engine/packages/gasoline/src/db/kv/debug.rs:1050— DatabaseKv::find_signals 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.
DatabaseKv::inspect_deallocate_set_error (cyclomatic 19) engine/packages/gasoline/src/db/kv/repair.rs:1552— DatabaseKv::inspect_deallocate_set_error 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.
DatabaseKv::backfill_dead_workflows (cyclomatic 18) engine/packages/gasoline/src/db/kv/debug.rs:1328— DatabaseKv::backfill_dead_workflows 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.
DatabaseKv::inspect_orphaned_sleep_state (cyclomatic 18) engine/packages/gasoline/src/db/kv/repair.rs:1782— DatabaseKv::inspect_orphaned_sleep_state 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.
DatabaseKv::verify_deallocate_set_error (cyclomatic 18) engine/packages/gasoline/src/db/kv/repair.rs:2315— DatabaseKv::verify_deallocate_set_error 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.
DatabaseKv::publish_metrics (cyclomatic 17) engine/packages/gasoline/src/db/kv/mod.rs:676— DatabaseKv::publish_metrics 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.
DatabaseKv::inspect_loop_iteration_mismatch (cyclomatic 17) engine/packages/gasoline/src/db/kv/repair.rs:817— DatabaseKv::inspect_loop_iteration_mismatch 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.
R4 · Test Coverage· No test reaches this file · ×12
No test reaches this file engine/sdks/typescript/runner/src/mod.ts— 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 engine/sdks/typescript/runner/src/tunnel.ts— 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 integrations/workflow-world/scripts/integration/run.ts— 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 scripts/skill-evals/src/index.ts— 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 rivetkit-typescript/packages/mcp-hub/src/index.ts— 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 scripts/debug/logfmt_to_gantt.ts— 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 scripts/vbare-gen-converters/index.ts— 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 scripts/publish/src/ci/bin.ts— 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 scripts/publish/src/lib/version.ts— 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 rivetkit-typescript/packages/framework-base/src/mod.ts— 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 self-host/compose/template/src/docker-compose.ts— 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 scripts/publish/src/lib/npm.ts— 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.
depot::workflows::db_hot_compactor::install_hot_chunk_tx (cyclomatic 35) engine/packages/depot/src/workflows/db_hot_compactor.rs:912— depot::workflows::db_hot_compactor::install_hot_chunk_tx 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.
depot::compaction::shared::read_commit_delta_reclaim_window (cyclomatic 32) engine/packages/depot/src/compaction/shared.rs:972— depot::compaction::shared::read_commit_delta_reclaim_window 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.
depot::workflows::db_reclaimer::reclaim_fdb_job_tx (cyclomatic 32) engine/packages/depot/src/workflows/db_reclaimer.rs:641— depot::workflows::db_reclaimer::reclaim_fdb_job_tx has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot::compaction::shared::read_hot_input_snapshot (cyclomatic 25) engine/packages/depot/src/compaction/shared.rs:573— depot::compaction::shared::read_hot_input_snapshot 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.
depot::doctor::detect_unsupported (cyclomatic 23) engine/packages/depot/src/doctor.rs:1007— depot::doctor::detect_unsupported 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.
depot::workflows::db_reclaimer::cleanup_repair_fdb_outputs_tx (cyclomatic 19) engine/packages/depot/src/workflows/db_reclaimer.rs:1328— depot::workflows::db_reclaimer::cleanup_repair_fdb_outputs_tx 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.
depot::doctor::doctor (cyclomatic 19) engine/packages/depot/src/doctor.rs:432— depot::doctor::doctor 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.
depot::doctor::load_storage_facts (cyclomatic 18) engine/packages/depot/src/doctor.rs:1252— depot::doctor::load_storage_facts 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.
depot::conveyer::read::sqlite_page::overflow_head_pages (cyclomatic 17) engine/packages/depot/src/conveyer/read/sqlite_page.rs:110— depot::conveyer::read::sqlite_page::overflow_head_pages 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.
depot::conveyer::read::scan_source_delta_history (cyclomatic 16) engine/packages/depot/src/conveyer/read.rs:1575— depot::conveyer::read::scan_source_delta_history 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.
depot::recovery::scan_hot_shard_history_branch (cyclomatic 16) engine/packages/depot/src/recovery.rs:376— depot::recovery::scan_hot_shard_history_branch 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.
AC2 · Forms & labels· <Select> field component without a label · ×10
<Select> field component without a label frontend/packages/components/src/auto-form/fields/union.tsx:56— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/packages/components/src/datepicker.tsx:55— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/packages/components/src/datepicker.tsx:127— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/app/help-button.tsx:151— This UI-library field component has no label / aria-label / aria-labelledby / id / name, and nothing it renders carries one either. The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/app/metrics/metrics-time-range-select.tsx:20— This UI-library field component has no label / aria-label / aria-labelledby / id / name, and nothing it renders carries one either. The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/app/settings-pages/mcp-connection.tsx:37— This UI-library field component has no label / aria-label / aria-labelledby / id / name, and nothing it renders carries one either. The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/actors/actor-database.tsx:837— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/actors/actor-traces.tsx:176— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/datepicker.tsx:53— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/datepicker.tsx:127— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×10
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×10
Duplicated block (17 lines × 2) engine/packages/api-peer/src/envoys.rs:41— engine/packages/api-peer/src/envoys.rs:41-57 | engine/packages/api-peer/src/runners.rs:60-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:519— engine/packages/pegboard-gateway2/src/lib.rs:519-535 | engine/packages/pegboard-gateway3/src/lib.rs:265-281 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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) engine/packages/pegboard-gateway2/src/shared_state.rs:754— engine/packages/pegboard-gateway2/src/shared_state.rs:754-770 | engine/packages/pegboard-gateway3/src/shared_state.rs:1135-1151 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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) engine/packages/pegboard-gateway2/src/hibernation_task.rs:134— engine/packages/pegboard-gateway2/src/hibernation_task.rs:134-150 | engine/packages/pegboard-gateway3/src/hibernation_task.rs:134-150 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/hibernation_task.rs` and `engine/packages/pegboard-gateway3/src/hibernation_task.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 139 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) engine/packages/runner-protocol/src/versioned.rs:468— engine/packages/runner-protocol/src/versioned.rs:468-484 | engine/packages/runner-protocol/src/versioned.rs:837-853 — both copies are in the same file, so extract the block into 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) engine/packages/universaldb/src/driver/postgres/transaction.rs:235— engine/packages/universaldb/src/driver/postgres/transaction.rs:235-251 | engine/packages/universaldb/src/driver/postgres/transaction.rs:328-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) engine/packages/universaldb/src/driver/rocksdb/transaction.rs:260— engine/packages/universaldb/src/driver/rocksdb/transaction.rs:260-276 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:353-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) engine/packages/util/src/throttle.rs:168— engine/packages/util/src/throttle.rs:168-184 | engine/packages/util/src/throttle.rs:224-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1815— rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1815-1831 | rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1883-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 (17 lines × 2) rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:35— rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:35-51 | rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:59-75 — both copies are in the same file, so extract the 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) engine/packages/depot/src/workflows/compaction_backfill.rs:272— engine/packages/depot/src/workflows/compaction_backfill.rs:272-291 | engine/packages/epoxy/src/workflows/backfill.rs:192-211 | engine/packages/gasoline-runtime/src/workflows/dead_wf_backfill.rs:90-109 | engine/packages/pegboard/src/workflows/actor_runner_name_selector_backfill.rs:87-106 — 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) engine/packages/epoxy/src/replica/commit_kv.rs:31— engine/packages/epoxy/src/replica/commit_kv.rs:31-98 | engine/packages/epoxy/src/replica/messages/accept.rs:15-115 | engine/packages/epoxy/src/replica/messages/prepare.rs:15-108 | engine/packages/epoxy/src/replica/messages/read_state.rs:12-77 — 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) engine/packages/gasoline/src/db/kv/debug.rs:2416— engine/packages/gasoline/src/db/kv/debug.rs:2416-2438 | engine/packages/gasoline/src/db/kv/debug.rs:2444-2468 | engine/packages/gasoline/src/db/kv/debug.rs:2474-2500 | engine/packages/gasoline/src/db/kv/debug.rs:2506-2535 — 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) engine/packages/gasoline/src/history/cursor.rs:179— engine/packages/gasoline/src/history/cursor.rs:179-219 | engine/packages/gasoline/src/history/cursor.rs:225-265 | engine/packages/gasoline/src/history/cursor.rs:271-311 | engine/packages/gasoline/src/history/cursor.rs:317-357 — 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) engine/packages/gasoline/src/history/cursor.rs:359— engine/packages/gasoline/src/history/cursor.rs:359-388 | engine/packages/gasoline/src/history/cursor.rs:390-419 | engine/packages/gasoline/src/history/cursor.rs:422-451 | engine/packages/gasoline/src/history/cursor.rs:572-601 — 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) engine/packages/logs/src/unix.rs:64— engine/packages/logs/src/unix.rs:64-91 | engine/packages/logs/src/unix.rs:151-177 | engine/packages/logs/src/windows.rs:74-115 | engine/packages/logs/src/windows.rs:175-216 — 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) engine/packages/universaldb/src/driver/postgres/transaction.rs:223— engine/packages/universaldb/src/driver/postgres/transaction.rs:223-251 | engine/packages/universaldb/src/driver/postgres/transaction.rs:315-344 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:247-276 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:339-369 — 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) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:630— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:630-645 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:647-663 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:665-682 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:684-702 — 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.
Duplicated block (23 lines × 2) engine/packages/api-public/src/actors/create.rs:58— engine/packages/api-public/src/actors/create.rs:58-80 | engine/packages/api-public/src/actors/get_or_create.rs:66-88 — 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 (23 lines × 2) engine/packages/depot/src/workflows/db_reclaimer.rs:311— engine/packages/depot/src/workflows/db_reclaimer.rs:311-333 | engine/packages/depot/src/workflows/db_reclaimer.rs:870-892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) engine/packages/logs/src/unix.rs:127— engine/packages/logs/src/unix.rs:127-149 | engine/packages/logs/src/windows.rs:151-173 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) engine/packages/pegboard/src/workflows/actor/keys.rs:236— engine/packages/pegboard/src/workflows/actor/keys.rs:236-258 | engine/packages/pegboard/src/workflows/actor2/keys.rs:214-236 — `engine/packages/pegboard/src/workflows/actor/keys.rs` and `engine/packages/pegboard/src/workflows/actor2/keys.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 2) engine/packages/pegboard-envoy/src/lib.rs:277— engine/packages/pegboard-envoy/src/lib.rs:277-299 | engine/packages/pegboard-runner/src/lib.rs:187-209 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-runner/src/lib.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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 (23 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1026— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1026-1048 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:243-265 — before extracting anything, compare `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs` and `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 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 (23 lines × 2) engine/packages/test-snapshot-gen/src/lib.rs:257— engine/packages/test-snapshot-gen/src/lib.rs:257-279 | engine/packages/test-snapshot-gen/src/test_cluster.rs:163-185 — before extracting anything, compare `engine/packages/test-snapshot-gen/src/lib.rs` and `engine/packages/test-snapshot-gen/src/test_cluster.rs` as WHOLE FILES: this scan already matched 5 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 (23 lines × 2) engine/packages/test-snapshot-gen/src/lib.rs:286— engine/packages/test-snapshot-gen/src/lib.rs:286-308 | engine/packages/test-snapshot-gen/src/test_cluster.rs:192-214 — before extracting anything, compare `engine/packages/test-snapshot-gen/src/lib.rs` and `engine/packages/test-snapshot-gen/src/test_cluster.rs` as WHOLE FILES: this scan already matched 5 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 (19 lines × 2) engine/packages/engine/src/util/wf/mod.rs:239— engine/packages/engine/src/util/wf/mod.rs:239-257 | engine/packages/engine/src/util/wf/mod.rs:438-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) engine/packages/gasoline/src/db/kv/keys/history.rs:2104— engine/packages/gasoline/src/db/kv/keys/history.rs:2104-2122 | engine/packages/gasoline/src/db/kv/keys/history.rs:2149-2167 — both copies are in the same file, so extract the block into 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) engine/packages/logs/src/unix.rs:95— engine/packages/logs/src/unix.rs:95-113 | engine/packages/logs/src/windows.rs:119-137 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 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) engine/packages/pegboard/src/workflows/actor/runtime.rs:821— engine/packages/pegboard/src/workflows/actor/runtime.rs:821-839 | engine/packages/pegboard/src/workflows/actor/runtime.rs:956-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 (19 lines × 2) engine/packages/pegboard/src/workflows/runner.rs:327— engine/packages/pegboard/src/workflows/runner.rs:327-345 | engine/packages/pegboard/src/workflows/runner2.rs:138-156 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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) engine/packages/pegboard-gateway/src/metrics_task.rs:63— engine/packages/pegboard-gateway/src/metrics_task.rs:63-81 | engine/packages/pegboard-gateway2/src/metrics_task.rs:63-81 — before extracting anything, compare `engine/packages/pegboard-gateway/src/metrics_task.rs` and `engine/packages/pegboard-gateway2/src/metrics_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:248— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:248-266 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:316-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 (19 lines × 2) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:613— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:613-631 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:679-697 — both copies are in the same file, so extract the block into 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 × 3) engine/packages/depot/src/compaction/shared.rs:3550— engine/packages/depot/src/compaction/shared.rs:3550-3559 | engine/packages/depot/src/compaction/shared.rs:3579-3588 | engine/packages/depot/src/compaction/shared.rs:3644-3653 — 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) engine/packages/depot/src/conveyer/restore_point/resolve.rs:169— engine/packages/depot/src/conveyer/restore_point/resolve.rs:169-178 | engine/packages/depot/src/conveyer/restore_point/resolve.rs:329-338 | engine/packages/depot/src/conveyer/restore_point/resolve.rs:388-397 — 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) engine/packages/error-macros/src/lib.rs:76— engine/packages/error-macros/src/lib.rs:76-85 | engine/packages/error-macros/src/lib.rs:176-185 | engine/packages/error-macros/src/lib.rs:209-218 — 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) engine/packages/pegboard/src/ops/actor/get_reservation_for_key.rs:47— engine/packages/pegboard/src/ops/actor/get_reservation_for_key.rs:47-56 | engine/packages/pegboard/src/workflows/actor/keys.rs:161-170 | engine/packages/pegboard/src/workflows/actor2/keys.rs:174-183 — `engine/packages/pegboard/src/workflows/actor/keys.rs` and `engine/packages/pegboard/src/workflows/actor2/keys.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 3) engine/packages/pegboard-envoy/src/tunnel_to_ws_task.rs:80— engine/packages/pegboard-envoy/src/tunnel_to_ws_task.rs:80-89 | engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:65-74 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:106-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:583— engine/packages/pegboard-gateway/src/lib.rs:583-592 | engine/packages/pegboard-gateway2/src/lib.rs:855-864 | engine/packages/pegboard-gateway3/src/lib.rs:604-613 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (10 lines × 3) engine/packages/pegboard-gateway/src/shared_state.rs:628— engine/packages/pegboard-gateway/src/shared_state.rs:628-637 | engine/packages/pegboard-gateway2/src/shared_state.rs:501-510 | engine/packages/pegboard-gateway3/src/shared_state.rs:558-567 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (10 lines × 3) engine/packages/gasoline-macros/src/lib.rs:64— engine/packages/gasoline-macros/src/lib.rs:64-73 | engine/packages/gasoline-macros/src/lib.rs:132-141 | engine/packages/gasoline-macros/src/lib.rs:202-211 — 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.
AC2 · Forms & labels· <Combobox> field component without a label · ×7
<Combobox> field component without a label frontend/src/app/dialogs/edit-runner-config.tsx:822— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Combobox> field component without a label frontend/src/app/metrics/namespace-filter-combobox.tsx:29— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Combobox> field component without a label frontend/src/components/actors/all-runner-select.tsx:131— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Combobox> field component without a label frontend/src/components/actors/build-select.tsx:27— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Combobox> field component without a label frontend/src/components/actors/form/build-tags-form.tsx:90— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Combobox> field component without a label frontend/src/components/actors/form/build-tags-form.tsx:119— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Combobox> field component without a label frontend/src/components/actors/runner-select.tsx:63— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
rivet_envoy_client::envoy::envoy_loop (cyclomatic 36) engine/sdks/rust/envoy-client/src/envoy.rs:448— rivet_envoy_client::envoy::envoy_loop 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.
rivet_envoy_client::actor::actor_inner (cyclomatic 35) engine/sdks/rust/envoy-client/src/actor.rs:164— rivet_envoy_client::actor::actor_inner 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.
rivet_envoy_client::actor::http::send_response (cyclomatic 23) engine/sdks/rust/envoy-client/src/actor/http.rs:719— rivet_envoy_client::actor::http::send_response 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.
rivet_envoy_client::connection::wasm::imp::single_connection (cyclomatic 22) engine/sdks/rust/envoy-client/src/connection/wasm.rs:102— rivet_envoy_client::connection::wasm::imp::single_connection 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.
rivet_envoy_client::tunnel::handle_tunnel_message (cyclomatic 19) engine/sdks/rust/envoy-client/src/tunnel.rs:93— rivet_envoy_client::tunnel::handle_tunnel_message 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.
rivet_envoy_client::connection::native::single_connection (cyclomatic 19) engine/sdks/rust/envoy-client/src/connection/native.rs:96— rivet_envoy_client::connection::native::single_connection 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.
rivet_envoy_client::actor::http::handle_req_chunk (cyclomatic 16) engine/sdks/rust/envoy-client/src/actor/http.rs:446— rivet_envoy_client::actor::http::handle_req_chunk 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.
rivetkit_core::actor::actor_runtime_socket::serve_connection (cognitive 41) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:375— rivetkit_core::actor::actor_runtime_socket::serve_connection has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 8 (15 pts), loops 6 (10 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.
rivetkit_core::actor::actor_runtime_socket::execute_request (cognitive 23) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:673— rivetkit_core::actor::actor_runtime_socket::execute_request has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 9 (15 pts), if/else 3 (7 pts), boolean chains 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.
rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner (cognitive 23) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:44— rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 6 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 6). 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.
rivetkit_core::actor::internal_storage::clear_table_bounded (cognitive 21) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1227— rivetkit_core::actor::internal_storage::clear_table_bounded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (6 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.
rivetkit_core::actor::actor_runtime_socket::serve_listener (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:293— rivetkit_core::actor::actor_runtime_socket::serve_listener has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_core::registry::envoy_callbacks::deserialize_actor_key_from_protocol (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/registry/envoy_callbacks.rs:322— rivetkit_core::registry::envoy_callbacks::deserialize_actor_key_from_protocol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_core::registry::actor_connect::encode_actor_connect_message_cbor_manual (cognitive 19) rivetkit-rust/packages/rivetkit-core/src/registry/actor_connect.rs:294— rivetkit_core::registry::actor_connect::encode_actor_connect_message_cbor_manual has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×7
Duplicated block (20 lines × 2) engine/packages/api-public/src/envoys.rs:49— engine/packages/api-public/src/envoys.rs:49-68 | engine/packages/api-public/src/runners.rs:50-69 — 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 (20 lines × 2) engine/packages/config/src/lib.rs:294— engine/packages/config/src/lib.rs:294-313 | engine/packages/config/src/lib.rs:319-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) engine/packages/depot/src/conveyer/restore_point/resolve.rs:322— engine/packages/depot/src/conveyer/restore_point/resolve.rs:322-341 | engine/packages/depot/src/conveyer/restore_point/resolve.rs:381-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) engine/packages/gasoline/src/db/kv/repair.rs:1559— engine/packages/gasoline/src/db/kv/repair.rs:1559-1578 | engine/packages/gasoline/src/db/kv/repair.rs:1790-1809 — both copies are in the same file, so extract the block into 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) engine/packages/logs/src/unix.rs:181— engine/packages/logs/src/unix.rs:181-200 | engine/packages/logs/src/windows.rs:220-239 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 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 (20 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:1107— engine/packages/pegboard-gateway2/src/lib.rs:1107-1126 | engine/packages/pegboard-gateway3/src/lib.rs:813-832 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (20 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:601— engine/packages/pegboard-gateway2/src/shared_state.rs:601-620 | engine/packages/pegboard-gateway3/src/shared_state.rs:827-846 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (18 lines × 2) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:593— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:593-610 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:112-129 — before extracting anything, compare `engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs` and `engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:445— engine/packages/pegboard-gateway2/src/lib.rs:445-462 | engine/packages/pegboard-gateway3/src/lib.rs:189-206 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (18 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:857— engine/packages/pegboard-gateway2/src/lib.rs:857-874 | engine/packages/pegboard-gateway3/src/lib.rs:606-623 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (18 lines × 2) engine/packages/runner-protocol/src/versioned.rs:1609— engine/packages/runner-protocol/src/versioned.rs:1609-1626 | engine/packages/runner-protocol/src/versioned.rs:1750-1767 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/client/src/handle.rs:99— rivetkit-rust/packages/client/src/handle.rs:99-116 | rivetkit-rust/packages/client/src/handle.rs:159-176 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:401— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:401-418 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:493-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 (18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:269— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:269-286 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:407-424 — both copies are in the same file, so extract the block into 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 × 3) engine/packages/gasoline/src/db/kv/keys/history.rs:24— engine/packages/gasoline/src/db/kv/keys/history.rs:24-38 | engine/packages/gasoline/src/db/kv/keys/history.rs:1598-1612 | engine/packages/gasoline/src/db/kv/keys/history.rs:1672-1686 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:563— engine/packages/pegboard-gateway/src/lib.rs:563-577 | engine/packages/pegboard-gateway2/src/lib.rs:835-849 | engine/packages/pegboard-gateway3/src/lib.rs:584-598 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 × 3) engine/packages/pegboard-gateway/src/lib.rs:618— engine/packages/pegboard-gateway/src/lib.rs:618-632 | engine/packages/pegboard-gateway2/src/lib.rs:910-924 | engine/packages/pegboard-gateway3/src/lib.rs:659-673 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 × 3) engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:38— engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:38-52 | engine/packages/pegboard-gateway2/src/hibernation_task.rs:62-76 | engine/packages/pegboard-gateway3/src/hibernation_task.rs:62-76 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/hibernation_task.rs` and `engine/packages/pegboard-gateway3/src/hibernation_task.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 139 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 × 3) engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:93— engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:93-107 | engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:106-120 | engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs:106-120 — before extracting anything, compare `engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs` and `engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 × 3) engine/packages/pegboard-gateway2/src/lib.rs:759— engine/packages/pegboard-gateway2/src/lib.rs:759-773 | engine/packages/pegboard-gateway3/src/lib.rs:508-522 | engine/packages/pegboard-runner/src/lib.rs:177-191 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 × 3) engine/sdks/rust/envoy-client/src/actor.rs:670— engine/sdks/rust/envoy-client/src/actor.rs:670-684 | engine/sdks/rust/envoy-client/src/actor.rs:786-800 | engine/sdks/rust/envoy-client/src/actor.rs:1040-1056 — 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) engine/packages/depot/src/inspect.rs:884— engine/packages/depot/src/inspect.rs:884-894 | engine/packages/depot/src/inspect.rs:979-989 | engine/packages/depot/src/inspect.rs:1068-1078 — 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) engine/packages/epoxy/src/replica/commit_kv.rs:38— engine/packages/epoxy/src/replica/commit_kv.rs:38-48 | engine/packages/epoxy/src/replica/messages/accept.rs:29-39 | engine/packages/epoxy/src/replica/messages/prepare.rs:28-38 — before extracting anything, compare `engine/packages/epoxy/src/replica/messages/accept.rs` and `engine/packages/epoxy/src/replica/messages/prepare.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) engine/packages/gasoline/src/db/kv/keys/history.rs:1864— engine/packages/gasoline/src/db/kv/keys/history.rs:1864-1874 | engine/packages/gasoline/src/db/kv/keys/history.rs:1977-1987 | engine/packages/gasoline/src/db/kv/keys/history.rs:2054-2064 — 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) engine/packages/pegboard-gateway/src/ping_task.rs:16— engine/packages/pegboard-gateway/src/ping_task.rs:16-26 | engine/packages/pegboard-gateway2/src/ping_task.rs:15-25 | engine/packages/pegboard-gateway3/src/ping_task.rs:15-25 — 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 (11 lines × 3) engine/packages/pegboard-gateway2/src/shared_state.rs:679— engine/packages/pegboard-gateway2/src/shared_state.rs:679-689 | engine/packages/pegboard-gateway3/src/shared_state.rs:929-939 | engine/packages/pegboard-gateway3/src/shared_state.rs:1323-1333 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 × 3) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1513— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1513-1523 | engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1526-1536 | engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:1548-1558 — 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.
Low cohesion: SharedState (LCOM4 11) engine/packages/pegboard-gateway/src/shared_state.rs:140— SharedState's methods fall into 11 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 11 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: SharedState (LCOM4 6) engine/packages/pegboard-gateway2/src/shared_state.rs:195— SharedState's methods fall into 6 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 6 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: SharedState (LCOM4 6) engine/packages/pegboard-gateway3/src/shared_state.rs:202— SharedState's methods fall into 6 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 6 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: DefaultTestCallbacks (LCOM4 6) engine/sdks/rust/test-envoy/src/behaviors/default.rs:13— DefaultTestCallbacks's methods fall into 6 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 6 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: Runtime (LCOM4 5) engine/packages/config/src/config/runtime.rs:10— Runtime'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: CoreRegistry (LCOM4 4) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:128— CoreRegistry'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.
epoxy::ops::kv::get::linearizable::read (cognitive 46) engine/packages/epoxy/src/ops/kv/get/linearizable.rs:21— epoxy::ops::kv::get::linearizable::read has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 27). 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.
epoxy::ops::propose::send_prepare_round (cognitive 25) engine/packages/epoxy/src/ops/propose.rs:781— epoxy::ops::propose::send_prepare_round has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (5 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.
epoxy::workflows::backfill::backfill_chunk (cognitive 22) engine/packages/epoxy/src/workflows/backfill.rs:86— epoxy::workflows::backfill::backfill_chunk has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, 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.
epoxy::replica::messages::accept::accept (cognitive 21) engine/packages/epoxy/src/replica/messages/accept.rs:11— epoxy::replica::messages::accept::accept has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
epoxy::ops::propose::epoxy_propose (cognitive 20) engine/packages/epoxy/src/ops/propose.rs:321— epoxy::ops::propose::epoxy_propose has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 2 (3 pts), loops 1 (nesting depth added 11). 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.
pegboard_gateway3::http_stream::response::drain_http_response_stream (cognitive 40) engine/packages/pegboard-gateway3/src/http_stream/response.rs:222— pegboard_gateway3::http_stream::response::drain_http_response_stream has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway3::http_stream::request::send_streaming_http_request_body_chunks (cognitive 37) engine/packages/pegboard-gateway3/src/http_stream/request.rs:80— pegboard_gateway3::http_stream::request::send_streaming_http_request_body_chunks has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 4 (10 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway3::tunnel_to_ws_task::task (cognitive 28) engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs:22— pegboard_gateway3::tunnel_to_ws_task::task has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway3::hibernation_task::task (cognitive 23) engine/packages/pegboard-gateway3/src/hibernation_task.rs:24— pegboard_gateway3::hibernation_task::task has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (9 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.
pegboard_gateway3::http_stream::response::send_http_response_body_bytes (cognitive 21) engine/packages/pegboard-gateway3/src/http_stream/response.rs:90— pegboard_gateway3::http_stream::response::send_http_response_body_bytes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (5 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.
TooManyFields: ActorContextInner rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:81— TooManyFields — 86 stored fields. The bar is 30 stored fields; this is 56 over it, 2.87× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ActorMetricCollectors rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:170— TooManyFields — 46 stored fields beside 1 method. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: GetPagesDebug engine/packages/depot/src/conveyer/read.rs:1245— TooManyFields — 42 stored fields beside 3 methods. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: JsActorConfig rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:104— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WasmActorConfig rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:200— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (27 lines × 2) engine/packages/pegboard/src/workflows/actor/metrics.rs:286— engine/packages/pegboard/src/workflows/actor/metrics.rs:286-312 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:279-305 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (27 lines × 2) engine/packages/pegboard-gateway/src/lib.rs:643— engine/packages/pegboard-gateway/src/lib.rs:643-669 | engine/packages/pegboard-gateway2/src/lib.rs:952-978 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (27 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:627— engine/packages/pegboard-gateway2/src/shared_state.rs:627-653 | engine/packages/pegboard-gateway3/src/shared_state.rs:876-902 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (27 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:1084— engine/packages/pegboard-gateway2/src/shared_state.rs:1084-1110 | engine/packages/pegboard-gateway3/src/shared_state.rs:1554-1580 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (27 lines × 2) engine/sdks/rust/envoy-client/src/connection/native.rs:41— engine/sdks/rust/envoy-client/src/connection/native.rs:41-67 | engine/sdks/rust/envoy-client/src/connection/wasm.rs:47-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (25 lines × 2) engine/packages/engine/src/util/wf/mod.rs:350— engine/packages/engine/src/util/wf/mod.rs:350-374 | engine/packages/engine/src/util/wf/mod.rs:390-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.
Duplicated block (25 lines × 2) engine/packages/logs/src/unix.rs:38— engine/packages/logs/src/unix.rs:38-62 | engine/packages/logs/src/windows.rs:48-72 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 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 (25 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:772— engine/packages/pegboard-gateway2/src/shared_state.rs:772-796 | engine/packages/pegboard-gateway3/src/shared_state.rs:1173-1197 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (25 lines × 2) engine/packages/util/src/throttle.rs:190— engine/packages/util/src/throttle.rs:190-214 | engine/packages/util/src/throttle.rs:250-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:81— rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:81-105 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3213-3237 — 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 (24 lines × 2) engine/packages/depot-client/src/query.rs:143— engine/packages/depot-client/src/query.rs:143-166 | engine/packages/depot-client/src/query.rs:224-247 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/ops/actor/get.rs:46— engine/packages/pegboard/src/ops/actor/get.rs:46-69 | engine/packages/pegboard/src/ops/actor/list_for_ns.rs:193-216 — 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 (24 lines × 2) engine/packages/pegboard/src/workflows/actor/metrics.rs:105— engine/packages/pegboard/src/workflows/actor/metrics.rs:105-128 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:104-127 — `engine/packages/pegboard/src/workflows/actor/metrics.rs` and `engine/packages/pegboard/src/workflows/actor2/metrics.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) engine/packages/pegboard-gateway2/src/hibernation_task.rs:34— engine/packages/pegboard-gateway2/src/hibernation_task.rs:34-57 | engine/packages/pegboard-gateway3/src/hibernation_task.rs:34-57 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/hibernation_task.rs` and `engine/packages/pegboard-gateway3/src/hibernation_task.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 139 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 (24 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:180— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:180-203 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:301-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 3) engine/packages/depot/src/compaction/shared.rs:3493— engine/packages/depot/src/compaction/shared.rs:3493-3499 | engine/packages/depot/src/doctor.rs:3410-3416 | engine/packages/depot/src/inspect.rs:1424-1430 — 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) engine/packages/depot/src/workflows/db_reclaimer.rs:323— engine/packages/depot/src/workflows/db_reclaimer.rs:323-329 | engine/packages/depot/src/workflows/db_reclaimer.rs:882-888 | engine/packages/depot/src/workflows/db_reclaimer.rs:1198-1205 — 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) engine/packages/gasoline/src/db/kv/keys/worker.rs:131— engine/packages/gasoline/src/db/kv/keys/worker.rs:131-137 | engine/packages/pegboard/src/keys/actor.rs:719-725 | engine/packages/pegboard/src/keys/runner.rs:544-551 — before extracting anything, compare `engine/packages/pegboard/src/keys/actor.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 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) engine/packages/gasoline/src/db/mod.rs:354— engine/packages/gasoline/src/db/mod.rs:354-360 | engine/packages/gasoline/src/history/event.rs:133-139 | engine/packages/gasoline/src/history/event.rs:173-179 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) engine/packages/service-manager/src/lib.rs:166— engine/packages/service-manager/src/lib.rs:166-172 | engine/packages/service-manager/src/lib.rs:209-215 | engine/packages/service-manager/src/lib.rs:251-257 — 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) engine/packages/bootstrap/src/lib.rs:6— engine/packages/bootstrap/src/lib.rs:6-11 | engine/packages/guard/src/lib.rs:13-18 | engine/packages/pegboard-outbound/src/lib.rs:29-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) engine/sdks/rust/epoxy-protocol/src/convert.rs:122— engine/sdks/rust/epoxy-protocol/src/convert.rs:122-127 | engine/sdks/rust/epoxy-protocol/src/convert.rs:171-176 | engine/sdks/rust/epoxy-protocol/src/convert.rs:214-219 — 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) engine/sdks/rust/epoxy-protocol/src/convert.rs:517— engine/sdks/rust/epoxy-protocol/src/convert.rs:517-522 | engine/sdks/rust/epoxy-protocol/src/convert.rs:566-571 | engine/sdks/rust/epoxy-protocol/src/convert.rs:609-614 — 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) rivetkit-rust/packages/rivetkit/src/action.rs:46— rivetkit-rust/packages/rivetkit/src/action.rs:46-51 | rivetkit-rust/packages/rivetkit/src/context.rs:715-720 | rivetkit-rust/packages/rivetkit/src/queue.rs:349-354 — 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 (6 lines × 3) engine/packages/api-public/src/datacenters.rs:23— engine/packages/api-public/src/datacenters.rs:23-28 | engine/packages/api-public/src/health.rs:52-57 | engine/packages/api-public/src/metadata.rs:35-40 — 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.
Outbound HTTP without resilience container-runner/src/proxy.rs:34— `reqwest::Client::new(` 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. 5 of the 11 files that make outbound calls are unbounded; the first 5 are listed.
Outbound HTTP without resilience engine/packages/cli/src/cloud.rs:134— `reqwest::Client::new(` 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 engine/packages/pools/src/db/clickhouse.rs:34— `hyper_util::client::legacy::Client::builder(` 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 rivetkit-rust/packages/client/src/remote_manager.rs:140— `reqwest::Client::new(` 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 rivetkit-typescript/packages/mcp-hub/src/index.ts:78— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
No assertions: delivery failures retry with backoff then succeed integrations/workflow-world/tests/integration/dispatcher-loop.test.ts:75— 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: long-step {timeoutSeconds} response defers redelivery instead of acking integrations/workflow-world/tests/integration/dispatcher-loop.test.ts:111— 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: preserves nested handler context and client action types rivetkit-typescript/packages/rivetkit/tests/nested-actions.test.ts:15— 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: preserves default database context and actions on base definitions rivetkit-typescript/packages/rivetkit/tests/nested-actions.test.ts:37— 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.
rivet_engine::util::wf::print_history (cognitive 99) engine/packages/engine/src/util/wf/mod.rs:130— rivet_engine::util::wf::print_history has cognitive complexity 99 (threshold 15). Drivers by points: if/else 34 (86 pts), loops 3 (8 pts), match/switch 2 (5 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.
rivet_engine::commands::udb::cli::render_list_entry (cognitive 36) engine/packages/engine/src/commands/udb/cli.rs:1134— rivet_engine::commands::udb::cli::render_list_entry has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 3 (10 pts), boolean chains 1 (nesting depth added 21). 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.
rivet_engine::commands::wf::repair::execute (cognitive 30) engine/packages/engine/src/commands/wf/repair.rs:19— rivet_engine::commands::wf::repair::execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, loops 4 (5 pts), match/switch 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_engine::util::wf::print_workflows (cognitive 20) engine/packages/engine/src/util/wf/mod.rs:38— rivet_engine::util::wf::print_workflows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegistryDispatcher::handle_actor_connect_websocket (cognitive 46) rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:93— RegistryDispatcher::handle_actor_connect_websocket has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (27 pts), match/switch 9 (15 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegistryDispatcher::handle_inspector_fetch (cognitive 42) rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:22— RegistryDispatcher::handle_inspector_fetch has cognitive complexity 42 (threshold 15). Drivers by points: match/switch 16 (25 pts), if/else 11 (16 pts), boolean chains 1 (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.
RegistryDispatcher::handle_inspector_websocket (cognitive 22) rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs:166— RegistryDispatcher::handle_inspector_websocket has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 5 (8 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.
RegistryDispatcher::active_actor (cognitive 18) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:1050— RegistryDispatcher::active_actor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorContext::teardown_sleep_state (cognitive 38) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:775— ActorContext::teardown_sleep_state has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 6 (11 pts), boolean chains 3 (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.
ActorContext::prepare_state_deltas (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1347— ActorContext::prepare_state_deltas has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 pts), loops 4, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorContext::take_due_schedule_dispatches (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:593— ActorContext::take_due_schedule_dispatches has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorContext::apply_state_deltas_inner (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:585— ActorContext::apply_state_deltas_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Duplicated block (14 lines × 4) engine/packages/logs/src/unix.rs:65— engine/packages/logs/src/unix.rs:65-78 | engine/packages/logs/src/unix.rs:152-165 | engine/packages/logs/src/windows.rs:75-88 | engine/packages/logs/src/windows.rs:176-189 — before extracting anything, compare `engine/packages/logs/src/unix.rs` and `engine/packages/logs/src/windows.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 126 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 × 4) engine/packages/pegboard-gateway2/src/shared_state.rs:780— engine/packages/pegboard-gateway2/src/shared_state.rs:780-793 | engine/packages/pegboard-gateway2/src/shared_state.rs:815-828 | engine/packages/pegboard-gateway3/src/shared_state.rs:1181-1194 | engine/packages/pegboard-gateway3/src/shared_state.rs:1234-1247 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (14 lines × 4) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:557— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:557-570 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:620-633 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:689-702 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:757-770 — 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 (14 lines × 4) engine/packages/gasoline/src/builder/common/signal.rs:76— engine/packages/gasoline/src/builder/common/signal.rs:76-89 | engine/packages/gasoline/src/builder/common/workflow.rs:64-77 | engine/packages/gasoline/src/builder/workflow/signal.rs:64-77 | engine/packages/gasoline/src/builder/workflow/sub_workflow.rs:49-62 — `engine/packages/gasoline/src/builder/common/signal.rs` and `engine/packages/gasoline/src/builder/workflow/signal.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12–13 lines × 2) engine/packages/depot-client/src/query.rs:100— engine/packages/depot-client/src/query.rs:100-112 | engine/packages/depot-client/src/query.rs:172-183 — both copies are in the same file, so extract the block into 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) engine/packages/engine/src/commands/wf/repair.rs:217— engine/packages/engine/src/commands/wf/repair.rs:217-229 | engine/packages/engine/src/commands/wf/repair.rs:293-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) engine/packages/error-macros/src/lib.rs:516— engine/packages/error-macros/src/lib.rs:516-527 | engine/packages/error-macros/src/lib.rs:553-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 (12–13 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:244— rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:244-256 | rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:290-301 — both copies are in the same file, so extract the block into 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 × 3) engine/packages/cli/src/commands/logs.rs:56— engine/packages/cli/src/commands/logs.rs:56-64 | engine/packages/cli/src/commands/pool.rs:97-105 | engine/packages/cli/src/commands/pool.rs:137-145 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) engine/packages/gasoline/src/db/kv/keys/history.rs:1994— engine/packages/gasoline/src/db/kv/keys/history.rs:1994-2002 | engine/packages/gasoline/src/db/kv/keys/history.rs:2111-2119 | engine/packages/gasoline/src/db/kv/keys/history.rs:2156-2164 — 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) engine/sdks/rust/envoy-client/src/connection/wasm.rs:351— engine/sdks/rust/envoy-client/src/connection/wasm.rs:351-359 | engine/sdks/rust/envoy-client/src/utils.rs:105-113 | rivetkit-rust/packages/rivetkit-core/src/lib.rs:76-84 — 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 (9 lines × 3) engine/packages/pegboard-gateway/src/shared_state.rs:169— engine/packages/pegboard-gateway/src/shared_state.rs:169-177 | engine/packages/pegboard-gateway2/src/shared_state.rs:226-234 | engine/packages/pegboard-gateway3/src/shared_state.rs:239-247 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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) engine/packages/gasoline/src/db/kv/keys/history.rs:1825— engine/packages/gasoline/src/db/kv/keys/history.rs:1825-1832 | engine/packages/gasoline/src/db/kv/keys/history.rs:1945-1952 | engine/packages/gasoline/src/db/kv/keys/history.rs:2063-2070 — 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) engine/packages/pegboard/src/keys/ns.rs:145— engine/packages/pegboard/src/keys/ns.rs:145-152 | engine/packages/pegboard/src/keys/ns.rs:266-273 | engine/packages/pegboard/src/keys/ns.rs:1675-1682 — 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) engine/packages/pegboard/src/workflows/actor/runtime.rs:258— engine/packages/pegboard/src/workflows/actor/runtime.rs:258-265 | engine/packages/pegboard/src/workflows/actor2/runtime.rs:193-200 | engine/packages/pegboard/src/workflows/actor2/runtime.rs:875-882 — `engine/packages/pegboard/src/workflows/actor/runtime.rs` and `engine/packages/pegboard/src/workflows/actor2/runtime.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:938— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:938-945 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1381-1388 | rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:77-84 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) engine/packages/gasoline/src/db/kv/keys/history.rs:1868— engine/packages/gasoline/src/db/kv/keys/history.rs:1868-1874 | engine/packages/gasoline/src/db/kv/keys/history.rs:1981-1987 | engine/packages/gasoline/src/db/kv/keys/history.rs:2058-2064 | engine/packages/gasoline/src/db/kv/keys/history.rs:2099-2105 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) engine/packages/universaldb/src/driver/postgres/transaction.rs:224— engine/packages/universaldb/src/driver/postgres/transaction.rs:224-230 | engine/packages/universaldb/src/driver/postgres/transaction.rs:316-322 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:248-254 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:340-346 — `engine/packages/universaldb/src/driver/postgres/transaction.rs` and `engine/packages/universaldb/src/driver/rocksdb/transaction.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 4) engine/packages/gasoline/src/ctx/activity.rs:160— engine/packages/gasoline/src/ctx/activity.rs:160-166 | engine/packages/gasoline/src/ctx/operation.rs:155-161 | engine/packages/gasoline/src/ctx/standalone.rs:210-216 | engine/packages/gasoline/src/ctx/test.rs:225-231 — before extracting anything, compare `engine/packages/gasoline/src/ctx/operation.rs` and `engine/packages/gasoline/src/ctx/standalone.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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 × 4) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:634— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:634-640 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:651-657 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:669-675 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:688-694 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:634` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) engine/packages/pegboard/src/workflows/actor2/mod.rs:976— engine/packages/pegboard/src/workflows/actor2/mod.rs:976-980 | engine/packages/pegboard/src/workflows/actor2/mod.rs:1043-1047 | engine/packages/pegboard/src/workflows/actor2/mod.rs:1099-1103 — 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) engine/packages/pegboard-gateway/src/lib.rs:593— engine/packages/pegboard-gateway/src/lib.rs:593-597 | engine/packages/pegboard-gateway2/src/lib.rs:870-874 | engine/packages/pegboard-gateway3/src/lib.rs:619-623 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 × 3) engine/packages/pegboard-gateway/src/metrics_task.rs:63— engine/packages/pegboard-gateway/src/metrics_task.rs:63-67 | engine/packages/pegboard-gateway2/src/metrics_task.rs:63-67 | engine/packages/pegboard-gateway3/src/metrics_task.rs:55-59 — before extracting anything, compare `engine/packages/pegboard-gateway/src/metrics_task.rs` and `engine/packages/pegboard-gateway2/src/metrics_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) engine/packages/pegboard-gateway2/src/lib.rs:364— engine/packages/pegboard-gateway2/src/lib.rs:364-369 | engine/packages/pegboard-gateway3/src/http_stream/handler.rs:85-89 | engine/packages/pegboard-gateway3/src/lib.rs:137-142 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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.
ProxyService::handle_websocket_upgrade (cyclomatic 75) engine/packages/guard-core/src/proxy_service.rs:1113— ProxyService::handle_websocket_upgrade has cyclomatic complexity 75 (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.
ProxyService::process (cyclomatic 26) engine/packages/guard-core/src/proxy_service.rs:376— ProxyService::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.
ProxyService::handle_http_request (cyclomatic 19) engine/packages/guard-core/src/proxy_service.rs:833— ProxyService::handle_http_request 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.
RegistryDispatcher::handle_inspector_fetch (cyclomatic 42) rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:22— RegistryDispatcher::handle_inspector_fetch has cyclomatic complexity 42 (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.
RegistryDispatcher::handle_actor_connect_websocket (cyclomatic 29) rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:93— RegistryDispatcher::handle_actor_connect_websocket 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.
RegistryDispatcher::handle_inspector_websocket (cyclomatic 18) rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs:166— RegistryDispatcher::handle_inspector_websocket 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. This is NOT this file's highest cyclomatic complexity: rivetkit_core::registry::inspector_ws::server_message_kind (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.
rivetkit_core::actor::actor_runtime_socket::serve_connection (cyclomatic 28) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:375— rivetkit_core::actor::actor_runtime_socket::serve_connection has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner (cyclomatic 20) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:44— rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rivetkit_core::actor::actor_runtime_socket::execute_request (cyclomatic 19) rivetkit-rust/packages/rivetkit-core/src/actor/actor_runtime_socket.rs:673— rivetkit_core::actor::actor_runtime_socket::execute_request 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.
Repeated repair: engine/packages/universaldb/src/driver/postgres/transaction_task.rs engine/packages/universaldb/src/driver/postgres/transaction_task.rs:77— engine/packages/universaldb/src/driver/postgres/transaction_task.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is TransactionTask::run at line 77), 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(universaldb): run postgres transaction reads concurrently”; “fix(universaldb): restore commit connection release and reserved leader pool”; “fix(universaldb): stop postgres commits from starving the connection pool”. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/universaldb/src/driver/postgres/transaction_task.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: rivetkit-typescript/packages/rivetkit/src/registry/native-http.ts rivetkit-typescript/packages/rivetkit/src/registry/native-http.ts:45— rivetkit-typescript/packages/rivetkit/src/registry/native-http.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 13 (its worst body is native-http.buildNativeHttpRequest at line 45), 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: “revert(http): return main to Envoy protocol v6 (#5515)”; “revert(http): remove streaming lifecycle hardening”; “fix(http): harden streaming lifecycle and observability (#5471)”. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit/src/registry/native-http.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: engine/packages/pegboard-gateway2/src/metrics_task.rs engine/packages/pegboard-gateway2/src/metrics_task.rs:10— engine/packages/pegboard-gateway2/src/metrics_task.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is pegboard_gateway2::metrics_task::task at line 10), 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: “revert(http): return main to Envoy protocol v6 (#5515)”; “revert(http): remove streaming lifecycle hardening”; “fix(http): harden streaming lifecycle and observability (#5471)”. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 04:27:49 -07:00' --until='2026-09-29 04:27:49 -07:00' --full-history --no-merges -- engine/packages/pegboard-gateway2/src/metrics_task.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.
ProxyService::handle_websocket_upgrade (cognitive 181) engine/packages/guard-core/src/proxy_service.rs:1113— ProxyService::handle_websocket_upgrade has cognitive complexity 181 (threshold 15). Drivers by points: match/switch 33 (103 pts), if/else 24 (68 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 118). 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.
ProxyService::handle_http_request (cognitive 54) engine/packages/guard-core/src/proxy_service.rs:833— ProxyService::handle_http_request has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (35 pts), match/switch 4 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 35). 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.
ProxyService::process (cognitive 46) engine/packages/guard-core/src/proxy_service.rs:376— ProxyService::process has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (35 pts), match/switch 3 (8 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_wasm::dispatch_event (cognitive 63) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:722— rivetkit_wasm::dispatch_event has cognitive complexity 63 (threshold 15). Drivers by points: if/else 29 (55 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rivetkit_wasm::start_wasm_serverless_request (cognitive 20) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2826— rivetkit_wasm::start_wasm_serverless_request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 5 (8 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.
rivetkit_wasm::run_preamble (cognitive 19) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:654— rivetkit_wasm::run_preamble has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_napi::napi_actor_events::dispatch_event (cognitive 48) rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:381— rivetkit_napi::napi_actor_events::dispatch_event has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (39 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rivetkit_napi::napi_actor_events::run_event_loop (cognitive 16) rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:185— rivetkit_napi::napi_actor_events::run_event_loop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 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.
rivetkit_napi::napi_actor_events::run_preamble (cognitive 16) rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:233— rivetkit_napi::napi_actor_events::run_preamble has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WorkflowCtx::listen_n_until (cognitive 40) engine/packages/gasoline/src/ctx/workflow.rs:929— WorkflowCtx::listen_n_until has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 5 (15 pts), loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowCtx::run (cognitive 39) engine/packages/gasoline/src/ctx/workflow.rs:158— WorkflowCtx::run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowCtx::activity (cognitive 33) engine/packages/gasoline/src/ctx/workflow.rs:564— WorkflowCtx::activity has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 2 (7 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.
rivet_guard::routing::pegboard_gateway::handle_actor_v2 (cognitive 38) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:518— rivet_guard::routing::pegboard_gateway::handle_actor_v2 has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_guard::routing::pegboard_gateway::handle_actor_v1 (cognitive 23) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:809— rivet_guard::routing::pegboard_gateway::handle_actor_v1 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (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.
rivet_guard::routing::create_routing_function (cognitive 20) engine/packages/guard/src/routing/mod.rs:185— rivet_guard::routing::create_routing_function has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 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.
universaldb::driver::postgres::resolver::drain_batch (cognitive 34) engine/packages/universaldb/src/driver/postgres/resolver/mod.rs:419— universaldb::driver::postgres::resolver::drain_batch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 3, match/switch 2 (3 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.
universaldb::driver::postgres::nats::run_commit_subscriber (cognitive 21) engine/packages/universaldb/src/driver/postgres/nats.rs:99— universaldb::driver::postgres::nats::run_commit_subscriber has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (5 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.
universaldb::driver::postgres::transaction_task::handle_get_range (cognitive 18) engine/packages/universaldb/src/driver/postgres/transaction_task.rs:264— universaldb::driver::postgres::transaction_task::handle_get_range has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
SharedState::receiver (cognitive 31) engine/packages/pegboard-gateway/src/shared_state.rs:404— SharedState::receiver has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (16 pts), match/switch 4 (12 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedState::receiver (cognitive 28) engine/packages/pegboard-gateway2/src/shared_state.rs:237— SharedState::receiver has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 4 (11 pts), loops 2 (3 pts) (nesting depth added 17). 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.
SharedState::receiver (cognitive 28) engine/packages/pegboard-gateway3/src/shared_state.rs:250— SharedState::receiver has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 4 (11 pts), loops 2 (3 pts) (nesting depth added 17). 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.
TransactionTask::handle_commit (cognitive 30) engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:270— TransactionTask::handle_commit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (7 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionTask::handle_get_range (cognitive 21) engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:399— TransactionTask::handle_get_range has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionTask::handle_get_key (cognitive 16) engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:190— TransactionTask::handle_get_key has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (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.
pegboard_envoy::ws_to_tunnel_task::dispatch_message (cognitive 27) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:685— pegboard_envoy::ws_to_tunnel_task::dispatch_message has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_envoy::ws_to_tunnel_task::task_inner (cognitive 26) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:464— pegboard_envoy::ws_to_tunnel_task::task_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 3 (9 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.
pegboard_envoy::conn::init_conn (cognitive 25) engine/packages/pegboard-envoy/src/conn.rs:90— pegboard_envoy::conn::init_conn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (4 pts), match/switch 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_depot_client::query::exec_statements (cognitive 24) engine/packages/depot-client/src/query.rs:308— rivet_depot_client::query::exec_statements has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 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. This shape REPEATS in the file: one other method here (rivet_depot_client::query::exec_statements_profiled) 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.
rivet_depot_client::query::exec_statements_profiled (cognitive 24) engine/packages/depot-client/src/query.rs:382— rivet_depot_client::query::exec_statements_profiled has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 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. This shape REPEATS in the file: one other method here (rivet_depot_client::query::exec_statements) 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.
rivet_depot_client::worker::run_command (cognitive 17) engine/packages/depot-client/src/worker.rs:546— rivet_depot_client::worker::run_command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), 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.
Change coupling: telemetry.rs ↔ telemetry.ts rivetkit-rust/packages/rivetkit-core/src/telemetry.rs— `rivetkit-rust/packages/rivetkit-core/src/telemetry.rs` and `rivetkit-typescript/packages/rivetkit/fixtures/driver-test-suite/telemetry.ts` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `237814d8` feat(rivetkit): sample traces per actor and action; `982eb970` feat(rivetkit): add tracing for workflow runs and steps; `b965bf6d` feat(rivetkit): trace actor to actor calls — run `git show` on any of them.
Change coupling: lib.rs ↔ napi-runtime.ts rivetkit-rust/packages/rivetkit-core/src/lib.rs— `rivetkit-rust/packages/rivetkit-core/src/lib.rs` and `rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `982eb970` feat(rivetkit): add tracing for workflow runs and steps; `b965bf6d` feat(rivetkit): trace actor to actor calls; `f5827354` feat(rivetkit-core): trace queue sends and receives — run `git show` on any of them.
Change coupling: actor_context.rs ↔ telemetry.ts rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs— `rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs` and `rivetkit-typescript/packages/rivetkit/fixtures/driver-test-suite/telemetry.ts` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `982eb970` feat(rivetkit): add tracing for workflow runs and steps; `b965bf6d` feat(rivetkit): trace actor to actor calls; `5e59eadf` feat(rivetkit-core): trace scheduled invocations — run `git show` on any of them.
Duplicated block (28 lines × 2) engine/packages/epoxy/src/ops/propose.rs:399— engine/packages/epoxy/src/ops/propose.rs:399-426 | engine/packages/epoxy/src/ops/propose.rs:459-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 (28 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:967— engine/packages/pegboard-gateway2/src/shared_state.rs:967-994 | engine/packages/pegboard-gateway3/src/shared_state.rs:1434-1461 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (28 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:1053— engine/packages/pegboard-gateway2/src/shared_state.rs:1053-1080 | engine/packages/pegboard-gateway3/src/shared_state.rs:1520-1547 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (20–21 lines × 2) engine/packages/pegboard-gateway/src/lib.rs:229— engine/packages/pegboard-gateway/src/lib.rs:229-248 | engine/packages/pegboard-gateway2/src/lib.rs:312-332 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (20–21 lines × 2) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:190— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:190-210 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:558-577 — both copies are in the same file, so extract the block into 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–21 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1385— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1385-1404 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1468-1488 — both copies are in the same file, so extract the block into 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) engine/packages/gasoline/src/ctx/workflow.rs:381— engine/packages/gasoline/src/ctx/workflow.rs:381-398 | engine/packages/gasoline/src/ctx/workflow.rs:420-436 — both copies are in the same file, so extract the block into 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) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:645— engine/packages/guard/src/routing/pegboard_gateway/mod.rs:645-661 | engine/packages/guard/src/routing/pegboard_gateway/mod.rs:898-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:520— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:520-536 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:577-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) engine/packages/gasoline/src/worker.rs:426— engine/packages/gasoline/src/worker.rs:426-440 | engine/packages/pegboard-outbound/src/lib.rs:58-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–16 lines × 2) engine/packages/pegboard/src/workflows/actor/keys.rs:73— engine/packages/pegboard/src/workflows/actor/keys.rs:73-88 | engine/packages/pegboard/src/workflows/actor/keys.rs:127-141 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/engine-process/src/lib.rs:667— rivetkit-rust/packages/engine-process/src/lib.rs:667-681 | rivetkit-rust/packages/engine-process/src/lib.rs:692-707 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard/src/workflows/actor2/keys.rs:69— engine/packages/pegboard/src/workflows/actor2/keys.rs:69-83 | engine/packages/pegboard/src/workflows/actor2/keys.rs:123-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.
Duplicated block (14–15 lines × 2) engine/packages/pegboard/src/workflows/actor2/runtime.rs:489— engine/packages/pegboard/src/workflows/actor2/runtime.rs:489-503 | engine/packages/pegboard/src/workflows/actor2/runtime.rs:677-690 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard-envoy/src/lib.rs:320— engine/packages/pegboard-envoy/src/lib.rs:320-334 | engine/packages/pegboard-runner/src/lib.rs:222-235 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-runner/src/lib.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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 × 3) engine/packages/gasoline/src/builder/common/signal.rs:92— engine/packages/gasoline/src/builder/common/signal.rs:92-104 | engine/packages/gasoline/src/builder/workflow/signal.rs:80-92 | engine/packages/gasoline/src/builder/workflow/sub_workflow.rs:65-77 — `engine/packages/gasoline/src/builder/common/signal.rs` and `engine/packages/gasoline/src/builder/workflow/signal.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) engine/packages/pegboard-envoy/src/tunnel_to_ws_task.rs:301— engine/packages/pegboard-envoy/src/tunnel_to_ws_task.rs:301-313 | engine/packages/pegboard-gateway2/src/shared_state.rs:69-81 | engine/packages/pegboard-gateway3/src/shared_state.rs:75-87 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 × 3) engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:64— engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:64-76 | engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:74-86 | engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs:74-86 — before extracting anything, compare `engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs` and `engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 (12 lines × 3) engine/packages/gasoline-macros/src/lib.rs:75— engine/packages/gasoline-macros/src/lib.rs:75-86 | engine/packages/gasoline-macros/src/lib.rs:143-154 | engine/packages/gasoline-macros/src/lib.rs:213-224 — 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) engine/packages/pegboard-gateway/src/shared_state.rs:146— engine/packages/pegboard-gateway/src/shared_state.rs:146-157 | engine/packages/pegboard-gateway2/src/shared_state.rs:203-214 | engine/packages/pegboard-gateway3/src/shared_state.rs:210-221 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (12 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:470— engine/packages/pegboard-gateway/src/lib.rs:470-481 | engine/packages/pegboard-gateway2/src/lib.rs:742-753 | engine/packages/pegboard-gateway3/src/lib.rs:491-502 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (10–11 lines × 3) engine/packages/guard/src/cache/pegboard_gateway.rs:45— engine/packages/guard/src/cache/pegboard_gateway.rs:45-54 | engine/packages/guard/src/routing/pegboard_gateway/mod.rs:224-233 | engine/packages/guard/src/routing/pegboard_gateway/mod.rs:988-998 — 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 (10–11 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:413— engine/packages/pegboard-gateway/src/lib.rs:413-423 | engine/packages/pegboard-gateway2/src/lib.rs:678-687 | engine/packages/pegboard-gateway3/src/lib.rs:423-432 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (10–11 lines × 3) engine/sdks/rust/envoy-client/src/tunnel.rs:278— engine/sdks/rust/envoy-client/src/tunnel.rs:278-288 | engine/sdks/rust/envoy-client/src/tunnel.rs:308-318 | engine/sdks/rust/envoy-client/src/tunnel.rs:537-546 — 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–10 lines × 2) engine/packages/api-public/src/actors/reschedule.rs:48— engine/packages/api-public/src/actors/reschedule.rs:48-57 | engine/packages/api-public/src/actors/sleep.rs:48-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 both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) engine/packages/pegboard/src/ops/runner_config/upsert.rs:244— engine/packages/pegboard/src/ops/runner_config/upsert.rs:244-252 | engine/packages/pegboard/src/ops/runner_config/upsert.rs:267-276 — both copies are in the same file, so extract the block into 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) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:989— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:989-997 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:1005-1014 — both copies are in the same file, so extract the block into 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 × 6) engine/packages/depot/src/compaction/shared.rs:3549— engine/packages/depot/src/compaction/shared.rs:3549-3556 | engine/packages/depot/src/compaction/shared.rs:3578-3585 | engine/packages/depot/src/compaction/shared.rs:3643-3650 | engine/packages/depot/src/conveyer/history_pin.rs:157-164 | engine/packages/depot/src/conveyer/pitr_interval.rs:142-149 | engine/packages/depot/src/gc/mod.rs:343-350 — before extracting anything, compare `engine/packages/depot/src/conveyer/history_pin.rs` and `engine/packages/depot/src/conveyer/pitr_interval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:455— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:455-462 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:456-463 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:515-522 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:523-530 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:627-634 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:627-634 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:1086— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:1086-1093 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:1103-1110 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:1174-1181 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:1200-1207 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:1385-1392 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:1382-1389 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) engine/packages/epoxy/src/replica/commit_kv.rs:40— engine/packages/epoxy/src/replica/commit_kv.rs:40-45 | engine/packages/epoxy/src/replica/messages/accept.rs:31-36 | engine/packages/epoxy/src/replica/messages/prepare.rs:30-35 | engine/packages/epoxy/src/replica/messages/read_state.rs:28-33 — before extracting anything, compare `engine/packages/epoxy/src/replica/messages/accept.rs` and `engine/packages/epoxy/src/replica/messages/prepare.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) engine/packages/api-public/src/actors/list.rs:45— engine/packages/api-public/src/actors/list.rs:45-50 | engine/packages/api-public/src/envoys.rs:24-29 | engine/packages/api-public/src/namespaces.rs:25-30 | engine/packages/api-public/src/runners.rs:25-30 — 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.
Duplicated block (6 lines × 4) engine/packages/depot/src/workflows/compaction_backfill.rs:273— engine/packages/depot/src/workflows/compaction_backfill.rs:273-278 | engine/packages/epoxy/src/workflows/backfill.rs:193-198 | engine/packages/gasoline-runtime/src/workflows/dead_wf_backfill.rs:91-96 | engine/packages/pegboard/src/workflows/actor_runner_name_selector_backfill.rs:88-93 — 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.
Duplicated block (14 lines × 3) engine/packages/pegboard-gateway3/src/shared_state.rs:1034— engine/packages/pegboard-gateway3/src/shared_state.rs:1034-1047 | engine/packages/pegboard-gateway3/src/shared_state.rs:1060-1073 | engine/packages/pegboard-gateway3/src/shared_state.rs:1097-1110 — 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) engine/packages/gasoline/src/db/kv/repair.rs:2550— engine/packages/gasoline/src/db/kv/repair.rs:2550-2563 | engine/packages/gasoline/src/db/kv/repair.rs:2687-2700 | engine/packages/gasoline/src/db/kv/repair.rs:2744-2757 — 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) engine/packages/test-deps-docker/src/lib.rs:93— engine/packages/test-deps-docker/src/lib.rs:93-106 | engine/packages/test-deps-docker/src/lib.rs:129-142 | engine/packages/test-deps-docker/src/lib.rs:165-178 — 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.
rivet_engine::util::wf::print_history (cyclomatic 44) engine/packages/engine/src/util/wf/mod.rs:130— rivet_engine::util::wf::print_history has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rivet_engine::commands::wf::repair::execute (cyclomatic 25) engine/packages/engine/src/commands/wf/repair.rs:19— rivet_engine::commands::wf::repair::execute has cyclomatic complexity 25 (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.
pegboard_envoy::ws_to_tunnel_task::dispatch_message (cyclomatic 29) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:685— pegboard_envoy::ws_to_tunnel_task::dispatch_message 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.
pegboard_envoy::conn::init_conn (cyclomatic 16) engine/packages/pegboard-envoy/src/conn.rs:90— pegboard_envoy::conn::init_conn 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.
pegboard_runner::ws_to_tunnel_task::handle_message_mk2 (cyclomatic 26) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:142— pegboard_runner::ws_to_tunnel_task::handle_message_mk2 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.
pegboard_runner::ws_to_tunnel_task::handle_message_mk1 (cyclomatic 22) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:501— pegboard_runner::ws_to_tunnel_task::handle_message_mk1 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.
pegboard_gateway3::http_stream::response::drain_http_response_stream (cyclomatic 23) engine/packages/pegboard-gateway3/src/http_stream/response.rs:222— pegboard_gateway3::http_stream::response::drain_http_response_stream has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pegboard_gateway3::http_stream::request::send_streaming_http_request_body_chunks (cyclomatic 18) engine/packages/pegboard-gateway3/src/http_stream/request.rs:80— pegboard_gateway3::http_stream::request::send_streaming_http_request_body_chunks 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.
SimpleTupleValue::write (cyclomatic 21) engine/packages/engine/src/util/udb.rs:225— SimpleTupleValue::write 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.
SimpleTupleValue::parse_str_with_type_hint (cyclomatic 16) engine/packages/engine/src/util/udb.rs:79— SimpleTupleValue::parse_str_with_type_hint has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: SimpleTupleValue::deserialize (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
epoxy::ops::kv::get::linearizable::read (cyclomatic 21) engine/packages/epoxy/src/ops/kv/get/linearizable.rs:21— epoxy::ops::kv::get::linearizable::read 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.
epoxy::ops::propose::epoxy_propose (cyclomatic 16) engine/packages/epoxy/src/ops/propose.rs:321— epoxy::ops::propose::epoxy_propose has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ToServerMk2::v6_to_v7 (cyclomatic 19) engine/packages/runner-protocol/src/versioned.rs:666— ToServerMk2::v6_to_v7 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. This shape REPEATS in the file: one other method here (ToServerMk2::v7_to_v6) 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.
ToServerMk2::v7_to_v6 (cyclomatic 19) engine/packages/runner-protocol/src/versioned.rs:833— ToServerMk2::v7_to_v6 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. This shape REPEATS in the file: one other method here (ToServerMk2::v6_to_v7) 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.
ActorContext::teardown_sleep_state (cyclomatic 19) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:775— ActorContext::teardown_sleep_state 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.
ActorContext::apply_state_deltas_inner (cyclomatic 16) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:585— ActorContext::apply_state_deltas_inner 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.
Runner.shutdown (cyclomatic 16) engine/sdks/typescript/runner/src/mod.ts:513— Runner.shutdown has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Runner.shutdown (cyclomatic 16) rivetkit-typescript/packages/engine-runner/src/mod.ts:513— Runner.shutdown has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Db::get_pages_with_options (cognitive 139) engine/packages/depot/src/conveyer/read.rs:70— Db::get_pages_with_options has cognitive complexity 139 (threshold 15). Drivers by points: if/else 59 (115 pts), loops 10 (12 pts), match/switch 3 (7 pts), boolean chains 5 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Db::expand_overflow_pages (cognitive 28) engine/packages/depot/src/conveyer/read.rs:1136— Db::expand_overflow_pages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (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.
InFlightRequestHandle::send_message_admitted (cognitive 104) engine/packages/pegboard-gateway3/src/shared_state.rs:821— InFlightRequestHandle::send_message_admitted has cognitive complexity 104 (threshold 15). Drivers by points: if/else 38 (89 pts), boolean chains 12, match/switch 1 (2 pts), 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.
InFlightRequestHandle::send_message (cognitive 20) engine/packages/pegboard-gateway2/src/shared_state.rs:596— InFlightRequestHandle::send_message has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 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.
PegboardGateway2::handle_websocket_inner (cognitive 48) engine/packages/pegboard-gateway2/src/lib.rs:347— PegboardGateway2::handle_websocket_inner has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 9 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PegboardGateway2::handle_request_inner (cognitive 18) engine/packages/pegboard-gateway2/src/lib.rs:119— PegboardGateway2::handle_request_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (7 pts), loops 2 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rivet_api_peer::actors::get_or_create::extract_duplicate_key_error (cognitive 32) engine/packages/api-peer/src/actors/get_or_create.rs:121— rivet_api_peer::actors::get_or_create::extract_duplicate_key_error has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 2 (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.
rivet_api_peer::runner_configs::list (cognitive 16) engine/packages/api-peer/src/runner_configs.rs:14— rivet_api_peer::runner_configs::list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorTask::run_live (cognitive 32) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:478— ActorTask::run_live has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 4 (11 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorTask::handle_dispatch (cognitive 17) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:895— ActorTask::handle_dispatch has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 1 (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.
TransactionOperations::get_key (cognitive 31) engine/packages/universaldb/src/tx_ops.rs:327— TransactionOperations::get_key has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionOperations::get_range (cognitive 23) engine/packages/universaldb/src/tx_ops.rs:452— TransactionOperations::get_range has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway2::tunnel_to_ws_task::task (cognitive 28) engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:22— pegboard_gateway2::tunnel_to_ws_task::task has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway2::hibernation_task::task (cognitive 23) engine/packages/pegboard-gateway2/src/hibernation_task.rs:24— pegboard_gateway2::hibernation_task::task has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (9 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.
pegboard_runner::ws_to_tunnel_task::handle_message_mk2 (cognitive 28) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:142— pegboard_runner::ws_to_tunnel_task::handle_message_mk2 has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 11 (19 pts), if/else 4 (7 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pegboard_runner::ws_to_tunnel_task::handle_message_mk1 (cognitive 28) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:501— pegboard_runner::ws_to_tunnel_task::handle_message_mk1 has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 11 (20 pts), if/else 5 (8 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ToServerMk2::v6_to_v7 (cognitive 23) engine/packages/runner-protocol/src/versioned.rs:666— ToServerMk2::v6_to_v7 has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (21 pts), if/else 2 (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (ToServerMk2::v7_to_v6) 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.
ToServerMk2::v7_to_v6 (cognitive 23) engine/packages/runner-protocol/src/versioned.rs:833— ToServerMk2::v7_to_v6 has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (21 pts), if/else 2 (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (ToServerMk2::v6_to_v7) 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.
SqliteDb::release_transaction (cognitive 23) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:861— SqliteDb::release_transaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, match/switch 1 (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.
SqliteDb::finish_transaction_inner (cognitive 19) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:632— SqliteDb::finish_transaction_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 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.
Worker::start (cognitive 22) engine/packages/gasoline/src/worker.rs:77— Worker::start has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (5 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.
Worker::shutdown (cognitive 16) engine/packages/gasoline/src/worker.rs:395— Worker::shutdown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (6 pts), 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.
InFlightRequest::recv_message (cognitive 22) engine/packages/pegboard-gateway3/src/shared_state.rs:2102— InFlightRequest::recv_message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 5 (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.
InFlightRequest::recv_message (cognitive 18) engine/packages/pegboard-gateway2/src/shared_state.rs:1192— InFlightRequest::recv_message has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (5 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Runner.shutdown (cognitive 22) engine/sdks/typescript/runner/src/mod.ts:513— Runner.shutdown has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 5). 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: 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.
Runner.shutdown (cognitive 22) rivetkit-typescript/packages/engine-runner/src/mod.ts:513— Runner.shutdown has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 5). 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: 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.
rivet_container_runner::proxy::ws_proxy (cognitive 16) container-runner/src/proxy.rs:84— rivet_container_runner::proxy::ws_proxy has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 1 (3 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.
rivet_container_runner::async_main (cognitive 16) container-runner/src/main.rs:383— rivet_container_runner::async_main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 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.
Near-duplicate member pair (83 shared lines) engine/packages/depot/src/workflows/db_reclaimer.rs:155— engine/packages/depot/src/workflows/db_reclaimer.rs:155-357 | engine/packages/depot/src/workflows/db_reclaimer.rs:647-947 — These two members are variants of one another: 83 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (83 shared lines) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:179— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:179-293 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:300-436 — These two members are variants of one another: 83 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) engine/packages/gasoline/src/db/kv/keys/history.rs:636— engine/packages/gasoline/src/db/kv/keys/history.rs:636-645 | engine/packages/gasoline/src/db/kv/keys/history.rs:752-761 | engine/packages/gasoline/src/db/kv/keys/history.rs:1478-1487 | engine/packages/gasoline/src/db/kv/keys/signal.rs:37-46 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:181-190 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:268-277 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:355-364 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) engine/packages/gasoline/src/db/kv/keys/history.rs:1809— engine/packages/gasoline/src/db/kv/keys/history.rs:1809-1832 | engine/packages/gasoline/src/db/kv/keys/history.rs:1846-1886 | engine/packages/gasoline/src/db/kv/keys/history.rs:1900-1952 | engine/packages/gasoline/src/db/kv/keys/history.rs:1965-2015 | engine/packages/gasoline/src/db/kv/keys/history.rs:2028-2070 | engine/packages/gasoline/src/db/kv/keys/history.rs:2083-2122 | engine/packages/gasoline/src/db/kv/keys/history.rs:2133-2167 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:29— engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:29-107 | engine/packages/pegboard-gateway2/src/hibernation_task.rs:33-128 | engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:31-120 | engine/packages/pegboard-gateway3/src/hibernation_task.rs:33-128 | engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs:31-120 — 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) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:124— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:124-144 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:170-193 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:196-219 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:222-250 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:253-282 — 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.
Duplicated block (70 lines × 2) engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:37— engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:37-106 | engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs:37-106 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs` and `engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (70 lines × 2) engine/packages/pegboard-gateway2/src/hibernation_task.rs:59— engine/packages/pegboard-gateway2/src/hibernation_task.rs:59-128 | engine/packages/pegboard-gateway3/src/hibernation_task.rs:59-128 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/hibernation_task.rs` and `engine/packages/pegboard-gateway3/src/hibernation_task.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 139 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 (46 lines × 2) engine/packages/pegboard/src/ops/actor/create.rs:121— engine/packages/pegboard/src/ops/actor/create.rs:121-166 | engine/packages/pegboard/src/ops/actor/create.rs:189-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (46 lines × 2) engine/packages/pegboard/src/workflows/runner.rs:386— engine/packages/pegboard/src/workflows/runner.rs:386-431 | engine/packages/pegboard/src/workflows/runner2.rs:233-278 — before extracting anything, compare `engine/packages/pegboard/src/workflows/runner.rs` and `engine/packages/pegboard/src/workflows/runner2.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 164 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 (42 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:1395— engine/packages/pegboard-gateway2/src/shared_state.rs:1395-1436 | engine/packages/pegboard-gateway3/src/shared_state.rs:2346-2387 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (42 lines × 2) engine/packages/test-snapshot-gen/src/lib.rs:211— engine/packages/test-snapshot-gen/src/lib.rs:211-252 | engine/packages/test-snapshot-gen/src/test_cluster.rs:117-158 — before extracting anything, compare `engine/packages/test-snapshot-gen/src/lib.rs` and `engine/packages/test-snapshot-gen/src/test_cluster.rs` as WHOLE FILES: this scan already matched 5 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 (40 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:864— engine/packages/pegboard-gateway2/src/shared_state.rs:864-903 | engine/packages/pegboard-gateway3/src/shared_state.rs:1330-1369 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (40 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:1193— engine/packages/pegboard-gateway2/src/shared_state.rs:1193-1232 | engine/packages/pegboard-gateway3/src/shared_state.rs:2112-2151 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (31 lines × 2) engine/packages/logs/src/windows.rs:82— engine/packages/logs/src/windows.rs:82-112 | engine/packages/logs/src/windows.rs:183-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 (31 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:933— engine/packages/pegboard-gateway2/src/shared_state.rs:933-963 | engine/packages/pegboard-gateway3/src/shared_state.rs:1400-1430 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (22–23 lines × 2) engine/packages/pegboard/src/workflows/actor/runtime.rs:865— engine/packages/pegboard/src/workflows/actor/runtime.rs:865-887 | engine/packages/pegboard/src/workflows/actor/runtime.rs:1000-1021 — both copies are in the same file, so extract the block into 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–23 lines × 2) engine/packages/pegboard/src/workflows/actor2/mod.rs:988— engine/packages/pegboard/src/workflows/actor2/mod.rs:988-1010 | engine/packages/pegboard/src/workflows/actor2/mod.rs:1064-1085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) engine/packages/depot-client/src/query.rs:317— engine/packages/depot-client/src/query.rs:317-338 | engine/packages/depot-client/src/query.rs:395-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:841— engine/packages/pegboard-gateway2/src/shared_state.rs:841-862 | engine/packages/pegboard-gateway3/src/shared_state.rs:1308-1329 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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–20 lines × 2) engine/packages/guard-core/src/proxy_service.rs:901— engine/packages/guard-core/src/proxy_service.rs:901-920 | engine/packages/guard-core/src/proxy_service.rs:975-991 — both copies are in the same file, so extract the block into 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–20 lines × 2) engine/packages/pegboard-envoy/src/lib.rs:251— engine/packages/pegboard-envoy/src/lib.rs:251-270 | engine/packages/pegboard-runner/src/lib.rs:167-183 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-runner/src/lib.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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–19 lines × 2) engine/packages/pegboard-envoy/src/actor_event_demuxer.rs:79— engine/packages/pegboard-envoy/src/actor_event_demuxer.rs:79-97 | engine/packages/pegboard-runner/src/actor_event_demuxer.rs:64-80 — 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–19 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1438— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1438-1456 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1459-1475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 3) engine/packages/pegboard-gateway/src/shared_state.rs:288— engine/packages/pegboard-gateway/src/shared_state.rs:288-305 | engine/packages/pegboard-gateway2/src/shared_state.rs:660-677 | engine/packages/pegboard-gateway3/src/shared_state.rs:910-927 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (18 lines × 3) engine/packages/pegboard-gateway/src/shared_state.rs:608— engine/packages/pegboard-gateway/src/shared_state.rs:608-625 | engine/packages/pegboard-gateway2/src/shared_state.rs:1032-1049 | engine/packages/pegboard-gateway3/src/shared_state.rs:1499-1516 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 × 3) engine/packages/gasoline/src/db/kv/repair.rs:829— engine/packages/gasoline/src/db/kv/repair.rs:829-845 | engine/packages/gasoline/src/db/kv/repair.rs:1563-1579 | engine/packages/gasoline/src/db/kv/repair.rs:1794-1810 — 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 (17 lines × 3) engine/packages/pegboard-gateway/src/ws_to_tunnel_task.rs:55— engine/packages/pegboard-gateway/src/ws_to_tunnel_task.rs:55-71 | engine/packages/pegboard-gateway2/src/ws_to_tunnel_task.rs:98-114 | engine/packages/pegboard-gateway3/src/ws_to_tunnel_task.rs:98-114 — 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 (16–17 lines × 2) engine/packages/pegboard/src/keys/envoy.rs:1321— engine/packages/pegboard/src/keys/envoy.rs:1321-1337 | engine/packages/pegboard/src/keys/runner.rs:1062-1077 — before extracting anything, compare `engine/packages/pegboard/src/keys/envoy.rs` and `engine/packages/pegboard/src/keys/runner.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 (16–17 lines × 2) engine/packages/pegboard/src/workflows/actor2/mod.rs:536— engine/packages/pegboard/src/workflows/actor2/mod.rs:536-552 | engine/packages/pegboard/src/workflows/actor2/mod.rs:566-581 — both copies are in the same file, so extract the block into 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 × 3) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1422— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1422-1437 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1447-1462 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1478-1493 — 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) engine/packages/gasoline/src/history/cursor.rs:250— engine/packages/gasoline/src/history/cursor.rs:250-265 | engine/packages/gasoline/src/history/cursor.rs:296-311 | engine/packages/gasoline/src/history/cursor.rs:342-357 — 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–14 lines × 2) engine/packages/depot/src/compaction/shared.rs:1777— engine/packages/depot/src/compaction/shared.rs:1777-1790 | engine/packages/depot/src/compaction/shared.rs:1999-2010 — both copies are in the same file, so extract the block into 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–14 lines × 2) rivetkit-rust/packages/client/src/remote_manager.rs:735— rivetkit-rust/packages/client/src/remote_manager.rs:735-748 | rivetkit-rust/packages/client/src/remote_manager.rs:785-796 — both copies are in the same file, so extract the block into 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 × 4) engine/packages/pegboard-gateway/src/lib.rs:485— engine/packages/pegboard-gateway/src/lib.rs:485-497 | engine/packages/pegboard-gateway2/src/lib.rs:757-769 | engine/packages/pegboard-gateway3/src/lib.rs:506-518 | engine/packages/pegboard-runner/src/lib.rs:175-187 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 × 4) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1387— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1387-1399 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1434-1446 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1455-1467 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1490-1502 — 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–13 lines × 2) engine/packages/depot-client/src/worker.rs:576— engine/packages/depot-client/src/worker.rs:576-588 | engine/packages/depot-client/src/worker.rs:633-643 — both copies are in the same file, so extract the block into 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–13 lines × 2) engine/sdks/rust/envoy-client/src/tunnel.rs:280— engine/sdks/rust/envoy-client/src/tunnel.rs:280-290 | engine/sdks/rust/envoy-client/src/tunnel.rs:310-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 4) engine/packages/depot/src/compaction/shared.rs:3543— engine/packages/depot/src/compaction/shared.rs:3543-3554 | engine/packages/depot/src/conveyer/history_pin.rs:151-162 | engine/packages/depot/src/conveyer/pitr_interval.rs:136-147 | engine/packages/depot/src/gc/mod.rs:337-348 — before extracting anything, compare `engine/packages/depot/src/conveyer/history_pin.rs` and `engine/packages/depot/src/conveyer/pitr_interval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 × 4) engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:195— engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:195-206 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:233-244 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:397-408 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:194-205 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 151 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–10 lines × 3) engine/packages/pegboard/src/workflows/actor/runtime.rs:737— engine/packages/pegboard/src/workflows/actor/runtime.rs:737-745 | engine/packages/pegboard/src/workflows/actor/runtime.rs:853-862 | engine/packages/pegboard/src/workflows/actor/runtime.rs:988-997 — 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–10 lines × 3) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:942— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:942-950 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:952-960 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1398-1407 — 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 × 4) engine/packages/pegboard-envoy/src/lib.rs:255— engine/packages/pegboard-envoy/src/lib.rs:255-263 | engine/packages/pegboard-gateway2/src/lib.rs:748-756 | engine/packages/pegboard-gateway3/src/lib.rs:497-505 | engine/packages/pegboard-runner/src/lib.rs:168-176 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (9 lines × 4) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:836— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:836-844 | engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:952-960 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:837-845 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:961-969 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–9 lines × 2) engine/packages/gasoline/src/db/kv/keys/history.rs:2093— engine/packages/gasoline/src/db/kv/keys/history.rs:2093-2101 | engine/packages/gasoline/src/db/kv/keys/history.rs:2136-2142 — both copies are in the same file, so extract the block into 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–9 lines × 2) rivetkit-python/client/src/util.rs:183— rivetkit-python/client/src/util.rs:183-189 | rivetkit-python/client/src/util.rs:221-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 9) engine/packages/pegboard-gateway2/src/lib.rs:465— engine/packages/pegboard-gateway2/src/lib.rs:465-472 | engine/packages/pegboard-gateway2/src/lib.rs:486-493 | engine/packages/pegboard-gateway2/src/lib.rs:498-505 | engine/packages/pegboard-gateway2/src/lib.rs:513-520 | engine/packages/pegboard-gateway2/src/lib.rs:535-542 | engine/packages/pegboard-gateway2/src/lib.rs:549-556 | engine/packages/pegboard-gateway2/src/lib.rs:564-571 | engine/packages/pegboard-gateway2/src/lib.rs:583-590 | engine/packages/pegboard-gateway2/src/lib.rs:631-638 — all 9 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 × 9) engine/packages/pegboard-gateway3/src/lib.rs:210— engine/packages/pegboard-gateway3/src/lib.rs:210-217 | engine/packages/pegboard-gateway3/src/lib.rs:232-239 | engine/packages/pegboard-gateway3/src/lib.rs:244-251 | engine/packages/pegboard-gateway3/src/lib.rs:259-266 | engine/packages/pegboard-gateway3/src/lib.rs:281-288 | engine/packages/pegboard-gateway3/src/lib.rs:295-302 | engine/packages/pegboard-gateway3/src/lib.rs:310-317 | engine/packages/pegboard-gateway3/src/lib.rs:329-336 | engine/packages/pegboard-gateway3/src/lib.rs:377-384 — all 9 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:144— engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:144-148 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:310-314 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:476-480 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:642-646 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:808-812 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:974-978 — 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.
Duplicated block (5 lines × 6) rivetkit-rust/packages/actor-persist/src/versioned.rs:41— rivetkit-rust/packages/actor-persist/src/versioned.rs:41-45 | rivetkit-rust/packages/client-protocol/src/versioned.rs:38-42 | rivetkit-rust/packages/client-protocol/src/versioned.rs:427-431 | rivetkit-rust/packages/client-protocol/src/versioned.rs:631-635 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:49-53 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:336-340 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 7) engine/packages/gasoline/src/db/kv/keys/history.rs:613— engine/packages/gasoline/src/db/kv/keys/history.rs:613-620 | engine/packages/gasoline/src/db/kv/keys/history.rs:729-736 | engine/packages/gasoline/src/db/kv/keys/history.rs:1454-1461 | engine/packages/gasoline/src/db/kv/keys/signal.rs:16-23 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:160-167 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:247-254 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:334-341 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/history.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 × 7) engine/packages/gasoline/src/db/kv/mod.rs:3052— engine/packages/gasoline/src/db/kv/mod.rs:3052-3059 | engine/packages/gasoline/src/db/kv/mod.rs:3096-3103 | engine/packages/gasoline/src/db/kv/mod.rs:3290-3297 | engine/packages/gasoline/src/db/kv/mod.rs:3329-3336 | engine/packages/gasoline/src/db/kv/mod.rs:3366-3373 | engine/packages/gasoline/src/db/kv/mod.rs:3405-3412 | engine/packages/gasoline/src/db/kv/mod.rs:3446-3453 — 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.
Duplicated block (10 lines × 4) rivetkit-python/client/src/events/async/client.rs:107— rivetkit-python/client/src/events/async/client.rs:107-116 | rivetkit-python/client/src/events/sync/client.rs:86-95 | rivetkit-python/client/src/simple/async/client.rs:101-110 | rivetkit-python/client/src/simple/sync/client.rs:87-96 — before extracting anything, compare `rivetkit-python/client/src/events/async/client.rs` and `rivetkit-python/client/src/simple/async/client.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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 (10 lines × 4) rivetkit-python/client/src/events/async/client.rs:120— rivetkit-python/client/src/events/async/client.rs:120-129 | rivetkit-python/client/src/events/sync/client.rs:99-108 | rivetkit-python/client/src/simple/async/client.rs:114-123 | rivetkit-python/client/src/simple/sync/client.rs:100-109 — before extracting anything, compare `rivetkit-python/client/src/events/async/client.rs` and `rivetkit-python/client/src/simple/async/client.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 57 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 (7 lines × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:48— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:48-54 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:49-55 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:48-54 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:56-62 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:48-54 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:48-54 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:511— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:511-517 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:512-518 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:571-577 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:579-585 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:683-689 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:683-689 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:409— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:409-414 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:410-415 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:469-474 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:477-482 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:581-586 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:581-586 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:439— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:439-444 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:440-445 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:499-504 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:507-512 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:611-616 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:611-616 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 4) engine/packages/gasoline/src/history/cursor.rs:362— engine/packages/gasoline/src/history/cursor.rs:362-376 | engine/packages/gasoline/src/history/cursor.rs:393-407 | engine/packages/gasoline/src/history/cursor.rs:425-439 | engine/packages/gasoline/src/history/cursor.rs:575-589 — 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 (15 lines × 4) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:621— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:621-635 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:687-701 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:741-755 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:767-781 — 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.
R10 · Code Duplication· Duplicated block with local edits (47 matched lines × 2 locations) · ×2
Duplicated block with local edits (47 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:196— rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:196 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:96 — the two spans are one implementation copied and then locally edited — 232 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (47 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:325— rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:325 · rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:432 — the two spans are one implementation copied and then locally edited — 347 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.
Duplicated block (38 lines × 2 locations) engine/sdks/typescript/runner/src/websocket.ts:6— engine/sdks/typescript/runner/src/websocket.ts:6 · rivetkit-typescript/packages/engine-runner/src/websocket.ts:6 — 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 (38 lines × 2 locations) rivetkit-typescript/packages/rivetkit/scripts/check-annotated-skips.ts:5— rivetkit-typescript/packages/rivetkit/scripts/check-annotated-skips.ts:5 · rivetkit-typescript/packages/rivetkit/scripts/check-wait-for-comments.ts:5 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (33 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:5— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:5 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (33 lines × 2 locations) scripts/debug/decode_epoxy_changelog.js:12— scripts/debug/decode_epoxy_changelog.js:12 · scripts/debug/decode_runner_config.js:16 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (30 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:52— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:52 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:54 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (30 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:677— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:677 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:751 — 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 (28 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/database/mod.ts:309— rivetkit-typescript/packages/rivetkit/src/common/database/mod.ts:309 · rivetkit-typescript/packages/rivetkit/src/db/drizzle.ts:275 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (28 lines × 2 locations) scripts/api/runner-configs/list.ts:5— scripts/api/runner-configs/list.ts:5 · scripts/api/runners/list.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.
Dead file (~19 LoC) rivetkit-typescript/packages/rivetkit/scripts/pack-devtools.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~19 LoC) self-host/compose/template/src/utils.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~1 LoC) rivetkit-typescript/packages/rivetkit/src/common/actor-persist.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~1 LoC) rivetkit-typescript/packages/rivetkit/src/common/workflow-transport.ts— no import path from any entry point (161 application, 68 tooling, 414 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
AC2 · Forms & labels· <Slider> field component without a label · ×1
<Slider> field component without a label frontend/src/app/forms/upsert-deployment-form.tsx:188— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <Textarea> field component without a label · ×1
<Textarea> field component without a label frontend/src/components/actors/actor-database.tsx:693— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark scripts/debug/diff-viewer/server.js:74— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
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 471 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.
native.buildNativeFactory (cyclomatic 138) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4033— native.buildNativeFactory has cyclomatic complexity 138 (threshold 15). Of this number, 28 points are the body's own statements and 110 belong to 24 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.
traces.createTraces (cyclomatic 115) rivetkit-typescript/packages/traces/src/traces.ts:141— traces.createTraces has cyclomatic complexity 115 (threshold 15). Of this number, 110 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logfmt_to_gantt.main (cyclomatic 100) scripts/debug/logfmt_to_gantt.ts:104— logfmt_to_gantt.main has cyclomatic complexity 100 (threshold 15). Of this number, 89 points are the body's own statements and 11 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.
SubCommand::execute (cyclomatic 91) engine/packages/engine/src/commands/udb/cli.rs:156— SubCommand::execute has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Db::get_pages_with_options (cyclomatic 69) engine/packages/depot/src/conveyer/read.rs:70— Db::get_pages_with_options 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.
InFlightRequestHandle::send_message_admitted (cyclomatic 49) engine/packages/pegboard-gateway3/src/shared_state.rs:821— InFlightRequestHandle::send_message_admitted 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.
VfsContext::resolve_pages (cyclomatic 44) engine/packages/depot-client/src/vfs.rs:1721— VfsContext::resolve_pages has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rivetkit_wasm::dispatch_event (cyclomatic 44) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:722— rivetkit_wasm::dispatch_event has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowContextImpl.executeRace (cyclomatic 44) rivetkit-typescript/packages/workflow-engine/src/context.ts:2228— WorkflowContextImpl.executeRace has cyclomatic complexity 44 (threshold 15). Of this number, 30 points are the body's own statements and 14 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.
encoding.assertJsonCompatValue (cyclomatic 41) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:77— encoding.assertJsonCompatValue has cyclomatic complexity 41 (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.
PegboardGateway2::handle_websocket_inner (cyclomatic 38) engine/packages/pegboard-gateway2/src/lib.rs:347— PegboardGateway2::handle_websocket_inner has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
rivetkit_napi::napi_actor_events::dispatch_event (cyclomatic 38) rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:381— rivetkit_napi::napi_actor_events::dispatch_event 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.
database-vfs.createDatabaseVfs (cyclomatic 38) rivetkit-typescript/packages/rivetkit/src/agent-os/fs/database-vfs.ts:142— database-vfs.createDatabaseVfs has cyclomatic complexity 38 (threshold 15). Of this number, 36 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.
PegboardGateway3::handle_websocket_inner (cyclomatic 36) engine/packages/pegboard-gateway3/src/lib.rs:119— PegboardGateway3::handle_websocket_inner has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
gen-api-reference.renderEndpoint (cyclomatic 34) scripts/docs/gen-api-reference.mjs:132— gen-api-reference.renderEndpoint has cyclomatic complexity 34 (threshold 15). Of this number, 32 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.
index.main (cyclomatic 34) scripts/skill-evals/src/index.ts:557— index.main has cyclomatic complexity 34 (threshold 15). Of this number, 32 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.
Runner.#openPegboardWebSocket (cyclomatic 30) engine/sdks/typescript/runner/src/mod.ts:756— Runner.#openPegboardWebSocket has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 860, 982, 786, …). 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.
Config::apply_dynamic (cyclomatic 28) engine/packages/config/src/lib.rs:165— Config::apply_dynamic 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.
WorkflowContextImpl.executeLoop (cyclomatic 28) rivetkit-typescript/packages/workflow-engine/src/context.ts:1150— WorkflowContextImpl.executeLoop 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.
version.bumpPackageJsons (cyclomatic 28) scripts/publish/src/lib/version.ts:187— version.bumpPackageJsons has cyclomatic complexity 28 (threshold 15). Of this number, 26 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.
rivet_guard_core::server::run_server (cyclomatic 27) engine/packages/guard-core/src/server.rs:27— rivet_guard_core::server::run_server has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pegboard_outbound::serverless_outbound_req (cyclomatic 27) engine/packages/pegboard-outbound/src/lib.rs:396— pegboard_outbound::serverless_outbound_req 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.
ResponseBody::poll_frame (cyclomatic 26) engine/packages/guard-core/src/response_body.rs:149— ResponseBody::poll_frame 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.
PegboardGateway::handle_websocket_inner (cyclomatic 26) engine/packages/pegboard-gateway/src/lib.rs:253— PegboardGateway::handle_websocket_inner 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.
mod.db (cyclomatic 26) rivetkit-typescript/packages/rivetkit/src/common/database/mod.ts:83— mod.db has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 115, 191, 213, …). 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.
index.executeWorkflow (cyclomatic 26) rivetkit-typescript/packages/workflow-engine/src/index.ts:953— index.executeWorkflow 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.
WorkflowCtx::listen_n_until (cyclomatic 24) engine/packages/gasoline/src/ctx/workflow.rs:929— WorkflowCtx::listen_n_until 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.
rivet_service_manager::start (cyclomatic 24) engine/packages/service-manager/src/lib.rs:142— rivet_service_manager::start 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.
Runner.#openPegboardWebSocket (cyclomatic 24) rivetkit-typescript/packages/engine-runner/src/mod.ts:756— Runner.#openPegboardWebSocket has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 860, 947, 786, …). 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.
encoding.encodeJsonCompatValue (cyclomatic 24) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:280— encoding.encodeJsonCompatValue 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.
WorkflowContextImpl.executeStep (cyclomatic 24) rivetkit-typescript/packages/workflow-engine/src/context.ts:790— WorkflowContextImpl.executeStep 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.
WorkflowContextImpl.executeJoin (cyclomatic 24) rivetkit-typescript/packages/workflow-engine/src/context.ts:2016— WorkflowContextImpl.executeJoin has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rivet_guard::routing::pegboard_gateway::handle_actor_v2 (cyclomatic 23) engine/packages/guard/src/routing/pegboard_gateway/mod.rs:518— rivet_guard::routing::pegboard_gateway::handle_actor_v2 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.
index.RegistryConfigSchema (cyclomatic 23) rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:309— index.RegistryConfigSchema 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.
Registry.handler (cyclomatic 23) rivetkit-typescript/packages/rivetkit/src/registry/index.ts:217— Registry.handler has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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.
storage.flush (cyclomatic 23) rivetkit-typescript/packages/workflow-engine/src/storage.ts:240— storage.flush 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.
gen-api-reference.exampleFor (cyclomatic 23) scripts/docs/gen-api-reference.mjs:741— gen-api-reference.exampleFor 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.
rivetkit::start::handle_actor_event (cyclomatic 22) rivetkit-rust/packages/rivetkit/src/start.rs:359— rivetkit::start::handle_actor_event 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.
packages.discoverPackages (cyclomatic 22) scripts/publish/src/lib/packages.ts:118— packages.discoverPackages has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 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.
ActorConfig::from_input (cyclomatic 21) rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:258— ActorConfig::from_input 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.
mod.getOrCreateActor (cyclomatic 21) rivetkit-typescript/packages/framework-base/src/mod.ts:208— mod.getOrCreateActor has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 276, 320, 300, …). 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.
decode_fdb_tuple.decodeOne (cyclomatic 21) scripts/debug/decode_fdb_tuple.js:140— decode_fdb_tuple.decodeOne 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.
index.convertExpr (cyclomatic 21) scripts/vbare-gen-converters/index.ts:182— index.convertExpr 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.
Cursor::compare_removed (cyclomatic 20) engine/packages/gasoline/src/history/cursor.rs:487— Cursor::compare_removed 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.
ActorTask::run_live (cyclomatic 20) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:478— ActorTask::run_live 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.
drizzle.db (cyclomatic 20) rivetkit-typescript/packages/rivetkit/src/db/drizzle.ts:88— drizzle.db has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 235, 99, 129, …). 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.
write-through-proxy.unwrapDeep (cyclomatic 20) rivetkit-typescript/packages/rivetkit/src/registry/write-through-proxy.ts:63— write-through-proxy.unwrapDeep 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.
PegboardEnvoyWs::handle_websocket (cyclomatic 19) engine/packages/pegboard-envoy/src/lib.rs:74— PegboardEnvoyWs::handle_websocket 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.
TransactionOperations::get_key (cyclomatic 19) engine/packages/universaldb/src/tx_ops.rs:327— TransactionOperations::get_key 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.
universaldb::driver::postgres::resolver::drain_batch (cyclomatic 19) engine/packages/universaldb/src/driver/postgres/resolver/mod.rs:419— universaldb::driver::postgres::resolver::drain_batch 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.
ActorHandleRaw.#sendActionAttempts (cyclomatic 19) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:327— ActorHandleRaw.#sendActionAttempts 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.
useDraggable.useDraggable (cyclomatic 19) rivetkit-typescript/packages/devtools/src/hooks/useDraggable.ts:12— useDraggable.useDraggable has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 57, 40, 24, …). 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.
encoding.reviveJsonCompatValue (cyclomatic 19) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:377— encoding.reviveJsonCompatValue 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.
native-database.wrapJsNativeDatabase (cyclomatic 19) REDACTED:326— native-database.wrapJsNativeDatabase has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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.
gen-api-reference.renderProtocolPage (cyclomatic 19) scripts/docs/gen-api-reference.mjs:330— gen-api-reference.renderProtocolPage 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.
KeyRingCache::fetch_and_cache (cyclomatic 18) engine/packages/auth-jwt/src/key_ring_cache/refresh.rs:124— KeyRingCache::fetch_and_cache 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.
rivet_cli::util::build_resources (cyclomatic 18) engine/packages/cli/src/util.rs:51— rivet_cli::util::build_resources 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.
ThrottleState::flush (cyclomatic 18) engine/packages/universaldb/src/throttle.rs:545— ThrottleState::flush has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CBORSupport.jsonValue (cyclomatic 18) rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:86— CBORSupport.jsonValue 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.
lifecycle-errors.classifyActorError (cyclomatic 18) rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:56— lifecycle-errors.classifyActorError has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ActorConnRaw.#handleOnClose (cyclomatic 18) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:867— ActorConnRaw.#handleOnClose 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.
ActorHandleRaw.#fetchWithResolvedActor (cyclomatic 18) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:704— ActorHandleRaw.#fetchWithResolvedActor 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.
index.runWorkflow (cyclomatic 18) rivetkit-typescript/packages/workflow-engine/src/index.ts:632— index.runWorkflow 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.
gen-api-reference.typeLabel (cyclomatic 18) scripts/docs/gen-api-reference.mjs:646— gen-api-reference.typeLabel 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.
index.renderUnion (cyclomatic 18) scripts/vbare-gen-converters/index.ts:339— index.renderUnion has cyclomatic complexity 18 (threshold 15). Of this number, 14 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.
SqliteDb::release_transaction (cyclomatic 17) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:861— SqliteDb::release_transaction 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.
CBORWire.jsonValue (cyclomatic 17) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1051— CBORWire.jsonValue 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.
ws-proxy.createWebSocketProxy (cyclomatic 17) rivetkit-typescript/packages/rivetkit/src/engine-client/ws-proxy.ts:11— ws-proxy.createWebSocketProxy 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 111, 145, 78, …). 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.
docker-compose.generateDockerCompose (cyclomatic 17) self-host/compose/template/src/docker-compose.ts:6— docker-compose.generateDockerCompose has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 116). 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.
VirtualWebSocket.#dispatch (cyclomatic 17) shared/typescript/virtual-websocket/src/virtual-websocket.ts:250— VirtualWebSocket.#dispatch 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.
SignalBuilder::send (cyclomatic 16) engine/packages/gasoline/src/builder/workflow/signal.rs:108— SignalBuilder::send 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.
Worker::start (cyclomatic 16) engine/packages/gasoline/src/worker.rs:77— Worker::start 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.
AddressClass::of_ipv4 (cyclomatic 16) engine/packages/outbound-guard/src/policy.rs:105— AddressClass::of_ipv4 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.
TransactionTask::handle_commit (cyclomatic 16) engine/packages/universaldb/src/driver/rocksdb/transaction_task.rs:270— TransactionTask::handle_commit 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.
universalpubsub::subject::subject_root_from_str (cyclomatic 16) engine/packages/universalpubsub/src/subject.rs:129— universalpubsub::subject::subject_root_from_str 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.
run.startMockWorkflowApp (cyclomatic 16) integrations/workflow-world/scripts/integration/run.ts:294— run.startMockWorkflowApp has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 302, 373). 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.
otlp.anyValueFromJs (cyclomatic 16) rivetkit-typescript/packages/traces/src/otlp.ts:122— otlp.anyValueFromJs 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.
debug_mermaid.main (cyclomatic 16) scripts/debug/debug_mermaid.ts:10— debug_mermaid.main has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
gen-api-reference.stringExample (cyclomatic 16) scripts/docs/gen-api-reference.mjs:793— gen-api-reference.stringExample 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.
context.resolveContext (cyclomatic 16) scripts/publish/src/lib/context.ts:189— context.resolveContext 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.
SubCommand::execute (cognitive 247) engine/packages/engine/src/commands/udb/cli.rs:156— SubCommand::execute has cognitive complexity 247 (threshold 15). Drivers by points: if/else 59 (168 pts), match/switch 18 (49 pts), loops 8 (27 pts), boolean chains 3 (nesting depth added 159). 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.
logfmt_to_gantt.main (cognitive 185) scripts/debug/logfmt_to_gantt.ts:104— logfmt_to_gantt.main has cognitive complexity 185 (threshold 15). Drivers by points: if/else 52 (103 pts), ternaries 12 (39 pts), boolean chains 27, loops 8 (16 pts) (nesting depth added 86). Of this number, 177 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native.buildNativeFactory (cognitive 174) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4033— native.buildNativeFactory has cognitive complexity 174 (threshold 15). Drivers by points: if/else 51 (68 pts), ternaries 39 (56 pts), boolean chains 34, error handling 8 (14 pts), loops 1 (2 pts) (nesting depth added 41). Of this number, 25 points are the body's own statements and 149 belong to 24 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.
traces.createTraces (cognitive 144) rivetkit-typescript/packages/traces/src/traces.ts:141— traces.createTraces has cognitive complexity 144 (threshold 15). Drivers by points: if/else 63 (89 pts), loops 20 (24 pts), ternaries 9 (12 pts), boolean chains 10, error handling 4 (7 pts), match/switch 2 (nesting depth added 36). Of this number, 140 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VfsContext::resolve_pages (cognitive 94) engine/packages/depot-client/src/vfs.rs:1721— VfsContext::resolve_pages has cognitive complexity 94 (threshold 15). Drivers by points: if/else 35 (70 pts), loops 6 (13 pts), match/switch 3 (7 pts), boolean chains 4 (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.
rivet_service_manager::start (cognitive 80) engine/packages/service-manager/src/lib.rs:142— rivet_service_manager::start has cognitive complexity 80 (threshold 15). Drivers by points: if/else 13 (42 pts), match/switch 6 (21 pts), loops 7 (17 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
version.bumpPackageJsons (cognitive 70) scripts/publish/src/lib/version.ts:187— version.bumpPackageJsons has cognitive complexity 70 (threshold 15). Drivers by points: if/else 13 (43 pts), loops 6 (19 pts), boolean chains 7, ternaries 1 (nesting depth added 43). Of this number, 68 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.
rivet_guard_core::server::run_server (cognitive 68) engine/packages/guard-core/src/server.rs:27— rivet_guard_core::server::run_server has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (44 pts), match/switch 6 (20 pts), boolean chains 2, loops 2 (nesting depth added 42). Of this number, 65 points are the body's own statements and 3 belong to one function item 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.
WorkflowContextImpl.executeRace (cognitive 64) rivetkit-typescript/packages/workflow-engine/src/context.ts:2228— WorkflowContextImpl.executeRace has cognitive complexity 64 (threshold 15). Drivers by points: if/else 28 (49 pts), boolean chains 11, loops 3 (4 pts) (nesting depth added 22). Of this number, 44 points are the body's own statements and 20 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.
gen-api-reference.renderEndpoint (cognitive 57) scripts/docs/gen-api-reference.mjs:132— gen-api-reference.renderEndpoint has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (40 pts), loops 3 (7 pts), ternaries 6 (7 pts), boolean chains 3 (nesting depth added 22). Of this number, 55 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowContextImpl.executeLoop (cognitive 53) rivetkit-typescript/packages/workflow-engine/src/context.ts:1150— WorkflowContextImpl.executeLoop has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (45 pts), boolean chains 5, ternaries 1 (2 pts), 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.
database-vfs.createDatabaseVfs (cognitive 49) rivetkit-typescript/packages/rivetkit/src/agent-os/fs/database-vfs.ts:142— database-vfs.createDatabaseVfs has cognitive complexity 49 (threshold 15). Drivers by points: if/else 32 (37 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). Of this number, 47 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.
index.main (cognitive 48) scripts/skill-evals/src/index.ts:557— index.main has cognitive complexity 48 (threshold 15). Drivers by points: error handling 10 (17 pts), if/else 12 (17 pts), ternaries 7 (9 pts), boolean chains 3, loops 2 (nesting depth added 14). Of this number, 46 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_outbound::serverless_outbound_req (cognitive 47) engine/packages/pegboard-outbound/src/lib.rs:396— pegboard_outbound::serverless_outbound_req has cognitive complexity 47 (threshold 15). Drivers by points: match/switch 10 (28 pts), if/else 9 (16 pts), loops 2 (3 pts) (nesting depth added 26). 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.
index.executeWorkflow (cognitive 43) rivetkit-typescript/packages/workflow-engine/src/index.ts:953— index.executeWorkflow has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (32 pts), error handling 3 (5 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner.#openPegboardWebSocket (cognitive 40) engine/sdks/typescript/runner/src/mod.ts:756— Runner.#openPegboardWebSocket has cognitive complexity 40 (threshold 15). Drivers by points: if/else 28 (32 pts), boolean chains 4, error handling 3 (4 pts) (nesting depth added 5). Most of this is not in the body itself: 4 of the 40 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 860, 982, 786, …). 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.
SimpleTupleValue::write (cognitive 39) engine/packages/engine/src/util/udb.rs:225— SimpleTupleValue::write has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PegboardGateway3::handle_websocket_inner (cognitive 39) engine/packages/pegboard-gateway3/src/lib.rs:119— PegboardGateway3::handle_websocket_inner has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 9 (17 pts), loops 2, 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.
encoding.assertJsonCompatValue (cognitive 38) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:77— encoding.assertJsonCompatValue has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 14, if/else 12, loops 4 (8 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorConnRaw.#handleOnClose (cognitive 37) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:867— ActorConnRaw.#handleOnClose has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 4, error handling 1 (4 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WorkflowContextImpl.executeStep (cognitive 37) rivetkit-typescript/packages/workflow-engine/src/context.ts:790— WorkflowContextImpl.executeStep has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (25 pts), ternaries 4 (8 pts), boolean chains 3, error handling 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.
Config::apply_dynamic (cognitive 36) engine/packages/config/src/lib.rs:165— Config::apply_dynamic has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21, match/switch 4 (11 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
write-through-proxy.unwrapDeep (cognitive 35) rivetkit-typescript/packages/rivetkit/src/registry/write-through-proxy.ts:63— write-through-proxy.unwrapDeep has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 6 (12 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.executeLiveWorkflow (cognitive 35) rivetkit-typescript/packages/workflow-engine/src/index.ts:511— index.executeLiveWorkflow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 3 (9 pts), boolean chains 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.
PegboardGateway::handle_websocket_inner (cognitive 34) engine/packages/pegboard-gateway/src/lib.rs:253— PegboardGateway::handle_websocket_inner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 5 (12 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gen-api-reference.renderProtocolPage (cognitive 33) scripts/docs/gen-api-reference.mjs:330— gen-api-reference.renderProtocolPage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (11 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.
rivetkit_client::drivers::ws::start (cognitive 32) rivetkit-rust/packages/client/src/drivers/ws.rs:46— rivetkit_client::drivers::ws::start has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 4 (12 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner.#openPegboardWebSocket (cognitive 32) rivetkit-typescript/packages/engine-runner/src/mod.ts:756— Runner.#openPegboardWebSocket has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25 (28 pts), boolean chains 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 860, 947, 786, …). 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.
encoding.reviveJsonCompatValue (cognitive 32) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:377— encoding.reviveJsonCompatValue has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (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.
index.renderUnion (cognitive 32) scripts/vbare-gen-converters/index.ts:339— index.renderUnion has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 3 (9 pts), boolean chains 3, loops 2 (nesting depth added 15). Of this number, 27 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.
RequestConfig::fetch_all_convert (cognitive 31) engine/packages/cache/src/req_config.rs:91— RequestConfig::fetch_all_convert has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (12 pts), loops 2 (5 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.
PrefetchPredictor::multi_predict (cognitive 31) engine/packages/depot-client/src/vfs.rs:860— PrefetchPredictor::multi_predict has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorHandleRaw.#sendActionAttempts (cognitive 31) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:327— ActorHandleRaw.#sendActionAttempts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 6, error handling 1 (2 pts), ternaries 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.
Root::validate_and_set_defaults (cognitive 29) engine/packages/config/src/config/mod.rs:260— Root::validate_and_set_defaults has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gasoline_macros::parse_trait_fn (cognitive 29) engine/packages/gasoline-macros/src/lib.rs:268— gasoline_macros::parse_trait_fn has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
storage.flush (cognitive 29) rivetkit-typescript/packages/workflow-engine/src/storage.ts:240— storage.flush has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 6 (8 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway::tunnel_to_ws_task::task (cognitive 28) engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:19— pegboard_gateway::tunnel_to_ws_task::task has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_runtime::build_tokio_runtime_builder (cognitive 28) engine/packages/runtime/src/lib.rs:62— rivet_runtime::build_tokio_runtime_builder has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (12 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.
ActorConnRaw.#sendMessage (cognitive 28) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:1245— ActorConnRaw.#sendMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (9 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 12). Of this number, 24 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorHandleRaw.#fetchWithResolvedActor (cognitive 28) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:704— ActorHandleRaw.#fetchWithResolvedActor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
packages.discoverPackages (cognitive 28) scripts/publish/src/lib/packages.ts:118— packages.discoverPackages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 8). Of this number, 20 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VirtualWebSocket.#dispatch (cognitive 28) shared/typescript/virtual-websocket/src/virtual-websocket.ts:250— VirtualWebSocket.#dispatch has cognitive complexity 28 (threshold 15). Drivers by points: error handling 5 (15 pts), if/else 5 (9 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cursor::compare_removed (cognitive 27) engine/packages/gasoline/src/history/cursor.rs:487— Cursor::compare_removed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgresDatabaseDriver::run (cognitive 26) engine/packages/universaldb/src/driver/postgres/database.rs:330— PostgresDatabaseDriver::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (5 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.
RocksDbDatabaseDriver::run (cognitive 26) engine/packages/universaldb/src/driver/rocksdb/database.rs:69— RocksDbDatabaseDriver::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (5 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.
ThrottleState::flush (cognitive 26) engine/packages/universaldb/src/throttle.rs:545— ThrottleState::flush has cognitive complexity 26 (threshold 15). Drivers by points: loops 10 (13 pts), if/else 7 (12 pts), match/switch 1 (nesting depth added 8). 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.
ActorConnRaw.#handleOnMessage (cognitive 26) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:724— ActorConnRaw.#handleOnMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (3 pts), boolean chains 1, 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.
WorkflowContextImpl.executeJoin (cognitive 26) rivetkit-typescript/packages/workflow-engine/src/context.ts:2016— WorkflowContextImpl.executeJoin has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 10 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.
index.executeRollback (cognitive 26) rivetkit-typescript/packages/workflow-engine/src/index.ts:289— index.executeRollback has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 2 (3 pts), boolean chains 1, 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.
gen-api-reference.exampleFor (cognitive 26) scripts/docs/gen-api-reference.mjs:741— gen-api-reference.exampleFor has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 9 (11 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.convertExpr (cognitive 26) scripts/vbare-gen-converters/index.ts:182— index.convertExpr has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SystemInfo::fetch_cpu_usage (cognitive 25) engine/packages/gasoline/src/db/kv/system.rs:57— SystemInfo::fetch_cpu_usage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (25 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.
TransactionConflictTracker::check_and_insert (cognitive 25) engine/packages/universaldb/src/conflict_tracker.rs:71— TransactionConflictTracker::check_and_insert has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (9 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.
mod.db (cognitive 25) rivetkit-typescript/packages/rivetkit/src/common/database/mod.ts:83— mod.db has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, ternaries 3 (4 pts), error handling 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 191, 115, 213, …). 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.
rivet_cli::util::build_resources (cognitive 24) engine/packages/cli/src/util.rs:51— rivet_cli::util::build_resources has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_profiling::pyroscope::start (cognitive 24) engine/packages/profiling/src/pyroscope.rs:18— rivet_profiling::pyroscope::start has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (10 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.
index.transitiveSharedTypes (cognitive 24) scripts/vbare-gen-converters/index.ts:137— index.transitiveSharedTypes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 11). Of this number, 13 points are the body's own statements and 11 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.
utils.sendHttpRequest (cognitive 23) rivetkit-typescript/packages/rivetkit/src/client/utils.ts:99— utils.sendHttpRequest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (8 pts), error handling 3 (4 pts), boolean chains 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
logging.extractMessage (cognitive 23) rivetkit-typescript/packages/effect/src/internal/logging.ts:150— logging.extractMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
encoding.encodeJsonCompatValue (cognitive 23) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:280— encoding.encodeJsonCompatValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, loops 2 (4 pts), ternaries 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.
native-database.wrapJsNativeDatabase (cognitive 23) REDACTED:326— native-database.wrapJsNativeDatabase has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 6 (8 pts), loops 3 (4 pts), ternaries 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
KeyRingCache::fetch_and_cache (cognitive 22) engine/packages/auth-jwt/src/key_ring_cache/refresh.rs:124— KeyRingCache::fetch_and_cache has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ResponseBody::poll_frame (cognitive 22) engine/packages/guard-core/src/response_body.rs:149— ResponseBody::poll_frame has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 5 (10 pts), boolean chains 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.
Subscriber::next (cognitive 22) engine/packages/universalpubsub/src/pubsub.rs:431— Subscriber::next has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (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.
ActorHandleRaw.#sendQueueMessage (cognitive 22) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:155— ActorHandleRaw.#sendQueueMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 12). Most of this is not in the body itself: 0 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 160). 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.
VacuumRepairOpts::execute (cognitive 21) engine/packages/engine/src/commands/depot.rs:467— VacuumRepairOpts::execute has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 5 (7 pts), match/switch 3 (6 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.
SignalBuilder::send (cognitive 21) engine/packages/gasoline/src/builder/workflow/signal.rs:108— SignalBuilder::send has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 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.
LegacyPrefixScan::next_page (cognitive 21) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:391— LegacyPrefixScan::next_page has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (4 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.
ActorConnection.handleClose (cognitive 21) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:742— ActorConnection.handleClose has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dispatcher.drainDispatchQueue (cognitive 21) integrations/workflow-world/src/actors/dispatcher.ts:576— dispatcher.drainDispatchQueue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 2 (7 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.
native-http.buildNativeHttpRequest (cognitive 21) rivetkit-typescript/packages/rivetkit/src/registry/native-http.ts:45— native-http.buildNativeHttpRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 4 (7 pts), boolean chains 4, error handling 1 (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.
cut-release.main (cognitive 21) scripts/publish/src/local/cut-release.ts:72— cut-release.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 2 (4 pts), error handling 1 (2 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, 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.
ActorConfig::from_input (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:258— ActorConfig::from_input has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
compaction_backlog.print_report (cognitive 20) engine/packages/depot/scripts/compaction_backlog.py:682— compaction_backlog.print_report has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ActorObservable.attachConnectionHandlers (cognitive 20) rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:515— ActorObservable.attachConnectionHandlers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RivetAgentCoordinator.reconcileSubmissions (cognitive 20) integrations/flue-runtime/src/agent-coordinator.ts:238— RivetAgentCoordinator.reconcileSubmissions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), loops 4, 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.
keys.deserializeActorKey (cognitive 20) rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:88— keys.deserializeActorKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
otlp.anyValueFromJs (cognitive 20) rivetkit-typescript/packages/traces/src/otlp.ts:122— otlp.anyValueFromJs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
index.runWorkflow (cognitive 20) rivetkit-typescript/packages/workflow-engine/src/index.ts:632— index.runWorkflow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 3, 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.
mod.getOrCreateActor (cognitive 19) rivetkit-typescript/packages/framework-base/src/mod.ts:208— mod.getOrCreateActor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 320, 276, 300, …). 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.
index.RegistryConfigSchema (cognitive 19) rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:309— index.RegistryConfigSchema has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (6 pts), if/else 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
actor-websocket-client.buildActorQueryGatewayUrl (cognitive 19) rivetkit-typescript/packages/rivetkit/src/engine-client/actor-websocket-client.ts:208— actor-websocket-client.buildActorQueryGatewayUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
decode_fdb_tuple.decodeOne (cognitive 19) scripts/debug/decode_fdb_tuple.js:140— decode_fdb_tuple.decodeOne has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (2 pts), 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.
logfmt_to_gantt.parseLogfmt (cognitive 19) scripts/debug/logfmt_to_gantt.ts:46— logfmt_to_gantt.parseLogfmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 1 (2 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.
rivet_api_public::actors::list::list_inner (cognitive 18) engine/packages/api-public/src/actors/list.rs:52— rivet_api_public::actors::list::list_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
rivet_auth_jwt::planner::reconcile_issuer (cognitive 18) engine/packages/auth-jwt/src/planner.rs:306— rivet_auth_jwt::planner::reconcile_issuer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_config::add_source (cognitive 18) engine/packages/config/src/lib.rs:360— rivet_config::add_source has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rivetkit::start::handle_actor_event (cognitive 18) rivetkit-rust/packages/rivetkit/src/start.rs:359— rivetkit::start::handle_actor_event has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 4 (8 pts) (nesting depth added 9). 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.
CoreRegistry::health (cognitive 18) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:353— CoreRegistry::health has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3 (4 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.
ActorConnRaw.#setConnStatus (cognitive 18) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:400— ActorConnRaw.#setConnStatus has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (8 pts), loops 3 (5 pts), if/else 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useDraggable.useDraggable (cognitive 18) rivetkit-typescript/packages/devtools/src/hooks/useDraggable.ts:12— useDraggable.useDraggable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 6, error handling 1. Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 57, 40, 24, …). 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.
ws-proxy.createWebSocketProxy (cognitive 18) rivetkit-typescript/packages/rivetkit/src/engine-client/ws-proxy.ts:11— ws-proxy.createWebSocketProxy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 111, 145, 167, …). 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.
Registry.handler (cognitive 18) rivetkit-typescript/packages/rivetkit/src/registry/index.ts:217— Registry.handler has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, boolean chains 5, error handling 3 (5 pts), loops 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowContextImpl.executeTry (cognitive 18) rivetkit-typescript/packages/workflow-engine/src/context.ts:715— WorkflowContextImpl.executeTry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 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.
WorkflowContextImpl.executeQueueNextBatch (cognitive 18) rivetkit-typescript/packages/workflow-engine/src/context.ts:1617— WorkflowContextImpl.executeQueueNextBatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
gen-api-reference.typeLabel (cognitive 18) scripts/docs/gen-api-reference.mjs:646— gen-api-reference.typeLabel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
context.resolveContext (cognitive 18) scripts/publish/src/lib/context.ts:189— context.resolveContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NativeDatabase::drop (cognitive 17) engine/packages/depot-client/src/vfs.rs:3973— NativeDatabase::drop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (7 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.
SqliteWorkerHandle::close_with_timeout (cognitive 17) engine/packages/depot-client/src/worker.rs:257— SqliteWorkerHandle::close_with_timeout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (7 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.
PubSub::publish_inner (cognitive 17) engine/packages/universalpubsub/src/pubsub.rs:180— PubSub::publish_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.stringifyError (cognitive 17) rivetkit-typescript/packages/rivetkit/src/common/utils.ts:141— utils.stringifyError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mod.workflow (cognitive 17) rivetkit-typescript/packages/rivetkit/src/workflow/mod.ts:133— mod.workflow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 3). Of this number, 10 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_error_macros::derive_enum_error (cognitive 16) engine/packages/error-macros/src/lib.rs:243— rivet_error_macros::derive_enum_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (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.
LoopBuilder::run (cognitive 16) engine/packages/gasoline/src/builder/workflow/lupe.rs:51— LoopBuilder::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 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.
PegboardEnvoyWs::handle_websocket (cognitive 16) engine/packages/pegboard-envoy/src/lib.rs:74— PegboardEnvoyWs::handle_websocket has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 6 (7 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
universalpubsub::subject::subject_root_from_str (cognitive 16) engine/packages/universalpubsub/src/subject.rs:129— universalpubsub::subject::subject_root_from_str has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
run.startMockWorkflowApp (cognitive 16) integrations/workflow-world/scripts/integration/run.ts:294— run.startMockWorkflowApp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 1). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 302, 373). 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.
index.getEnginePath (cognitive 16) rivetkit-typescript/packages/engine-cli/index.js:47— index.getEnginePath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gen-api-reference.buildErrorRegistry (cognitive 16) scripts/docs/gen-api-reference.mjs:438— gen-api-reference.buildErrorRegistry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (nesting depth added 6). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gen-api-reference.renderCurl (cognitive 16) scripts/docs/gen-api-reference.mjs:544— gen-api-reference.renderCurl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (5 pts), ternaries 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.
gen-api-reference.flattenSchema (cognitive 16) scripts/docs/gen-api-reference.mjs:698— gen-api-reference.flattenSchema has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency· Three methods perform database execution with overlapping signatures. `exec` takes only SQL, while `run` and `execute` both take SQL and params. `run` and `execute` are functionally identical in signature and likely intent, creating unnecessary duplication. · ×1
Three methods perform database execution with overlapping signatures. `exec` takes only SQL, while `run` and `execute` both take SQL and params. `run` and `execute` are functionally identical in signature and likely intent, creating unnecessary duplication. — Remove `run` and `execute`. Keep `exec` for parameterless queries and `execute` (or `run`) for parameterized queries. Standardize on one name (e.g., `execute` is more common in SQL libraries). (signatures: NativeDatabaseHandle.exec(sql: String): Result | NativeDatabaseHandle.run(sql: String, params: BindParam): Result | NativeDatabaseHandle.execute(sql: String, params: BindParam): Result)
D22 · Internal API Consistency· Profiled execution methods are split between `exec` and `execute` roots. If `exec` and `execute` are redundant (see above), their profiled variants are too. Furthermore, having both `exec_profiled` and `execute_profiled` suggests a lack of unified naming convention for the base operations. · ×1
Profiled execution methods are split between `exec` and `execute` roots. If `exec` and `execute` are redundant (see above), their profiled variants are too. Furthermore, having both `exec_profiled` and `execute_profiled` suggests a lack of unified naming convention for the base operations. — Unify base execution methods first. Then provide a single profiled variant, e.g., `execute_profiled(sql, params)` and `exec_profiled(sql)` if parameterless is needed, or just `execute_profiled` with optional params. (signatures: NativeDatabaseHandle.exec_profiled(sql: String): Result | NativeDatabaseHandle.execute_profiled(sql: String, params: BindParam): Result)
D22 · Internal API Consistency· Two close methods with ambiguous distinction. `close` and `close_and_wait` likely differ by whether they wait for background workers to finish, but the naming is not immediately clear from the signature alone (no `wait` boolean or similar). This forces users to guess the semantics. · ×1
Two close methods with ambiguous distinction. `close` and `close_and_wait` likely differ by whether they wait for background workers to finish, but the naming is not immediately clear from the signature alone (no `wait` boolean or similar). This forces users to guess the semantics. — Rename to `close()` (non-blocking) and `close_sync()` or `close_with_timeout()` to make the blocking/waiting behavior explicit in the name. (signatures: NativeDatabaseHandle.close(): Result | NativeDatabaseHandle.close_and_wait(): Result)
D22 · Internal API Consistency· Two methods returning error strings with unclear distinction. `take_last_kv_error` implies retrieving a specific KV store error, while `clone_fatal_error` implies cloning a fatal error state. The return type is identical (`String`), and the intent is not obvious from the names alone, risking confusion about which error to retrieve. · ×1
Two methods returning error strings with unclear distinction. `take_last_kv_error` implies retrieving a specific KV store error, while `clone_fatal_error` implies cloning a fatal error state. The return type is identical (`String`), and the intent is not obvious from the names alone, risking confusion about which error to retrieve. — Clarify names based on source. E.g., `get_last_kv_error()` and `get_fatal_error()`. If they return the same underlying error, consolidate into one method. (signatures: NativeDatabaseHandle.take_last_kv_error(): String | NativeDatabaseHandle.clone_fatal_error(): String)
Change-coupling hub: wasm-runtime.ts → context.rs, lib.rs, napi-runtime.ts rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts— `rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts` changes together with 3 other files — `rivetkit-rust/packages/rivetkit-core/src/actor/context.rs`, `rivetkit-rust/packages/rivetkit-core/src/lib.rs`, `rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Near-duplicate member family (6 members, 25 shared lines) · ×1
Near-duplicate member family (6 members, 25 shared lines) rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:214— rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:214-241 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:272-302 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:304-334 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:336-371 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:373-409 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:412-439 — These 6 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (6 members, 9 shared lines) · ×1
Near-duplicate member family (6 members, 9 shared lines) engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:150— engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:150-161 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:316-327 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:482-493 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:648-659 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:814-825 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:980-991 — These 6 members are variants of one another: a block of 9 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 31 shared lines) · ×1
Near-duplicate member family (4 members, 31 shared lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:555— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:555-601 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:617-670 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:686-738 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:754-801 — These 4 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 172 shared lines) · ×1
Near-duplicate member family (3 members, 172 shared lines) engine/packages/pegboard-gateway/src/lib.rs:259— engine/packages/pegboard-gateway/src/lib.rs:259-632 | engine/packages/pegboard-gateway2/src/lib.rs:353-935 | engine/packages/pegboard-gateway3/src/lib.rs:125-684 — These 3 members are variants of one another: a block of 172 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (201 shared lines) engine/packages/pegboard-gateway2/src/shared_state.rs:600— engine/packages/pegboard-gateway2/src/shared_state.rs:600-837 | engine/packages/pegboard-gateway3/src/shared_state.rs:826-1266 — These two members are variants of one another: 201 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (141 shared lines) engine/packages/pegboard-gateway2/src/lib.rs:1055— engine/packages/pegboard-gateway2/src/lib.rs:1055-1245 | engine/packages/pegboard-gateway3/src/lib.rs:755-926 — These two members are variants of one another: 141 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (78 shared lines) engine/packages/pegboard-envoy/src/lib.rs:79— engine/packages/pegboard-envoy/src/lib.rs:79-471 | engine/packages/pegboard-runner/src/lib.rs:69-264 — These two members are variants of one another: 78 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (70 shared lines) engine/packages/depot-client/src/vfs.rs:2146— engine/packages/depot-client/src/vfs.rs:2146-2258 | engine/packages/depot-client/src/vfs.rs:2272-2386 — These two members are variants of one another: 70 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (57 shared lines) engine/packages/pegboard/src/workflows/actor/metrics.rs:211— engine/packages/pegboard/src/workflows/actor/metrics.rs:211-328 | engine/packages/pegboard/src/workflows/actor2/metrics.rs:202-323 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (56 shared lines) engine/packages/gasoline/src/builder/common/signal.rs:120— engine/packages/gasoline/src/builder/common/signal.rs:120-236 | engine/packages/gasoline/src/builder/workflow/signal.rs:108-341 — These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (31 shared lines) engine/sdks/rust/envoy-client/src/handle.rs:831— engine/sdks/rust/envoy-client/src/handle.rs:831-864 | engine/sdks/rust/envoy-client/src/handle.rs:870-904 — 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) engine/packages/pegboard-gateway2/src/shared_state.rs:513— engine/packages/pegboard-gateway2/src/shared_state.rs:513-565 | engine/packages/pegboard-gateway3/src/shared_state.rs:570-622 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) engine/packages/universaldb/src/driver/postgres/transaction.rs:157— engine/packages/universaldb/src/driver/postgres/transaction.rs:157-199 | engine/packages/universaldb/src/driver/rocksdb/transaction.rs:181-223 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) engine/packages/runner-protocol/src/versioned.rs:1404— engine/packages/runner-protocol/src/versioned.rs:1404-1486 | engine/packages/runner-protocol/src/versioned.rs:1746-1823 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) engine/packages/error-macros/src/lib.rs:549— engine/packages/error-macros/src/lib.rs:549-573 | engine/packages/error-macros/src/lib.rs:507-539 — 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· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (12 members, 50+ identical tokens) engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:136— engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:136-148 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:302-314 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:468-480 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:634-646 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:800-812 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:966-978 | rivetkit-rust/packages/actor-persist/src/versioned.rs:28-38 | rivetkit-rust/packages/client-protocol/src/versioned.rs:27-35 | rivetkit-rust/packages/client-protocol/src/versioned.rs:413-565 | rivetkit-rust/packages/client-protocol/src/versioned.rs:620-628 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:36-46 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:323-333 — These 12 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 12 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 12 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) engine/packages/depot/src/compaction/shared.rs:3541— engine/packages/depot/src/compaction/shared.rs:3541-3565 | engine/packages/depot/src/compaction/shared.rs:3572-3594 | engine/packages/depot/src/compaction/shared.rs:3636-3659 | engine/packages/depot/src/conveyer/branch/shared.rs:66-84 | engine/packages/depot/src/conveyer/commit/helpers.rs:31-50 | engine/packages/depot/src/conveyer/debug.rs:321-339 | engine/packages/depot/src/conveyer/history_pin.rs:149-167 | engine/packages/depot/src/conveyer/pitr_interval.rs:134-152 | engine/packages/depot/src/conveyer/read/tx.rs:14-34 | engine/packages/depot/src/conveyer/read/tx.rs:52-72 | engine/packages/depot/src/gc/mod.rs:335-353 — 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) rivetkit-rust/packages/actor-persist/src/versioned.rs:40— rivetkit-rust/packages/actor-persist/src/versioned.rs:40-48 | rivetkit-rust/packages/client-protocol/src/versioned.rs:37-45 | rivetkit-rust/packages/client-protocol/src/versioned.rs:426-565 | rivetkit-rust/packages/client-protocol/src/versioned.rs:630-640 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:48-58 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:335-345 — 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.
Duplicated block (141 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:239— engine/packages/pegboard-gateway2/src/shared_state.rs:239-379 | engine/packages/pegboard-gateway3/src/shared_state.rs:252-392 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (113 lines × 2) engine/packages/pegboard-gateway/src/lib.rs:987— engine/packages/pegboard-gateway/src/lib.rs:987-1099 | engine/packages/pegboard-gateway2/src/lib.rs:1291-1403 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (86–87 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:1132— engine/packages/pegboard-gateway2/src/lib.rs:1132-1218 | engine/packages/pegboard-gateway3/src/lib.rs:834-919 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (83 lines × 2) engine/packages/pegboard-gateway2/src/ws_to_tunnel_task.rs:25— engine/packages/pegboard-gateway2/src/ws_to_tunnel_task.rs:25-107 | engine/packages/pegboard-gateway3/src/ws_to_tunnel_task.rs:25-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (3–61 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:598— engine/packages/pegboard-gateway/src/lib.rs:598-600 | engine/packages/pegboard-gateway2/src/lib.rs:875-935 | engine/packages/pegboard-gateway3/src/lib.rs:624-684 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (49 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:672— engine/packages/pegboard-gateway2/src/lib.rs:672-720 | engine/packages/pegboard-gateway3/src/lib.rs:417-465 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (47 lines × 2) engine/packages/gasoline/src/builder/workflow/signal.rs:195— engine/packages/gasoline/src/builder/workflow/signal.rs:195-241 | engine/packages/gasoline/src/builder/workflow/signal.rs:248-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (44 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:589— engine/packages/pegboard-gateway2/src/lib.rs:589-632 | engine/packages/pegboard-gateway3/src/lib.rs:335-378 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (39–43 lines × 2) engine/packages/pegboard/src/ops/envoy/get.rs:81— engine/packages/pegboard/src/ops/envoy/get.rs:81-119 | engine/packages/pegboard/src/ops/runner/get.rs:82-124 — 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 (43 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:656— engine/packages/pegboard-gateway2/src/shared_state.rs:656-698 | engine/packages/pegboard-gateway3/src/shared_state.rs:906-948 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (39–42 lines × 2) engine/packages/depot-client/src/vfs.rs:2163— engine/packages/depot-client/src/vfs.rs:2163-2204 | engine/packages/depot-client/src/vfs.rs:2292-2330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:797— engine/packages/pegboard-gateway2/src/shared_state.rs:797-834 | engine/packages/pegboard-gateway3/src/shared_state.rs:1216-1253 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (36 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:724— engine/packages/pegboard-gateway2/src/lib.rs:724-759 | engine/packages/pegboard-gateway3/src/lib.rs:473-508 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (34–35 lines × 2) engine/packages/gasoline/src/builder/common/signal.rs:192— engine/packages/gasoline/src/builder/common/signal.rs:192-225 | engine/packages/gasoline/src/builder/workflow/signal.rs:288-322 — `engine/packages/gasoline/src/builder/common/signal.rs` and `engine/packages/gasoline/src/builder/workflow/signal.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (34 lines × 3) engine/packages/pegboard-gateway/src/keepalive_task.rs:23— engine/packages/pegboard-gateway/src/keepalive_task.rs:23-56 | engine/packages/pegboard-gateway2/src/keepalive_task.rs:24-57 | engine/packages/pegboard-gateway3/src/keepalive_task.rs:24-57 — 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 (34 lines × 2) engine/packages/pegboard-gateway/src/metrics_task.rs:17— engine/packages/pegboard-gateway/src/metrics_task.rs:17-50 | engine/packages/pegboard-gateway2/src/metrics_task.rs:18-51 — before extracting anything, compare `engine/packages/pegboard-gateway/src/metrics_task.rs` and `engine/packages/pegboard-gateway2/src/metrics_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (31–33 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:714— engine/packages/pegboard-gateway2/src/shared_state.rs:714-744 | engine/packages/pegboard-gateway3/src/shared_state.rs:977-1009 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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 (27–29 lines × 2) engine/packages/gasoline/src/db/kv/repair.rs:1140— engine/packages/gasoline/src/db/kv/repair.rs:1140-1168 | engine/packages/gasoline/src/db/kv/repair.rs:1280-1306 — both copies are in the same file, so extract the block into 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–29 lines × 2) engine/packages/pegboard-outbound/src/lib.rs:425— engine/packages/pegboard-outbound/src/lib.rs:425-453 | engine/packages/pegboard/src/workflows/serverless/conn.rs:295-310 — 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 (29 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:446— rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:446-474 | rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:497-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 (28 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:500— engine/packages/pegboard-gateway/src/lib.rs:500-527 | engine/packages/pegboard-gateway2/src/lib.rs:772-799 | engine/packages/pegboard-gateway3/src/lib.rs:521-548 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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–26 lines × 2) engine/packages/pegboard-outbound/src/lib.rs:415— engine/packages/pegboard-outbound/src/lib.rs:415-440 | engine/packages/pegboard/src/workflows/serverless/conn.rs:259-273 — 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 (26 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:624— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:624-649 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:747-772 — both copies are in the same file, so extract the block into 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–25 lines × 3) engine/packages/pegboard-gateway/src/shared_state.rs:420— engine/packages/pegboard-gateway/src/shared_state.rs:420-444 | engine/packages/pegboard-gateway2/src/shared_state.rs:262-285 | engine/packages/pegboard-gateway3/src/shared_state.rs:275-298 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (24 lines × 3) engine/packages/api-peer/src/actors/kv_get.rs:24— engine/packages/api-peer/src/actors/kv_get.rs:24-47 | engine/packages/api-peer/src/actors/reschedule.rs:14-37 | engine/packages/api-peer/src/actors/sleep.rs:14-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (23–24 lines × 2) engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:103— engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:103-125 | engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:199-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 (23 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:525— engine/packages/pegboard-gateway/src/lib.rs:525-547 | engine/packages/pegboard-gateway2/src/lib.rs:814-836 | engine/packages/pegboard-gateway3/src/lib.rs:563-585 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (20–23 lines × 2) rivetkit-python/client/src/events/sync/handle.rs:26— rivetkit-python/client/src/events/sync/handle.rs:26-45 | rivetkit-python/client/src/simple/sync/handle.rs:48-70 — 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 (20–22 lines × 2) engine/packages/pegboard-gateway2/src/lib.rs:1085— engine/packages/pegboard-gateway2/src/lib.rs:1085-1104 | engine/packages/pegboard-gateway3/src/lib.rs:791-812 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/lib.rs` and `engine/packages/pegboard-gateway3/src/lib.rs` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 700 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 (21 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:368— engine/packages/pegboard-gateway/src/lib.rs:368-388 | engine/packages/pegboard-gateway2/src/lib.rs:594-614 | engine/packages/pegboard-gateway3/src/lib.rs:340-360 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 (21 lines × 2) engine/packages/pegboard-gateway2/src/shared_state.rs:998— engine/packages/pegboard-gateway2/src/shared_state.rs:998-1018 | engine/packages/pegboard-gateway3/src/shared_state.rs:1465-1485 — before extracting anything, compare `engine/packages/pegboard-gateway2/src/shared_state.rs` and `engine/packages/pegboard-gateway3/src/shared_state.rs` as WHOLE FILES: this scan already matched 43 separate duplicated blocks between them, totalling at least 963 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–20 lines × 3) engine/packages/gasoline/src/builder/workflow/signal.rs:171— engine/packages/gasoline/src/builder/workflow/signal.rs:171-189 | engine/packages/gasoline/src/builder/workflow/signal.rs:217-236 | engine/packages/gasoline/src/builder/workflow/signal.rs:270-289 — 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–20 lines × 2) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:374— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:374-392 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:402-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) engine/packages/pegboard/src/ops/envoy/evict_actors.rs:97— engine/packages/pegboard/src/ops/envoy/evict_actors.rs:97-114 | engine/packages/pegboard/src/ops/envoy/evict_actors.rs:117-135 — both copies are in the same file, so extract the block into 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–18 lines × 2) engine/packages/depot-client/src/worker.rs:557— engine/packages/depot-client/src/worker.rs:557-574 | engine/packages/depot-client/src/worker.rs:618-631 — both copies are in the same file, so extract the block into 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–18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:703— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:703-720 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:796-810 — both copies are in the same file, so extract the block into 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 × 5) engine/packages/pegboard-envoy/src/lib.rs:280— engine/packages/pegboard-envoy/src/lib.rs:280-296 | engine/packages/pegboard-gateway/src/lib.rs:502-518 | engine/packages/pegboard-gateway2/src/lib.rs:774-790 | engine/packages/pegboard-gateway3/src/lib.rs:523-539 | engine/packages/pegboard-runner/src/lib.rs:190-206 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 × 4) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:580— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:580-596 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:649-665 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:717-733 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:780-796 — 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 (16–17 lines × 3) engine/packages/pegboard/src/workflows/actor/mod.rs:113— engine/packages/pegboard/src/workflows/actor/mod.rs:113-128 | engine/packages/pegboard/src/workflows/actor/mod.rs:137-153 | engine/packages/pegboard/src/workflows/actor/mod.rs:204-219 — 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–16 lines × 2) engine/packages/gasoline/src/builder/common/signal.rs:173— engine/packages/gasoline/src/builder/common/signal.rs:173-183 | engine/packages/gasoline/src/builder/workflow/signal.rs:235-250 — `engine/packages/gasoline/src/builder/common/signal.rs` and `engine/packages/gasoline/src/builder/workflow/signal.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14–16 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:534— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:534-549 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:551-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:963— engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs:963-974 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:585-599 — before extracting anything, compare `engine/packages/pegboard-envoy/src/ws_to_tunnel_task.rs` and `engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–15 lines × 2) engine/packages/pegboard-gateway/src/lib.rs:705— engine/packages/pegboard-gateway/src/lib.rs:705-714 | engine/packages/pegboard-gateway2/src/lib.rs:1013-1027 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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–14 lines × 2) engine/packages/universalpubsub/src/driver/memory/mod.rs:50— engine/packages/universalpubsub/src/driver/memory/mod.rs:50-63 | engine/packages/universalpubsub/src/pubsub.rs:58-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 5) engine/packages/pegboard/src/workflows/actor/destroy.rs:43— engine/packages/pegboard/src/workflows/actor/destroy.rs:43-55 | engine/packages/pegboard/src/workflows/actor/mod.rs:1139-1151 | engine/packages/pegboard/src/workflows/actor/runtime.rs:694-706 | engine/packages/pegboard/src/workflows/actor/runtime.rs:784-796 | engine/packages/pegboard/src/workflows/actor/runtime.rs:918-930 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12–13 lines × 5) engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:40— engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs:40-51 | engine/packages/pegboard-gateway2/src/hibernation_task.rs:64-75 | engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs:43-55 | engine/packages/pegboard-gateway3/src/hibernation_task.rs:64-75 | engine/packages/pegboard-gateway3/src/tunnel_to_ws_task.rs:43-55 — before extracting anything, compare `engine/packages/pegboard-gateway/src/tunnel_to_ws_task.rs` and `engine/packages/pegboard-gateway2/src/tunnel_to_ws_task.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 (10–13 lines × 3) engine/packages/pegboard-gateway/src/lib.rs:335— engine/packages/pegboard-gateway/src/lib.rs:335-344 | engine/packages/pegboard-gateway2/src/lib.rs:521-533 | engine/packages/pegboard-gateway3/src/lib.rs:267-279 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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–13 lines × 3) engine/packages/pegboard-gateway/src/shared_state.rs:408— engine/packages/pegboard-gateway/src/shared_state.rs:408-418 | engine/packages/pegboard-gateway2/src/shared_state.rs:243-255 | engine/packages/pegboard-gateway3/src/shared_state.rs:256-268 — before extracting anything, compare `engine/packages/pegboard-gateway/src/shared_state.rs` and `engine/packages/pegboard-gateway2/src/shared_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (10–13 lines × 2) engine/packages/pegboard-gateway3/src/http_stream/handler.rs:87— engine/packages/pegboard-gateway3/src/http_stream/handler.rs:87-96 | engine/packages/pegboard-gateway3/src/lib.rs:140-152 — 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–12 lines × 3) engine/packages/api-public/src/actors/create.rs:61— engine/packages/api-public/src/actors/create.rs:61-71 | engine/packages/api-public/src/actors/get_or_create.rs:69-79 | engine/packages/api-public/src/runner_configs/refresh_metadata.rs:75-86 — 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 (11–12 lines × 2) engine/sdks/rust/envoy-client/src/metrics.rs:187— engine/sdks/rust/envoy-client/src/metrics.rs:187-198 | engine/sdks/rust/envoy-client/src/metrics.rs:216-226 — both copies are in the same file, so extract the block into 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 × 5) engine/packages/pegboard-gateway/src/lib.rs:546— engine/packages/pegboard-gateway/src/lib.rs:546-556 | engine/packages/pegboard-gateway2/src/lib.rs:797-807 | engine/packages/pegboard-gateway2/src/lib.rs:1146-1156 | engine/packages/pegboard-gateway3/src/lib.rs:546-556 | engine/packages/pegboard-gateway3/src/lib.rs:847-857 — before extracting anything, compare `engine/packages/pegboard-gateway/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 440 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 × 4) engine/packages/gasoline/src/db/kv/debug.rs:2428— engine/packages/gasoline/src/db/kv/debug.rs:2428-2438 | engine/packages/gasoline/src/db/kv/debug.rs:2458-2468 | engine/packages/gasoline/src/db/kv/debug.rs:2490-2500 | engine/packages/gasoline/src/db/kv/debug.rs:2525-2535 — 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 (5–11 lines × 2) engine/packages/pegboard/src/workflows/actor/runtime.rs:245— engine/packages/pegboard/src/workflows/actor/runtime.rs:245-255 | engine/packages/pegboard/src/workflows/actor2/runtime.rs:209-213 — `engine/packages/pegboard/src/workflows/actor/runtime.rs` and `engine/packages/pegboard/src/workflows/actor2/runtime.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–11 lines × 2) engine/packages/pegboard-envoy/src/lib.rs:226— engine/packages/pegboard-envoy/src/lib.rs:226-236 | engine/packages/pegboard-runner/src/lib.rs:141-149 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-runner/src/lib.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 118 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–11 lines × 2) engine/packages/universaldb/src/tx_ops.rs:370— engine/packages/universaldb/src/tx_ops.rs:370-377 | engine/packages/universaldb/src/tx_ops.rs:500-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 (10–11 lines × 2) rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:93— rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:93-103 | rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:142-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 3) engine/packages/depot/src/conveyer/branch/shared.rs:74— engine/packages/depot/src/conveyer/branch/shared.rs:74-81 | engine/packages/depot/src/conveyer/read/tx.rs:22-31 | engine/packages/depot/src/conveyer/read/tx.rs:60-69 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 8) engine/packages/depot/src/conveyer/branch/shared.rs:76— engine/packages/depot/src/conveyer/branch/shared.rs:76-84 | engine/packages/depot/src/conveyer/commit/helpers.rs:42-50 | engine/packages/depot/src/conveyer/debug.rs:331-339 | engine/packages/depot/src/conveyer/history_pin.rs:159-167 | engine/packages/depot/src/conveyer/pitr_interval.rs:144-152 | engine/packages/depot/src/conveyer/read/tx.rs:26-34 | engine/packages/depot/src/conveyer/read/tx.rs:64-72 | engine/packages/depot/src/gc/mod.rs:345-353 — before extracting anything, compare `engine/packages/depot/src/conveyer/history_pin.rs` and `engine/packages/depot/src/conveyer/pitr_interval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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–9 lines × 6) engine/packages/pegboard/src/workflows/actor/destroy.rs:42— engine/packages/pegboard/src/workflows/actor/destroy.rs:42-50 | engine/packages/pegboard/src/workflows/actor/mod.rs:1138-1146 | engine/packages/pegboard/src/workflows/actor/runtime.rs:693-701 | engine/packages/pegboard/src/workflows/actor/runtime.rs:783-791 | engine/packages/pegboard/src/workflows/actor/runtime.rs:917-925 | engine/packages/pegboard/src/workflows/actor/runtime.rs:1028-1034 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6–9 lines × 4) engine/packages/pegboard-envoy/src/lib.rs:223— engine/packages/pegboard-envoy/src/lib.rs:223-231 | engine/packages/pegboard-gateway2/src/lib.rs:682-688 | engine/packages/pegboard-gateway3/src/lib.rs:427-433 | engine/packages/pegboard-runner/src/lib.rs:140-145 — before extracting anything, compare `engine/packages/pegboard-envoy/src/lib.rs` and `engine/packages/pegboard-gateway2/src/lib.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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–9 lines × 3) engine/packages/api-peer/src/actors/get_or_create.rs:27— engine/packages/api-peer/src/actors/get_or_create.rs:27-35 | engine/packages/api-peer/src/runner_configs.rs:155-162 | engine/packages/api-peer/src/runners.rs:85-93 — 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–9 lines × 3) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:941— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:941-947 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:951-957 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1384-1392 — 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–9 lines × 2) engine/sdks/rust/envoy-client/src/stringify.rs:78— engine/sdks/rust/envoy-client/src/stringify.rs:78-86 | engine/sdks/rust/envoy-client/src/stringify.rs:146-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 5) engine/packages/depot/src/compaction/shared.rs:3542— engine/packages/depot/src/compaction/shared.rs:3542-3549 | engine/packages/depot/src/conveyer/debug.rs:322-329 | engine/packages/depot/src/conveyer/history_pin.rs:150-157 | engine/packages/depot/src/conveyer/pitr_interval.rs:135-142 | engine/packages/depot/src/gc/mod.rs:336-343 — before extracting anything, compare `engine/packages/depot/src/conveyer/history_pin.rs` and `engine/packages/depot/src/conveyer/pitr_interval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 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 × 4) engine/packages/api-peer/src/actors/list.rs:37— engine/packages/api-peer/src/actors/list.rs:37-45 | engine/packages/api-peer/src/actors/list.rs:84-91 | engine/packages/api-peer/src/actors/list_names.rs:21-28 | engine/packages/api-public/src/actors/list.rs:140-147 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6–8 lines × 2) engine/sdks/rust/envoy-client/src/tunnel.rs:675— engine/sdks/rust/envoy-client/src/tunnel.rs:675-682 | engine/sdks/rust/envoy-client/src/tunnel.rs:698-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 8) engine/packages/gasoline/src/db/kv/keys/history.rs:1873— engine/packages/gasoline/src/db/kv/keys/history.rs:1873-1877 | engine/packages/gasoline/src/db/kv/keys/history.rs:1945-1949 | engine/packages/gasoline/src/db/kv/keys/history.rs:1986-1990 | engine/packages/gasoline/src/db/kv/keys/history.rs:1997-2001 | engine/packages/gasoline/src/db/kv/keys/history.rs:2063-2067 | engine/packages/gasoline/src/db/kv/keys/history.rs:2104-2108 | engine/packages/gasoline/src/db/kv/keys/history.rs:2114-2118 | engine/packages/gasoline/src/db/kv/keys/history.rs:2159-2163 — all 8 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 (37 lines × 4) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:719— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:719-755 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:720-756 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:779-815 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:787-823 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (53 lines × 2) engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:1119— engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:1119-1171 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:1116-1168 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 13) engine/packages/depot/src/conveyer/types/branch.rs:130— engine/packages/depot/src/conveyer/types/branch.rs:130-134 | engine/packages/depot/src/conveyer/types/branch.rs:192-196 | engine/packages/depot/src/conveyer/types/branch.rs:223-227 | engine/packages/depot/src/conveyer/types/branch.rs:254-258 | engine/packages/depot/src/conveyer/types/compaction.rs:156-160 | engine/packages/depot/src/conveyer/types/history_pin.rs:51-55 | engine/packages/depot/src/conveyer/types/policy.rs:70-74 | engine/packages/depot/src/conveyer/types/policy.rs:97-101 | engine/packages/depot/src/conveyer/types/restore_points.rs:169-173 | engine/packages/depot/src/conveyer/types/storage.rs:61-65 | engine/packages/depot/src/conveyer/types/storage.rs:177-181 | engine/packages/depot/src/conveyer/types/storage.rs:208-212 | engine/packages/depot/src/conveyer/types/storage.rs:239-243 — there are 13 copies across 6 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 13 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 5) engine/packages/datacenter/src/keys.rs:44— engine/packages/datacenter/src/keys.rs:44-49 | engine/packages/datacenter/src/keys.rs:88-93 | engine/packages/namespace/src/keys/mod.rs:50-56 | engine/packages/namespace/src/keys/mod.rs:94-100 | engine/packages/namespace/src/keys/mod.rs:139-144 — 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.
Duplicated block (11 lines × 12) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:80— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:80-90 | engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:92-102 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:81-91 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:93-103 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:80-90 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:92-102 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:88-98 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:100-110 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:80-90 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:92-102 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:80-90 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:92-102 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:171— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:171-180 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:172-181 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:171-180 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:179-188 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:171-180 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:171-180 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 7) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:502— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:502-507 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:503-508 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:587-592 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:562-567 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:570-575 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:674-679 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:674-679 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 6) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:519— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:519-529 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:520-530 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:579-589 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:587-597 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:691-701 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:691-701 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 12) engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:828— engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:828-832 | engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs:944-948 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:829-833 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs:953-957 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:888-892 | engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v7.rs:1018-1022 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:896-900 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v6.rs:1035-1039 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:1015-1019 | engine/sdks/rust/envoy-protocol/src/versioned/v7_to_v8.rs:1187-1191 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:1012-1016 | engine/sdks/rust/envoy-protocol/src/versioned/v8_to_v7.rs:1184-1188 — before extracting anything, compare `engine/sdks/rust/envoy-protocol/src/versioned/v5_to_v6.rs` and `engine/sdks/rust/envoy-protocol/src/versioned/v6_to_v5.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (16 lines × 4) engine/packages/gasoline/src/history/cursor.rs:182— engine/packages/gasoline/src/history/cursor.rs:182-197 | engine/packages/gasoline/src/history/cursor.rs:228-243 | engine/packages/gasoline/src/history/cursor.rs:274-289 | engine/packages/gasoline/src/history/cursor.rs:320-335 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 5) engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:254— engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:254-268 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:322-336 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:380-394 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:410-423 | engine/packages/pegboard-runner/src/ws_to_tunnel_task.rs:437-451 — 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.
Duplicated block (11 lines × 9) engine/packages/depot/src/workflows/db_hot_compactor.rs:316— engine/packages/depot/src/workflows/db_hot_compactor.rs:316-327 | engine/packages/depot/src/workflows/db_hot_compactor.rs:943-953 | engine/packages/depot/src/workflows/db_hot_compactor.rs:1356-1366 | engine/packages/depot/src/workflows/db_reclaimer.rs:157-167 | engine/packages/depot/src/workflows/db_reclaimer.rs:421-431 | engine/packages/depot/src/workflows/db_reclaimer.rs:683-693 | engine/packages/depot/src/workflows/db_reclaimer.rs:1130-1140 | engine/packages/depot/src/workflows/db_reclaimer.rs:1258-1268 | engine/packages/depot/src/workflows/db_reclaimer.rs:1342-1352 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 7) engine/packages/gasoline/src/db/kv/keys/history.rs:637— engine/packages/gasoline/src/db/kv/keys/history.rs:637-645 | engine/packages/gasoline/src/db/kv/keys/history.rs:753-761 | engine/packages/gasoline/src/db/kv/keys/history.rs:1479-1487 | engine/packages/gasoline/src/db/kv/keys/signal.rs:38-46 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:182-190 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:269-277 | engine/packages/gasoline/src/db/kv/keys/workflow.rs:356-364 — before extracting anything, compare `engine/packages/gasoline/src/db/kv/keys/history.rs` and `engine/packages/gasoline/src/db/kv/keys/workflow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 (4–5 lines × 12) engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:137— engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:137-140 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:303-306 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:469-472 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:635-638 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:801-804 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:967-970 | rivetkit-rust/packages/actor-persist/src/versioned.rs:29-32 | rivetkit-rust/packages/client-protocol/src/versioned.rs:31-35 | rivetkit-rust/packages/client-protocol/src/versioned.rs:414-417 | rivetkit-rust/packages/client-protocol/src/versioned.rs:624-628 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:37-40 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:324-327 — there are 12 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 12 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–5 lines × 8) engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:140— engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:140-142 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:306-308 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:472-474 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:638-640 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:804-806 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:970-972 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:42-46 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:329-333 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 6) engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:153— engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:153-161 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:319-327 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:485-493 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:651-659 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:817-825 | engine/sdks/rust/envoy-protocol/src/versioned/mod.rs:983-991 — 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.
Duplicated block (16 lines × 5) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:129— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:129-144 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:178-193 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:204-219 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:235-250 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:267-282 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 6) rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:228— rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:228-241 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:289-302 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:321-334 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:358-371 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:396-409 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:426-439 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:228` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 7) rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:216— rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:216-226 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:245-255 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:277-287 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:309-319 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:346-356 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:384-394 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:414-424 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — engine/sdks/typescript/envoy-protocol/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 4 sibling directories (14 clone groups) engine/sdks/typescript/runner/src/mod.ts:1— 14 duplicated blocks under the repository root have copies in at least two of the sibling directories engine, rivetkit-typescript, scripts, shared — 12 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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.
Duplication concentrated across 8 sibling directories (14 clone groups) rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12— 14 duplicated blocks under rivetkit-typescript/packages/ have copies in at least two of the sibling directories cli, cloudflare-workers, effect, engine-cli, rivetkit, supabase (+2 more sibling(s) not listed) — 11 of them are reported below, and 3 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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.
Duplication concentrated across 9 sibling directories (12 clone groups) REDACTED:18— 12 duplicated blocks under rivetkit-typescript/packages/rivetkit/src/ have copies in at least two of the sibling directories actor, client, common, db, engine-client, inspector (+3 more sibling(s) not listed) — 7 of them are reported below, and 5 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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.
Duplication concentrated across 4 sibling directories (5 clone groups) scripts/api/runner-configs/list.ts:5— 5 duplicated blocks under scripts/api/ have copies in at least two of the sibling directories actors, gateway, runner-configs, runners — 4 of them are reported below, and 1 is 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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.
Wholesale file copy (1074 identical lines × 2 files) engine/sdks/typescript/runner/src/mod.ts:1— engine/sdks/typescript/runner/src/mod.ts:1 · rivetkit-typescript/packages/engine-runner/src/mod.ts:1 — these 2 files are line-for-line copies of one another — 1074 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.
Wholesale file copy (607 identical lines × 2 files) engine/sdks/typescript/runner/src/tunnel.ts:1— engine/sdks/typescript/runner/src/tunnel.ts:1 · rivetkit-typescript/packages/engine-runner/src/tunnel.ts:1 — these 2 files are line-for-line copies of one another — 607 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.
Wholesale file copy (216 identical lines × 2 files) engine/sdks/typescript/runner/src/stringify.ts:1— engine/sdks/typescript/runner/src/stringify.ts:1 · rivetkit-typescript/packages/engine-runner/src/stringify.ts:1 — these 2 files are line-for-line copies of one another — 216 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 (195 matched lines × 2 locations) · ×1
Duplicated block with local edits (195 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v1.ts:4— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v1.ts:4 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts:4 — the two spans are one implementation copied and then locally edited — 1125 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.
Wholesale file copy (166 identical lines × 2 files) engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts:2— engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts:2 · rivetkit-typescript/packages/engine-runner/src/websocket-tunnel-adapter.ts:2 — these 2 files are line-for-line copies of one another — 166 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.
Duplicated block (157 lines × 2 locations) integrations/workflow-world/scripts/conformance/run.ts:56— integrations/workflow-world/scripts/conformance/run.ts:56 · integrations/workflow-world/scripts/integration/run.ts:76 — 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.
Wholesale file copy (141 identical lines × 2 files) engine/sdks/typescript/runner/src/actor.ts:1— engine/sdks/typescript/runner/src/actor.ts:1 · rivetkit-typescript/packages/engine-runner/src/actor.ts:1 — these 2 files are line-for-line copies of one another — 141 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 (115 matched lines × 2 locations) · ×1
Duplicated block with local edits (115 matched lines × 2 locations) rivetkit-typescript/packages/workflow-engine/src/context.ts:2004— rivetkit-typescript/packages/workflow-engine/src/context.ts:2004 · rivetkit-typescript/packages/workflow-engine/src/context.ts:2216 — the two spans are one implementation copied and then locally edited — 546 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 with local edits (106 matched lines × 2 locations) · ×1
Duplicated block with local edits (106 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts:93— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts:93 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:498 — the two spans are one implementation copied and then locally edited — 528 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.
Wholesale file copy (86 identical lines × 2 files) engine/sdks/typescript/runner/src/utils.ts:1— engine/sdks/typescript/runner/src/utils.ts:1 · rivetkit-typescript/packages/engine-runner/src/utils.ts:1 — these 2 files are line-for-line copies of one another — 86 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 (81 matched lines × 2 locations) · ×1
Duplicated block with local edits (81 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:533— rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:533 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:382 — the two spans are one implementation copied and then locally edited — 465 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (70 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:96— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:96 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:98 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (66 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1986— rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1986 · rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2085 — all 2 copies are in the same file, 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.
Wholesale file copy (60 identical lines × 2 files) rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12— rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12 · rivetkit-typescript/packages/workflow-engine/scripts/compile-bare.ts:15 — these 2 files are line-for-line copies of one another — 60 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 (53 matched lines × 2 locations) · ×1
Duplicated block with local edits (53 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:977— rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:977 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:948 — the two spans are one implementation copied and then locally edited — 290 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (52 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/inspector/client.browser.ts:293— rivetkit-typescript/packages/rivetkit/src/inspector/client.browser.ts:293 · rivetkit-typescript/packages/rivetkit/src/inspector/client.browser.ts:346 — 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 (51 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:214— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:214 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) rivetkit-typescript/packages/cli/index.js:6— rivetkit-typescript/packages/cli/index.js:6 · rivetkit-typescript/packages/engine-cli/index.js:18 — the two spans are one implementation copied and then locally edited — 263 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 (46 matched lines × 2 locations) · ×1
Duplicated block with local edits (46 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:259— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:259 · rivetkit-typescript/packages/rivetkit/src/workflow/mod.ts:109 — the two spans are one implementation copied and then locally edited — 108 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (43 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:179— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:179 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:181 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (40 lines × 3 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:127— rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:127 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:184 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:231 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (34 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:132— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:132 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:167 — all 2 copies are in the same file, 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.
Duplicated block (31 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2161— rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2161 · rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:167 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (29 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:234— rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts:234 · rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts:236 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (28 lines × 23 locations) rivetkit-typescript/packages/effect/src/RivetError.ts:11— rivetkit-typescript/packages/effect/src/RivetError.ts:11 · rivetkit-typescript/packages/effect/src/RivetError.ts:46 · rivetkit-typescript/packages/effect/src/RivetError.ts:81 · rivetkit-typescript/packages/effect/src/RivetError.ts:116 · +19 more site(s) not listed — all 23 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication· Duplicated block with local edits (28 matched lines × 2 locations) · ×1
Duplicated block with local edits (28 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:920— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:920 · rivetkit-typescript/packages/rivetkit/src/client/utils.ts:181 — the two spans are one implementation copied and then locally edited — 133 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 89, cognitive 177) · ×1
Complex function main (cyclomatic 89, cognitive 177) scripts/debug/logfmt_to_gantt.ts:104— main has cyclomatic complexity 89 and cognitive complexity 177; 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.
Complex function (anonymous) (cyclomatic 87, cognitive 127) integrations/workflow-world/src/actors/workflow-run.ts:568— (anonymous) has cyclomatic complexity 87 and cognitive complexity 127; 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.
Complex function (anonymous) (cyclomatic 72, cognitive 89) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4148— (anonymous) has cyclomatic complexity 72 and cognitive complexity 89; 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.
Complex function assertJsonCompatValue (cyclomatic 42, cognitive 46) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:77— assertJsonCompatValue has cyclomatic complexity 42 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeLoop (cyclomatic 33, cognitive 55) rivetkit-typescript/packages/workflow-engine/src/context.ts:1150— executeLoop has cyclomatic complexity 33 and cognitive complexity 55; 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.
Complex function (anonymous) (cyclomatic 33, cognitive 29) rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:309— (anonymous) has cyclomatic complexity 33 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.
Complex function executeStep (cyclomatic 32, cognitive 47) rivetkit-typescript/packages/workflow-engine/src/context.ts:790— executeStep has cyclomatic complexity 32 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 main (cyclomatic 32, cognitive 46) · ×1
Complex function main (cyclomatic 32, cognitive 46) scripts/skill-evals/src/index.ts:557— main has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeRace (cyclomatic 30, cognitive 44) rivetkit-typescript/packages/workflow-engine/src/context.ts:2228— executeRace has cyclomatic complexity 30 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildNativeFactory (cyclomatic 29, cognitive 26) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4033— buildNativeFactory has cyclomatic complexity 29 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function bumpPackageJsons (cyclomatic 28, cognitive 70) scripts/publish/src/lib/version.ts:187— bumpPackageJsons has cyclomatic complexity 28 and cognitive complexity 70; 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.
Complex function executeWorkflow (cyclomatic 26, cognitive 44) rivetkit-typescript/packages/workflow-engine/src/index.ts:953— executeWorkflow has cyclomatic complexity 26 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function encodeJsonCompatValue (cyclomatic 25, cognitive 27) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:280— encodeJsonCompatValue has cyclomatic complexity 25 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function create (cyclomatic 23, cognitive 36) integrations/workflow-world/src/index.ts:340— create has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function flush (cyclomatic 23, cognitive 29) rivetkit-typescript/packages/workflow-engine/src/storage.ts:240— flush has cyclomatic complexity 23 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 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.
Complex function collectTurnText (cyclomatic 22, cognitive 50) scripts/skill-evals/src/index.ts:243— collectTurnText has cyclomatic complexity 22 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function convertExpr (cyclomatic 21, cognitive 27) scripts/vbare-gen-converters/index.ts:182— convertExpr has cyclomatic complexity 21 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function decodeOne (cyclomatic 21, cognitive 20) scripts/debug/decode_fdb_tuple.js:140— decodeOne has cyclomatic complexity 21 and cognitive complexity 20; 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.
Complex function unwrapDeep (cyclomatic 20, cognitive 35) rivetkit-typescript/packages/rivetkit/src/registry/write-through-proxy.ts:63— unwrapDeep has cyclomatic complexity 20 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function createPlatformServerlessRunner (cyclomatic 20, cognitive 18) rivetkit-typescript/packages/rivetkit/tests/platforms/shared-platform-harness.ts:480— createPlatformServerlessRunner has cyclomatic complexity 20 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Large Files — 47 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: rivetkit-typescript/packages/rivetkit/src/registry/native.ts (5324), rivetkit-typescript/packages/workflow-engine/src/context.ts (2389), rivetkit-typescript/packages/rivetkit/src/actor/config.ts (2345), engine/sdks/typescript/runner/src/mod.ts (1714), rivetkit-typescript/packages/engine-runner/src/mod.ts (1678), rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts (1443) (+41 more).
R6 · Tooling· The declared test suite includes a file that cannot be loaded · ×1
The declared test suite includes a file that cannot be loaded engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts— This repository declares test tooling, and the ✓ above records that declaration — but engine/sdks/typescript/envoy-protocol/tests/http-abort-golden.test.ts and 27 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
Dead file (~407 LoC) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts— no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.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
Dead file (~320 LoC) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v2.ts— no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.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
Dead file (~284 LoC) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v3.ts— no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.ts, rivetkit-typescript/packages/rivetkit/src/common/actor-persist.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
Dead file (~267 LoC) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v1.ts— no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.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
Dead file (~217 LoC) rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~177 LoC) rivetkit-typescript/packages/rivetkit/runtime/index.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~83 LoC) rivetkit-typescript/packages/rivetkit/src/utils/router.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~75 LoC) rivetkit-typescript/packages/react/src/mod.typecheck.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~64 LoC) rivetkit-typescript/packages/rivetkit/src/dynamic/isolate-runtime.ts— no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/dynamic/instance.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
Dead file (~57 LoC) rivetkit-typescript/packages/rivetkit/src/common/cors.ts— no import path from any entry point (161 application, 68 tooling, 414 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (rivetkit-typescript/packages/rivetkit/src/utils/router.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
Dead file (~54 LoC) scripts/run/k8s/build-frontend-icons.mjs— no import path from any entry point (161 application, 68 tooling, 414 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 (~47 LoC) rivetkit-typescript/packages/rivetkit/scripts/drizzle-compat-smoke.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~44 LoC) rivetkit-typescript/packages/rivetkit/src/common/eventsource.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~32 LoC) rivetkit-typescript/packages/rivetkit/src/dynamic/instance.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~31 LoC) integrations/workflow-world/src/runtime.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~27 LoC) rivetkit-typescript/packages/rivetkit/src/common/log-levels.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~26 LoC) rivetkit-typescript/packages/rivetkit/src/devtools-loader/serve-devtools.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~24 LoC) docker/compute-hello-world/server.js— no import path from any entry point (161 application, 68 tooling, 414 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 (~13 LoC) rivetkit-typescript/packages/rivetkit-napi/scripts/actor-context-smoke.mjs— no import path from any entry point (161 application, 68 tooling, 414 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 (~6 LoC) self-host/workers/vercel/route.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~3 LoC) scripts/rivetkit/utils.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~2 LoC) rivetkit-typescript/packages/rivetkit/src/common/network.ts— no import path from any entry point (161 application, 68 tooling, 414 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 (~0 LoC) rivetkit-typescript/packages/rivetkit/src/client/test.ts— no import path from any entry point (161 application, 68 tooling, 414 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
Unused dependency 'zx' — Declared in the root package.json 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.
Unused dependency 'tinybench' — Declared in engine/sdks/typescript/test-runner/package.json 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.
Unused dependency '@codemirror/merge' — Declared in frontend/package.json 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.
Third-party script without Subresource Integrity frontend/index.html:4— `https://analytics.ahrefs.com/analytics.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×1
NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Duplicated predicate .claude/skills/create-launch-post/scripts/render-launch-images.ts:46— `!key?.startsWith("--") || value === undefined` appears character-identically in 3 files — .claude/skills/create-launch-post/scripts/render-launch-images.ts, .claude/skills/create-launch-post/scripts/render-technical-image.ts, .claude/skills/create-launch-post/scripts/render-tile-images.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/api/runner-configs/delete.ts:20— `(await rl.question("Namespace (default: default): ")) || "default"` appears character-identically in 3 files — scripts/api/runner-configs/delete.ts, scripts/api/runner-configs/list.ts, scripts/api/runners/list.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/mdx/code-buttons.tsx:17— `codeGroup?.querySelector("[data-state=active] .code") ?.textContent || codeGroup?.querySelector(".code")?.textContent` appears character-identically in 2 files — frontend/packages/components/src/mdx/code-buttons.tsx, frontend/src/components/mdx/code-buttons.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/grid-columns.ts:34— `columns && getResponsiveValue(columns, "grid-cols")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/grid-columns.ts, frontend/src/components/ui/helpers/grid-columns.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/filters.tsx:102— `definition.type === "select" && Array.isArray(definition.options)` appears character-identically in 2 files — frontend/packages/components/src/ui/filters.tsx, frontend/src/components/ui/filters.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/flex-direction.ts:30— `direction && getResponsiveValue(direction, "flex")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/flex-direction.ts, frontend/src/components/ui/helpers/flex-direction.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/flex.ts:23— `flex && getResponsiveValue(flex, "flex")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/flex.ts, frontend/src/components/ui/helpers/flex.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/align-items.ts:31— `items && getResponsiveValue(items, "items")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/align-items.ts, frontend/src/components/ui/helpers/align-items.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/justify-content.ts:31— `justify && getResponsiveValue(justify, "justify")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/justify-content.ts, frontend/src/components/ui/helpers/justify-content.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/app/data-providers/engine-data-provider.tsx:822— `ls.engineCredentials.get(getConfig().apiUrl) || ""` appears character-identically in 2 files — frontend/src/app/data-providers/engine-data-provider.tsx, frontend/src/routes/_context.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/min-height.ts:35— `minH && getResponsiveValue(minH, "min-h")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/min-height.ts, frontend/src/components/ui/helpers/min-height.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/min-width.ts:36— `minW && getResponsiveValue(minW, "min-w")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/min-width.ts, frontend/src/components/ui/helpers/min-width.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/api/actors/create.ts:16— `process.env.RIVET_ENDPOINT || (await rl.question("Rivet Endpoint (default: http://localhost:6420): ")) || "http://localhost:6420"` appears character-identically in 4 files — scripts/api/actors/create.ts, scripts/api/runner-configs/delete.ts, scripts/api/runner-configs/list.ts, scripts/api/runners/list.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/api/actors/create.ts:11— `process.env.RIVET_TOKEN || (await rl.question("Rivet Token (default: default): ")).trim() || "default"` appears character-identically in 4 files — scripts/api/actors/create.ts, scripts/api/runner-configs/delete.ts, scripts/api/runner-configs/list.ts, scripts/api/runners/list.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/packages/components/src/ui/helpers/text-align.ts:23— `textAlign && getResponsiveValue(textAlign, "text")` appears character-identically in 2 files — frontend/packages/components/src/ui/helpers/text-align.ts, frontend/src/components/ui/helpers/text-align.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/app/context-switcher.tsx:753— `typeof leafFullPath === "string" && leafFullPath.startsWith(namespaceBase)` appears character-identically in 2 files — frontend/src/app/context-switcher.tsx, frontend/src/app/layout.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:332— `typeof opts === "string" || typeof opts !== "object" || opts === null || !("name" in opts)` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts, rivetkit-typescript/packages/rivetkit/src/client/actor-handle.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 rivetkit-typescript/packages/rivetkit/src/actor/actions.ts:146— `typeof value !== "object" || value === null || Array.isArray(value)` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit/src/actor/actions.ts, rivetkit-typescript/packages/rivetkit/src/actor/config.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 rivetkit-typescript/packages/cli/index.js:53— `typeof version === "string" && version.startsWith("0.0.0-")` appears character-identically in 2 files — rivetkit-typescript/packages/cli/index.js, rivetkit-typescript/packages/engine-cli/index.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/app/forms/create-namespace-form.tsx:18— `value.trim() !== "" && value.trim() === value` appears character-identically in 2 files — frontend/src/app/forms/create-namespace-form.tsx, frontend/src/app/forms/create-project-form.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:369— `host == "localhost" || host.ends_with(".localhost")` appears character-identically in 2 files — rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs, rivetkit-rust/packages/rivetkit-core/src/registry/runner_config.rs. 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 71 significant file(s) lose their only recent owner: engine/packages/depot-client/src/vfs.rs, rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs, rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs, rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs, integrations/workflow-world/src/actors/workflow-run.ts, rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs, rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs, rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs (+63 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 45 significant file(s) lose their only recent owner: engine/packages/gasoline/src/db/kv/debug.rs, engine/packages/gasoline/src/db/kv/keys/history.rs, engine/packages/gasoline/src/ctx/workflow.rs, engine/packages/gasoline/src/db/kv/keys/workflow.rs, engine/packages/universaldb/src/driver/postgres/resolver/mod.rs, engine/packages/pegboard/src/workflows/runner2.rs, engine/packages/gasoline/src/history/cursor.rs, engine/packages/gasoline/src/db/debug.rs (+37 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 11 significant file(s) lose their only recent owner: container-runner/src/main.rs, container-runner/src/actor.rs, engine/packages/cli/src/util.rs, rivetkit-rust/packages/client/src/protocol/codec.rs, container-runner/src/monitor.rs, engine/packages/cli/src/commands/pool.rs, engine/packages/cli/src/commands/deploy.rs, container-runner/src/child.rs (+3 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 7 significant file(s) lose their only recent owner: rivetkit-typescript/packages/effect/src/RivetError.ts, rivetkit-typescript/packages/effect/src/Actor.ts, rivetkit-typescript/packages/effect/src/State.ts, rivetkit-typescript/packages/effect/src/Registry.ts, rivetkit-typescript/packages/effect/src/Client.ts, rivetkit-typescript/packages/effect/src/Action.ts, rivetkit-typescript/packages/effect/src/internal/logging.ts. Pair on, review, or document these before any departure.
Subsumed condition operand engine/packages/depot-client/tests/inline/vfs.rs:3681— `err.contains("disk I/O")` can never decide this `||` — every value satisfying `err.contains("disk I/O")` also satisfies `err.contains("I/O")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/packages/depot-client/tests/inline/vfs.rs:3814— `err.contains("disk I/O")` can never decide this `||` — every value satisfying `err.contains("disk I/O")` also satisfies `err.contains("I/O")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (135 single-owned of 741 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 741 of the 1314 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
Documentation: no project overview README.md— The opening paragraph describes Rivet Actors as 'long-running, lightweight processes designed for stateful workloads' but does not explain what the project is or what it does beyond its own description. Expand the overview to define Rivet Actors and their role in durable execution, plus a one-paragraph problem statement motivating them.
Split engine/packages/pegboard — A sprawling pegboard whose 15 namespaces are all named ops/workflows/actor/*, a single cohesive layer sprawled across many unrelated sub-areas. Suggested: split into focused workflow/actor and ops runner bundles
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No seccomp profile — Workloads do not set a seccomp profile (RuntimeDefault or a Localhost profile). Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No AppArmor/SELinux confinement — Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp's syscall filter.
M2 · Architecture documentation· ADRs not easily discoverable · ×1
ADRs not easily discoverable — 3 ADR-shaped document(s) detected by content — `docs-internal/engine/sqlite/constraints-and-design-decisions.md`, `docs-internal/rivetkit-typescript/sqlite-ltx/archive/constraints.md`, `docs-internal/rivetkit-typescript/sqlite-ltx/archive/design-decisions.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
Logging is not universal — Only 59/64 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `rivetkit-typescript/packages/cli`, `rivetkit-typescript/packages/mcp-hub`, `rivetkit-typescript/packages/supabase`.
R7 · Dead Code· Unused export 'makeTracesKey' · ×1
Unused export 'makeTracesKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:163— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'tracesStoragePrefix' · ×1
Unused export 'tracesStoragePrefix' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:171— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'queueStoragePrefix' · ×1
Unused export 'queueStoragePrefix' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:175— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'queueMetadataKey' · ×1
Unused export 'queueMetadataKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:179— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'queueMessagesPrefix' · ×1
Unused export 'queueMessagesPrefix' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:183— Nothing imports this binding — it is safe to review for removal.
Unused export 'makeConnKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:187— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'makeQueueMessageKey' · ×1
Unused export 'makeQueueMessageKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:196— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'decodeQueueMessageKey' · ×1
Unused export 'decodeQueueMessageKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:204— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'validateSchema' · ×1
Unused export 'validateSchema' rivetkit-typescript/packages/rivetkit/src/actor/schema.ts:232— Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene· Type-only dependency 'ws' in production deps · ×1
Type-only dependency 'ws' in production deps engine/sdks/typescript/test-runner/src/index.ts:7— Every import is type-only — move it to devDependencies.
R8 · Dependency Hygiene· Test-only dependency '@rivet-gg/icons' in production deps · ×1
Test-only dependency '@rivet-gg/icons' in production deps frontend/src/app/settings-pages/settings-card.stories.tsx:2— Only test files import it — move it to devDependencies.
No security response headers detected frontend/Caddyfile:13— No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found — defense in depth, even when a reverse proxy could set them. This is reported because `Caddyfile` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
Skipped (documented): should deploy successfully with Rivet Cloud examples/ai-and-user-generated-actors-freestyle/tests/deploy.test.ts:40— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skip
Skipped (documented): should deploy successfully with Rivet Self-Hosted examples/ai-and-user-generated-actors-freestyle/tests/deploy.test.ts:79— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skip
Skipped (documented): scheduled actions persist across actor restarts examples/scheduling/tests/scheduling.test.ts:170— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts:416— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts:491— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-workflow.test.ts:534— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts:230— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts:267— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts:290— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts:309— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) rivetkit-typescript/packages/rivetkit/tests/driver/actor-db.test.ts:1316— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.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.
nuget: not applicable — nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan
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 44 file(s) — `engine/sdks/typescript/runner/src/actor.ts`, `frontend/packages/components/src/matchmaker/lobby-region.tsx`, `frontend/packages/components/src/ping.tsx`, `frontend/packages/components/src/tailwind-base.ts`, `frontend/src/app/forms/create-project-form.tsx`, … (+39 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a0ee9e-96a9-77fd-9fca-33cb63a61d37 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 280 · Warnings: 1999 · Recommendations: 88 · Info: 11 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-09-2026 @ 19:22 UTC.
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.