Public report of rivet-dev/rivet, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 03:31 UTC · Survey ID cd_ae44f5c78c87478382a356f8d158c161
rivet-dev/rivet
Measured 17 November 2026, 03:29 UTC, at code version 319e4d2
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 397,157 lines of product code in 102 projects, tests not counted · Estimated rebuild effort: about 2.4 person-years · Weakest lens: Security and Compliance, 42.1
Findings by how serious they are
188 critical2299 serious139 minor
8 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 03:29 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
82of 82 dimensions measured by tools.
2590of 2626 findings point to an exact file and line, so you can open each one in the code. The other 36 concern the repository as a whole, such as missing documentation.
82dimensions across 8 lenses, read from 397,157 lines of product code in 102 projects.
rivet-dev/rivet is rated At risk because critical security findings are open. Its score is held back because 66 of the dependencies have a known vulnerability and it has passwords or keys in the code's history. It scores 52.3 out of 100, which the At risk rating leaves unchanged.
Security and Compliance, at 42.1, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the runtime or framework that no longer gets security updates, worth about 2.6 points. Replacing the 13 passwords or keys found in the code's history would lift Security and Compliance itself, worth about 4.1 points. Raising Security and Compliance to 70 would lift the score to about 59.7.
Eighty-one known security holes in the packages the code depends on can be used by attackers. Forty-seven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and twenty-seven settings leave the servers or containers unsafe. Updating the vulnerable packages, pinning each tool to an exact version and correcting the unsafe settings would close these risks. Limiting each secret to its own step would fix the five secrets exposed to more of the pipeline than needed, and the 17 passwords or keys in the code's history need replacing, with the old ones switched off. The two loops of files that import each other need breaking.
The product code is 397,157 lines, about €350,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Security and Compliance rose from 42.1 to 70, the lowest score rated Strong, the score would rise from 52.3 to about 59.7.
Code composition: what the lines of code are
Product code 99%Tests 1%
Rebuild cost: about €350,000 · Estimate
Cost to rebuild
€110,000 to €580,000, for 1,916 to 6,078 hours of work, about 2.4 person-years for 1 to 5 engineers
Difficulty of the problem
Low, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 52. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 397,157 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with REDACTED.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
Resolve the 13 REDACTED finding(s) in Secrets (history) — start with REDACTED (11), REDACTED, REDACTED.
Raises the score by about 4.1 points · Medium effort · Secrets (history)
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €350,000 to build again, about 2.4 person-years of work. Its weakest lens is Security and Compliance, at 42.1 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. Of all the actions in this report, it raises the score most for the work it takes: about 2.6 points for low effort, because it clears the 1 Platform End-of-Life findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 471,266 lines over the last 90 days, which is about 1,911,245 lines a year. At that pace, the extra work comes to an estimated 95.6 to 637.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1443 modules, with 3746 dependencies between them. 26 loops run through 217 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1403 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
depot_client.volumes uses depot_client.checkpoints, so a change to depot_client.checkpoints can break depot_client.volumes, while a change to depot_client.volumes can't break depot_client.checkpoints.
Position
Below the diagonal: depot_client.volumes uses a module listed above it, which is the healthy direction.
depot_client.volumes uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_client.volumes, while a change to depot_client.volumes can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_client.volumes uses a module listed above it, which is the healthy direction.
depot_client.volumes uses rivet_topology.worker, so a change to rivet_topology.worker can break depot_client.volumes, while a change to depot_client.volumes can't break rivet_topology.worker.
Position
Below the diagonal: depot_client.volumes uses a module listed above it, which is the healthy direction.
depot_worker.command uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_worker.command, while a change to depot_worker.command can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_worker.command uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.types uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_worker.tablet_maintainer_machine.types, while a change to depot_worker.tablet_maintainer_machine.types can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.types uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.types uses rivet_topology.worker, so a change to rivet_topology.worker can break depot_worker.tablet_maintainer_machine.types, while a change to depot_worker.tablet_maintainer_machine.types can't break rivet_topology.worker.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.types uses a module listed above it, which is the healthy direction.
object_store uses object_store.aws.builder, so a change to object_store.aws.builder can break object_store, while a change to object_store can't break object_store.aws.builder.
Position
Below the diagonal: object_store uses a module listed above it, which is the healthy direction.
object_store uses object_store.path, so a change to object_store.path can break object_store, while a change to object_store can't break object_store.path.
Position
Below the diagonal: object_store uses a module listed above it, which is the healthy direction.
object_store uses object_store.payload, so a change to object_store.payload can break object_store, while a change to object_store can't break object_store.payload.
Position
Below the diagonal: object_store uses a module listed above it, which is the healthy direction.
rivet_env.env uses rivet_env.capabilities.tokio.task, so a change to rivet_env.capabilities.tokio.task can break rivet_env.env, while a change to rivet_env.env can't break rivet_env.capabilities.tokio.task.
Position
Below the diagonal: rivet_env.env uses a module listed above it, which is the healthy direction.
rivet_topology.topology uses rivet_env.capabilities.tokio.task, so a change to rivet_env.capabilities.tokio.task can break rivet_topology.topology, while a change to rivet_topology.topology can't break rivet_env.capabilities.tokio.task.
Position
Below the diagonal: rivet_topology.topology uses a module listed above it, which is the healthy direction.
rivet_topology.topology uses rivet_topology.worker, so a change to rivet_topology.worker can break rivet_topology.topology, while a change to rivet_topology.topology can't break rivet_topology.worker.
Position
Below the diagonal: rivet_topology.topology uses a module listed above it, which is the healthy direction.
rivetkit_core.registry uses rivetkit_core.actor.context, so a change to rivetkit_core.actor.context can break rivetkit_core.registry, while a change to rivetkit_core.registry can't break rivetkit_core.actor.context.
Position
Below the diagonal: rivetkit_core.registry uses a module listed above it, which is the healthy direction.
22→27 slatedb.manifest uses slatedb.db_statepart of a loop✕
Connections
6 pairs of types, where a type in slatedb.manifest uses a type in slatedb.db_state.
slatedb.manifest uses slatedb.db_state, so a change to slatedb.db_state can break slatedb.manifest, while a change to slatedb.manifest can't break slatedb.db_state.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
depot_client.filesystem.client uses depot_client.checkpoints, so a change to depot_client.checkpoints can break depot_client.filesystem.client, while a change to depot_client.filesystem.client can't break depot_client.checkpoints.
Position
Below the diagonal: depot_client.filesystem.client uses a module listed above it, which is the healthy direction.
depot_client.filesystem.client uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_client.filesystem.client, while a change to depot_client.filesystem.client can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_client.filesystem.client uses a module listed above it, which is the healthy direction.
depot_client.filesystem.client uses depot_client.volumes, so a change to depot_client.volumes can break depot_client.filesystem.client, while a change to depot_client.filesystem.client can't break depot_client.volumes.
Position
Below the diagonal: depot_client.filesystem.client uses a module listed above it, which is the healthy direction.
object_store.aws.client uses object_store.aws.builder, so a change to object_store.aws.builder can break object_store.aws.client, while a change to object_store.aws.client can't break object_store.aws.builder.
Position
Below the diagonal: object_store.aws.client uses a module listed above it, which is the healthy direction.
object_store.aws.client uses object_store.path, so a change to object_store.path can break object_store.aws.client, while a change to object_store.aws.client can't break object_store.path.
Position
Below the diagonal: object_store.aws.client uses a module listed above it, which is the healthy direction.
object_store.aws.client uses object_store.payload, so a change to object_store.payload can break object_store.aws.client, while a change to object_store.aws.client can't break object_store.payload.
Position
Below the diagonal: object_store.aws.client uses a module listed above it, which is the healthy direction.
object_store.aws.client uses object_store, so a change to object_store can break object_store.aws.client, while a change to object_store.aws.client can't break object_store.
Position
Below the diagonal: object_store.aws.client uses a module listed above it, which is the healthy direction.
rivet_engine_context.context uses rivet_config, so a change to rivet_config can break rivet_engine_context.context, while a change to rivet_engine_context.context can't break rivet_config.
Position
Below the diagonal: rivet_engine_context.context uses a module listed above it, which is the healthy direction.
rivet_engine_context.context uses rivet_env.capabilities.tokio.task, so a change to rivet_env.capabilities.tokio.task can break rivet_engine_context.context, while a change to rivet_engine_context.context can't break rivet_env.capabilities.tokio.task.
Position
Below the diagonal: rivet_engine_context.context uses a module listed above it, which is the healthy direction.
rivet_engine_context.context uses rivet_topology.worker, so a change to rivet_topology.worker can break rivet_engine_context.context, while a change to rivet_engine_context.context can't break rivet_topology.worker.
Position
Below the diagonal: rivet_engine_context.context uses a module listed above it, which is the healthy direction.
rivet_engine_context.context uses rivet_topology.topology, so a change to rivet_topology.topology can break rivet_engine_context.context, while a change to rivet_engine_context.context can't break rivet_topology.topology.
Position
Below the diagonal: rivet_engine_context.context uses a module listed above it, which is the healthy direction.
rivet_state_machine.state_machine uses rivet_env.env, so a change to rivet_env.env can break rivet_state_machine.state_machine, while a change to rivet_state_machine.state_machine can't break rivet_env.env.
Position
Below the diagonal: rivet_state_machine.state_machine uses a module listed above it, which is the healthy direction.
26→33 rivet_state_machine.state_machine uses rivet_state_machine.effectspart of a loop✕
Connections
1 pair of types, where a type in rivet_state_machine.state_machine uses a type in rivet_state_machine.effects.
rivet_state_machine.state_machine uses rivet_state_machine.effects, so a change to rivet_state_machine.effects can break rivet_state_machine.state_machine, while a change to rivet_state_machine.state_machine can't break rivet_state_machine.effects.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
slatedb.db_state uses slatedb.config, so a change to slatedb.config can break slatedb.db_state, while a change to slatedb.db_state can't break slatedb.config.
Position
Below the diagonal: slatedb.db_state uses a module listed above it, which is the healthy direction.
slatedb.db_state uses slatedb.manifest, so a change to slatedb.manifest can break slatedb.db_state, while a change to slatedb.db_state can't break slatedb.manifest.
Position
Below the diagonal: slatedb.db_state uses a module listed above it, which is the healthy direction.
slatedb.manifest.store uses object_store.path, so a change to object_store.path can break slatedb.manifest.store, while a change to slatedb.manifest.store can't break object_store.path.
Position
Below the diagonal: slatedb.manifest.store uses a module listed above it, which is the healthy direction.
slatedb.manifest.store uses slatedb.config, so a change to slatedb.config can break slatedb.manifest.store, while a change to slatedb.manifest.store can't break slatedb.config.
Position
Below the diagonal: slatedb.manifest.store uses a module listed above it, which is the healthy direction.
slatedb.manifest.store uses slatedb.manifest, so a change to slatedb.manifest can break slatedb.manifest.store, while a change to slatedb.manifest.store can't break slatedb.manifest.
Position
Below the diagonal: slatedb.manifest.store uses a module listed above it, which is the healthy direction.
universalpubsub.pubsub uses object_store.aws.builder, so a change to object_store.aws.builder can break universalpubsub.pubsub, while a change to universalpubsub.pubsub can't break object_store.aws.builder.
Position
Below the diagonal: universalpubsub.pubsub uses a module listed above it, which is the healthy direction.
universalpubsub.pubsub uses rivet_topology.worker, so a change to rivet_topology.worker can break universalpubsub.pubsub, while a change to universalpubsub.pubsub can't break rivet_topology.worker.
Position
Below the diagonal: universalpubsub.pubsub uses a module listed above it, which is the healthy direction.
universalpubsub.pubsub uses rivet_topology.topology, so a change to rivet_topology.topology can break universalpubsub.pubsub, while a change to universalpubsub.pubsub can't break rivet_topology.topology.
Position
Below the diagonal: universalpubsub.pubsub uses a module listed above it, which is the healthy direction.
depot_client uses depot_client.checkpoints, so a change to depot_client.checkpoints can break depot_client, while a change to depot_client can't break depot_client.checkpoints.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_client uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_client, while a change to depot_client can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_client uses rivet_topology.worker, so a change to rivet_topology.worker can break depot_client, while a change to depot_client can't break rivet_topology.worker.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_client uses depot_client.volumes, so a change to depot_client.volumes can break depot_client, while a change to depot_client can't break depot_client.volumes.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_client uses rivet_topology.topology, so a change to rivet_topology.topology can break depot_client, while a change to depot_client can't break rivet_topology.topology.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_client uses depot_client.filesystem.client, so a change to depot_client.filesystem.client can break depot_client, while a change to depot_client can't break depot_client.filesystem.client.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_client uses universalpubsub.pubsub, so a change to universalpubsub.pubsub can break depot_client, while a change to depot_client can't break universalpubsub.pubsub.
Position
Below the diagonal: depot_client uses a module listed above it, which is the healthy direction.
depot_worker.command.volume_host uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_worker.command.volume_host, while a change to depot_worker.command.volume_host can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_worker.command.volume_host uses a module listed above it, which is the healthy direction.
depot_worker.command.volume_host uses rivet_env.capabilities.tokio.task, so a change to rivet_env.capabilities.tokio.task can break depot_worker.command.volume_host, while a change to depot_worker.command.volume_host can't break rivet_env.capabilities.tokio.task.
Position
Below the diagonal: depot_worker.command.volume_host uses a module listed above it, which is the healthy direction.
depot_worker.command.volume_host uses depot_worker.command, so a change to depot_worker.command can break depot_worker.command.volume_host, while a change to depot_worker.command.volume_host can't break depot_worker.command.
Position
Below the diagonal: depot_worker.command.volume_host uses a module listed above it, which is the healthy direction.
depot_worker.command.volume_host uses universalpubsub.pubsub, so a change to universalpubsub.pubsub can break depot_worker.command.volume_host, while a change to depot_worker.command.volume_host can't break universalpubsub.pubsub.
Position
Below the diagonal: depot_worker.command.volume_host uses a module listed above it, which is the healthy direction.
rivet_auth_jwt.key_ring_machine.state uses rivet_state_machine.state_machine, so a change to rivet_state_machine.state_machine can break rivet_auth_jwt.key_ring_machine.state, while a change to rivet_auth_jwt.key_ring_machine.state can't break rivet_state_machine.state_machine.
Position
Below the diagonal: rivet_auth_jwt.key_ring_machine.state uses a module listed above it, which is the healthy direction.
rivet_state_machine.effects uses rivet_env.env, so a change to rivet_env.env can break rivet_state_machine.effects, while a change to rivet_state_machine.effects can't break rivet_env.env.
Position
Below the diagonal: rivet_state_machine.effects uses a module listed above it, which is the healthy direction.
rivet_state_machine.effects uses rivet_state_machine.state_machine, so a change to rivet_state_machine.state_machine can break rivet_state_machine.effects, while a change to rivet_state_machine.effects can't break rivet_state_machine.state_machine.
Position
Below the diagonal: rivet_state_machine.effects uses a module listed above it, which is the healthy direction.
slatedb.tablestore uses object_store.path, so a change to object_store.path can break slatedb.tablestore, while a change to slatedb.tablestore can't break object_store.path.
Position
Below the diagonal: slatedb.tablestore uses a module listed above it, which is the healthy direction.
slatedb.tablestore uses slatedb.types, so a change to slatedb.types can break slatedb.tablestore, while a change to slatedb.tablestore can't break slatedb.types.
Position
Below the diagonal: slatedb.tablestore uses a module listed above it, which is the healthy direction.
slatedb.tablestore uses slatedb.db_state, so a change to slatedb.db_state can break slatedb.tablestore, while a change to slatedb.tablestore can't break slatedb.db_state.
Position
Below the diagonal: slatedb.tablestore uses a module listed above it, which is the healthy direction.
slatedb.wal.slatedb.store uses object_store.path, so a change to object_store.path can break slatedb.wal.slatedb.store, while a change to slatedb.wal.slatedb.store can't break object_store.path.
Position
Below the diagonal: slatedb.wal.slatedb.store uses a module listed above it, which is the healthy direction.
slatedb.wal.slatedb.store uses slatedb.db_state, so a change to slatedb.db_state can break slatedb.wal.slatedb.store, while a change to slatedb.wal.slatedb.store can't break slatedb.db_state.
Position
Below the diagonal: slatedb.wal.slatedb.store uses a module listed above it, which is the healthy direction.
depot_log.log_shard_machine.state uses rivet_topology.worker, so a change to rivet_topology.worker can break depot_log.log_shard_machine.state, while a change to depot_log.log_shard_machine.state can't break rivet_topology.worker.
Position
Below the diagonal: depot_log.log_shard_machine.state uses a module listed above it, which is the healthy direction.
depot_log.log_shard_machine.state uses rivet_state_machine.state_machine, so a change to rivet_state_machine.state_machine can break depot_log.log_shard_machine.state, while a change to depot_log.log_shard_machine.state can't break rivet_state_machine.state_machine.
Position
Below the diagonal: depot_log.log_shard_machine.state uses a module listed above it, which is the healthy direction.
depot_log.log_shard_machine.state uses rivet_state_machine.effects, so a change to rivet_state_machine.effects can break depot_log.log_shard_machine.state, while a change to depot_log.log_shard_machine.state can't break rivet_state_machine.effects.
Position
Below the diagonal: depot_log.log_shard_machine.state uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.state uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_worker.tablet_maintainer_machine.state, while a change to depot_worker.tablet_maintainer_machine.state can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.state uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.state uses rivet_topology.worker, so a change to rivet_topology.worker can break depot_worker.tablet_maintainer_machine.state, while a change to depot_worker.tablet_maintainer_machine.state can't break rivet_topology.worker.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.state uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.state uses depot_worker.tablet_maintainer_machine.types, so a change to depot_worker.tablet_maintainer_machine.types can break depot_worker.tablet_maintainer_machine.state, while a change to depot_worker.tablet_maintainer_machine.state can't break depot_worker.tablet_maintainer_machine.types.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.state uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.state uses rivet_state_machine.state_machine, so a change to rivet_state_machine.state_machine can break depot_worker.tablet_maintainer_machine.state, while a change to depot_worker.tablet_maintainer_machine.state can't break rivet_state_machine.state_machine.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.state uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.state uses depot_worker.command.volume_host, so a change to depot_worker.command.volume_host can break depot_worker.tablet_maintainer_machine.state, while a change to depot_worker.tablet_maintainer_machine.state can't break depot_worker.command.volume_host.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.state uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.state uses rivet_state_machine.effects, so a change to rivet_state_machine.effects can break depot_worker.tablet_maintainer_machine.state, while a change to depot_worker.tablet_maintainer_machine.state can't break rivet_state_machine.effects.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.state uses a module listed above it, which is the healthy direction.
slatedb.db uses slatedb.tablestore, so a change to slatedb.tablestore can break slatedb.db, while a change to slatedb.db can't break slatedb.tablestore.
Position
Below the diagonal: slatedb.db uses a module listed above it, which is the healthy direction.
depot_worker.filesystem.store uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_worker.filesystem.store, while a change to depot_worker.filesystem.store can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_worker.filesystem.store uses a module listed above it, which is the healthy direction.
depot_worker.filesystem.store uses depot_worker.tablet_maintainer_machine.types, so a change to depot_worker.tablet_maintainer_machine.types can break depot_worker.filesystem.store, while a change to depot_worker.filesystem.store can't break depot_worker.tablet_maintainer_machine.types.
Position
Below the diagonal: depot_worker.filesystem.store uses a module listed above it, which is the healthy direction.
depot_worker.filesystem.store uses slatedb.db, so a change to slatedb.db can break depot_worker.filesystem.store, while a change to depot_worker.filesystem.store can't break slatedb.db.
Position
Below the diagonal: depot_worker.filesystem.store uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.runner uses depot_types.volume_log_key, so a change to depot_types.volume_log_key can break depot_worker.tablet_maintainer_machine.runner, while a change to depot_worker.tablet_maintainer_machine.runner can't break depot_types.volume_log_key.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.runner uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.runner uses rivet_env.capabilities.tokio.task, so a change to rivet_env.capabilities.tokio.task can break depot_worker.tablet_maintainer_machine.runner, while a change to depot_worker.tablet_maintainer_machine.runner can't break rivet_env.capabilities.tokio.task.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.runner uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.runner uses rivet_topology.worker, so a change to rivet_topology.worker can break depot_worker.tablet_maintainer_machine.runner, while a change to depot_worker.tablet_maintainer_machine.runner can't break rivet_topology.worker.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.runner uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.runner uses depot_worker.tablet_maintainer_machine.types, so a change to depot_worker.tablet_maintainer_machine.types can break depot_worker.tablet_maintainer_machine.runner, while a change to depot_worker.tablet_maintainer_machine.runner can't break depot_worker.tablet_maintainer_machine.types.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.runner uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.runner uses depot_worker.command.volume_host, so a change to depot_worker.command.volume_host can break depot_worker.tablet_maintainer_machine.runner, while a change to depot_worker.tablet_maintainer_machine.runner can't break depot_worker.command.volume_host.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.runner uses a module listed above it, which is the healthy direction.
depot_worker.tablet_maintainer_machine.runner uses depot_worker.filesystem.store, so a change to depot_worker.filesystem.store can break depot_worker.tablet_maintainer_machine.runner, while a change to depot_worker.tablet_maintainer_machine.runner can't break depot_worker.filesystem.store.
Position
Below the diagonal: depot_worker.tablet_maintainer_machine.runner uses a module listed above it, which is the healthy direction.
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
A03:2025 — Software Supply Chain Failures
158
High / Critical
A05:2025 — Injection
64
High / Critical
A02:2025 — Security Misconfiguration
64
High / Critical
A07:2025 — Authentication Failures
18
High / Critical
Roadmap
Top priorities: Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key; Resolve the 13 REDACTED finding(s) in Secrets (history) — start with REDACTED (11), REDACTED, REDACTED; Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with REDACTED.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
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 — 188
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 — 2299
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 — 139
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 8
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 82 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 82 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, 2590 of 2626 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 or a scanner, 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.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for engine/sdks/typescript/envoy-protocol/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in engine/sdks/typescript/envoy-protocol/ was NOT MEASURED: the dependency install for engine/sdks/typescript/envoy-protocol/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/actor-actions/ was NOT MEASURED: the dependency install for examples/actor-actions/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/ai-agent/ was NOT MEASURED: the dependency install for examples/ai-agent/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/ai-agent-effect/ was NOT MEASURED: the dependency install for examples/ai-agent-effect/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/chat-room/ was NOT MEASURED: the dependency install for examples/chat-room/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/chat-room-effect/ was NOT MEASURED: the dependency install for examples/chat-room-effect/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/collaborative-document/ was NOT MEASURED: the dependency install for examples/collaborative-document/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/collaborative-document-ot/ was NOT MEASURED: the dependency install for examples/collaborative-document-ot/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/cross-actor-actions/ was NOT MEASURED: the dependency install for examples/cross-actor-actions/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/cursors/ was NOT MEASURED: the dependency install for examples/cursors/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/cursors-raw-websocket/ was NOT MEASURED: the dependency install for examples/cursors-raw-websocket/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in examples/docs/ was NOT MEASURED: the dependency install for examples/docs/ could not reach pkg.pr.new, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403 GET https://pkg.pr.new/rivet-dev/durable-streams/@durable-streams/client@0323b8bcf1c9b38f1014629e1a8b6c74cc662100: Forbidden - 403), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `integrations/workflow-world/src/actors/coordinator.ts`, `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift`, `rivetkit-swift/Sources/RivetKitClient/ActorHandle.swift`, `rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift`, `rivetkit-typescript/packages/effect/src/Action.ts`, … (+17 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.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P8 Schema migrations — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 97 further occurrence(s) are not listed individually; the score already reflects all 137.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 111 further occurrence(s) are not listed individually; the score already reflects all 151.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 87 further occurrence(s) are not listed individually; the score already reflects all 127.
X17 Uncapped recursion over a caller-supplied document — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 405 further occurrence(s) are not listed individually; the score already reflects all 445.
Repo exclusion declarations: 25 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
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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.
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 (go.mod, 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.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
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.
255 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ActorStateMachine::on_event at 157. A further 45 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 MaintainerEvent::name at 60 — they are counted neither in the figure above nor in this dimension's score. 18 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: engine/packages/depot-worker/src/tablet_maintainer_machine/event.rs (MaintainerEvent::name at 60), engine/packages/keys/src/keys/tags.rs (rivet_keys::keys::tags::partition::key_from_str at 58), engine/packages/depot-worker/src/tablet_maintainer_machine/effect.rs (MaintainerEffect::name at 54), engine/packages/guard-core/src/errors.rs (rivet_guard_core::errors::status at 42), engine/packages/depot-client/src/fences.rs (FenceReason::label at 35), and 13 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 106 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with ActorStateMachine::on_event (cyclomatic 157), TabletMaintainerMachine::on_event (cyclomatic 144). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 5.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 143 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with LogShardExecutor::open_with_payload_retention (cognitive 178), ActorStateMachine::on_event (cognitive 174), MaintainerExecutor::execute (cognitive 147). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cognitive Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 142 FileTooLong finding(s) in God Classes — start with mod.rs (15), runner.rs (5), connection.rs (3). — One of this dimension's main actionable groups (142 warning-level).
Resolve the 110 FunctionTooLong finding(s) in God Classes — start with mod.rs (8), lifecycle.rs (7), routes.rs (5). — One of this dimension's main actionable groups (110 warning-level).
Resolve the 74 MethodTooLong finding(s) in God Classes — start with mod.rs (12), runner.rs (6), executor.rs (4). — One of this dimension's main actionable groups (74 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
388 duplicated block group(s) detected. 5.0 % of the production lines (20,013 of 397,157) are in a reported copy. A further 303 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 191 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (4), executor.rs (3), checkpoints.rs (3). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 30 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with runner.rs (2), handle.rs (2), actor_factory.rs (2). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 29 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with client.rs (3), tx.rs (3), forks.rs (2). — One of this dimension's main actionable groups (29 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.4 / 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.
102 production modules (Cargo+npm+SwiftPM), 0 dependency cycle(s), 6 unstable depended-on module(s). Read from the build's own module declarations; 14 module(s) off the main sequence, with abstractness counted on 76 of the 102 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: RivetKitClient · ×13
Unstable project depot-log
Unstable project pegboard-envoy
Unstable project pegboard-gateway
Unstable project rivet-api-peer
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 1 Unstable project depot-log finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project pegboard-envoy finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with http.rs, registry.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
0 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
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: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 616 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 1 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED and a Swift Package.swift/Package.resolved, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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.
Resolve the 60 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (5), lib.rs (4), executor.rs (3). — One of this dimension's main actionable groups (60 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 Factor9.2 / 10Exemplary✓ 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.
73 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is rivetkit-rust/packages/rivetkit-core/src/actor/context.rs. Counted over 865 of the 1304 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)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
37 deducted task-comment markers across 397157 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 36 TodoComment finding(s) in Explicit Debt — start with lifecycle-errors.ts (4), REDACTED (3), native.ts (2). — One of this dimension's main actionable groups (36 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with router.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 2 documentation facets pass in full; short on: F2 example. 151 document(s) read across 32 unit(s).
Documentation: no build, run or usage example · ×8rivetkit-typescript/packages/rivetkit/README.md:1
What to do
Resolve the 8 Documentation finding(s) in Documentation Quality — start with README.md (8). — One of this dimension's main actionable groups (8 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 11 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
4 naming inconsistencies among 516 declarations measured against a convention their peers follow.
`toolUseID` spells `ID` where 496 names in the project spell it `Id` · ×2examples/kitchen-sink/src/actors/testing/load-test-agent-2.ts:2733
`SlateDBError` spells `DB` where 15 names in the project spell it `Db`vendor/slatedb/out/src/error.rs:18
`sendJSON` spells `JSON` where 26 names in the project spell it `Json`examples/kitchen-sink/src/actors/testing/slow-reconnect-actor.ts:363
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D22 · Internal API Consistency10.0 / 10Exemplary○ Nothing flagged
What it measures: Whether the internal API surface is consistent and coherent.
Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the names · ×4shared/typescript/virtual-websocket/src/virtual-websocket.ts:9
What to do
Resolve the 5 redundant comment finding(s) in Comment Value — start with mod.ts, actor-conn.ts, raw-utils.ts. — One of this dimension's main actionable groups (5 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
5 of 90 build units (Cargo, SwiftPM, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×5engine/packages/depot-worker/Cargo.toml:1
What to do
Resolve the 5 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml (4), REDACTED. — One of this dimension's main actionable groups (5 recommendation-level).
Detailed fixes: d26_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.
17 finding(s): 0 critical, 17 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 13 REDACTED finding(s) in Secrets (history) — start with REDACTED (11), REDACTED, REDACTED. — One of this dimension's main actionable groups (13 issue-level).
Resolve the 4 High secret finding(s) in Secrets (history) — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 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).
64 finding(s): 0 critical, 60 high, 4 medium, 0 low. 44 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 24 file(s) — `REDACTED` (line 47, line 48), `engine/packages/pegboard-envoy/src/sqlite/mod.rs` (line 467, line 521, line 555, …), `engine/packages/sqlite-embedded/src/vfs/transport.rs` (line 49, line 51), `engine/packages/sqlite-embedded/src/worker.rs` (line 760, line 771), `integrations/workflow-world/src/actors/coordinator.ts` (line 242), … (+19 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 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
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) charged to Static Analysis (SAST) — the other 44 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 (47 issue-level, 3 of them charged here).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 66 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (66). — One of this dimension's main actionable groups (66 issue-level).
Resolve the 14 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13), REDACTED. — One of this dimension's main actionable groups (14 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 27 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (27 issue-level).
Resolve the 27 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (5), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (27 warning-level).
Resolve the 10 Low IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (10 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 865 of the 1304 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 2 Change coupling finding(s) in Change Coupling — start with actor-http-client.ts, lib.rs. — One of this dimension's main actionable groups (2 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.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 18 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.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.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 & labels10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
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"). — rivetkit-rust/packages/rivetkit-core/src/inspector_bundle/wasm-custom-tab-unavailable.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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.
`.input-wrapper textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — examples/experimental-durable-streams-ai-agent/frontend/App.css:238
`element.animate()` moves (`Web Animations API keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — rivetkit-typescript/packages/devtools/src/hooks/useDraggable.ts:127
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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.
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 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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
What to do
Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
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.
Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`validate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — engine/packages/config/src/config/epoxy.rs:12
`observe_applied` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-client/src/filesystem/backlog.rs:84
`install_status_notifier` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-log/src/log_shard_machine/runner.rs:226
`set_alarm_owner` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/command/volume_host.rs:793
`record_tablet_cold_get` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics.rs:1924
`impl Discard` has 3 unfinished methods out of 5 — a scaffolded type that was never implemented. — engine/packages/depot-worker/src/metrics_wasm.rs:11
`inc_by` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:18
`observe` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:20
`set` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:22
`record_member_repair` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:48
`record_recovery_scan` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:50
`record_status_observation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:52
`record_idle_visits` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:54
`record_retention_check` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/metrics_wasm.rs:60
`unsupported` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:2415
`remember_group_name` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/engine-context/src/context.rs:542
`progress` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/engine/src/depot_command/migrate_from_v2.rs:281
`print_command_output` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — engine/packages/engine/src/main.rs:278
`advance_epoch` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/pegboard-envoy/src/connection.rs:2591
`x_shutdown` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/sqlite-embedded/src/pager_cache.rs:415
`x_cachesize` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/sqlite-embedded/src/pager_cache.rs:466
`replay_read` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/packages/sqlite-prefetch/src/harness/vfs.rs:274
`vfs_get_last_error` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — engine/packages/sqlite-prefetch/src/harness/vfs.rs:615
`send_response_abort` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/actor/http.rs:834
`start_connection` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — engine/sdks/rust/envoy-client/src/connection/wasm.rs:381
`sleep_actor` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/handle.rs:202
`stop_actor` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/handle.rs:218
`set_alarm_with_ack` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/handle.rs:406
`send_hibernatable_ws_message_ack` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/handle.rs:768
`impl WebSocketSender` has 2 unfinished methods out of 4 — a scaffolded type that was never implemented. — engine/sdks/rust/envoy-client/src/websocket.rs:42
`send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/websocket.rs:43
`close` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — engine/sdks/rust/envoy-client/src/websocket.rs:58
`record_fingerprint_catalog` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2968
`log_dispatch_command_handled` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:1185
`log_lifecycle_command_received` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:2201
`log_closed_channel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:2977
`warn_dropped_event` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — rivetkit-rust/packages/rivetkit/src/event.rs:744
`dispatch_event` does real work, but one of its branches is `anyhow!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled. (×3) — rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:929, rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:966, rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1005
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
docs/durable-streams/content/docs/index.mdx names RivetKit 2, but the manifest declares `rivetkit` ^3.1.1. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/durable-streams/content/docs/index.mdx:30
What to do
Reconcile the README with reality: docs/durable-streams/content/docs/index.mdx names RivetKit 2, but the manifest declares `rivetkit` ^3.1.1.
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's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Only 46/48 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/rivetkit/src/utils/node.ts` reports through `console.*` at line 85 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rivetkit-typescript/packages/rivetkit/src/utils/node.ts:85
`rivetkit-typescript/packages/rivetkit/src/common/inline-websocket-adapter.ts` reports through `console.*` at line 165 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rivetkit-typescript/packages/rivetkit/src/common/inline-websocket-adapter.ts:165
`rivetkit-typescript/packages/workflow-engine/src/context.ts` reports through `console.*` at line 2773 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rivetkit-typescript/packages/workflow-engine/src/context.ts:2773
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
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.
`REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:23
What to do
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
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?
P6 · Release Hygiene8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
What to do
Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
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) — engine/packages/cli/src/auth.rs:141, engine/packages/cli/src/auth.rs:223, engine/packages/cli/src/auth.rs:239, …
`reqwest::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. (×3) — engine/packages/env/src/backends/production/external_http.rs:40, engine/packages/env/src/backends/production/http.rs:124, engine/packages/env/src/backends/production/http.rs:161
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.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`readFileSync` in `LoadHook` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — rivetkit-typescript/packages/sql-loader/src/hook.ts:10
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.5 / 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.
Do you agree with this assessment?
R10 · Code Duplication4.9 / 10Weak✓ Tool-verified
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
14 duplicated blocks under rivetkit-typescript/packages/rivetkit/src/ have copies in at least two of the sibling directories actor, client, common, db, engine-api, engine-client (+4 more sibling(s) not listed) — 7 of them are reported below, and 7 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. — REDACTED:18
12 duplicated blocks under rivetkit-typescript/packages/ have copies in at least two of the sibling directories cli, effect, engine-cli, rivetkit, traces, workflow-engine — 8 of them are reported below, and 4 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. — rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12
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
rivetkit-typescript/packages/workflow-engine/src/context.ts:2153 · rivetkit-typescript/packages/workflow-engine/src/context.ts:2368 — the two spans are one implementation copied and then locally edited — 541 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:2153
rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:484 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:381 — the two spans are one implementation copied and then locally edited — 412 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:484
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
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:2080 · rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2180 — 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:2080
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/native.ts:5724 · rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:898 — the two spans are one implementation copied and then locally edited — 245 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/native.ts:5724
rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:239 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:821 — both copies are in the same file, so extract the 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:239
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/registry/napi-runtime.ts:1001 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:960 — the two spans are one implementation copied and then locally edited — 281 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:1001
rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:216 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:97 — the two spans are one implementation copied and then locally edited — 236 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:216
rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:260 · 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:260
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 — 216 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/workflow/driver.ts:325 · rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:434 — the two spans are one implementation copied and then locally edited — 331 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/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
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:145 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:180 — 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:145
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
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:697 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:771 — 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:697
rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:445 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:806 — 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/client/actor-handle.ts:445
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 · +20 more site(s) not listed — all 24 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:976 · rivetkit-typescript/packages/rivetkit/src/client/utils.ts:196 — 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:976
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
rivetkit-typescript/packages/rivetkit/src/actor/config.ts:565 · rivetkit-typescript/packages/rivetkit/src/actor/config.ts:603 — 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:565
rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1782 · rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1826 — 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/registry/native.ts:1782
rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4985 · rivetkit-typescript/packages/rivetkit/src/registry/native.ts:5082 — 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/registry/native.ts:4985
rivetkit-typescript/packages/rivetkit/scripts/actor-config-schema-gen.ts:6 · rivetkit-typescript/packages/rivetkit/scripts/registry-config-schema-gen.ts:6 — 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/actor-config-schema-gen.ts:6
rivetkit-typescript/packages/rivetkit/src/registry/native.ts:891 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:176 — 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/registry/native.ts:891
integrations/workflow-world/src/actors/workflow-run.ts:896 · integrations/workflow-world/src/actors/workflow-run.ts:929 · integrations/workflow-world/src/actors/workflow-run.ts:962 — 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. — integrations/workflow-world/src/actors/workflow-run.ts:896
rivetkit-typescript/packages/rivetkit/src/utils.ts:230 · rivetkit-typescript/packages/workflow-engine/src/utils.ts:16 — 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. — rivetkit-typescript/packages/rivetkit/src/utils.ts:230
rivetkit-typescript/packages/effect/src/State.ts:291 · rivetkit-typescript/packages/effect/src/State.ts:395 — 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/effect/src/State.ts:291
rivetkit-typescript/packages/rivetkit/src/actor/config.ts:43 · rivetkit-typescript/packages/rivetkit/src/registry/native.ts:762 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — rivetkit-typescript/packages/rivetkit/src/actor/config.ts:43
rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:443 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:784 — both copies are in the same file, so extract the 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/common/bare/transport/v1.ts:443
rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:209 · rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:251 · rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:361 · rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:415 — 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. — rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:209
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.
(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:4274
executeRace has cyclomatic complexity 45 and cognitive complexity 73; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/workflow-engine/src/context.ts:2380
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
bumpPackageJsons has cyclomatic complexity 36 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:197
executeLoop has cyclomatic complexity 35 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/workflow-engine/src/context.ts:1291
executeStep has cyclomatic complexity 34 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. — rivetkit-typescript/packages/workflow-engine/src/context.ts:905
(anonymous) has cyclomatic complexity 31 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:312
buildNativeFactory has cyclomatic complexity 30 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 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:4159
#handleOnClose has cyclomatic complexity 26 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/client/actor-conn.ts:979
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
flushSnapshot has cyclomatic complexity 26 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/workflow-engine/src/storage.ts:292
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. — REDACTED:340
classifyActorError has cyclomatic complexity 23 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:57
publishAll has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/publish/src/lib/npm.ts:321
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
main has cyclomatic complexity 20 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/publish/src/local/cut-release.ts:75
#sendActionAttempts has cyclomatic complexity 19 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/client/actor-handle.ts:357
reviveJsonCompatValue has cyclomatic complexity 19 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:377
#fetchWithResolvedActor has cyclomatic complexity 19 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:750
resolveContext has cyclomatic complexity 19 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/publish/src/lib/context.ts:190
(top-level) has cyclomatic complexity 19 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/src/actor/contexts/index.ts:1
bumpExampleLockfile has cyclomatic complexity 17 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:472
#dispatch has cyclomatic complexity 17 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — shared/typescript/virtual-websocket/src/virtual-websocket.ts:250
executeQueueNextBatch has cyclomatic complexity 17 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 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:1766
executeLiveWorkflow has cyclomatic complexity 16 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/workflow-engine/src/index.ts:511
anyValueFromJs has cyclomatic complexity 16 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 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/traces/src/otlp.ts:122
executeRollback has cyclomatic complexity 15 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/index.ts:289
#handleOnMessage has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:836
sendHttpRequest has cyclomatic complexity 15 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/client/utils.ts:110
discoverPackages has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/packages.ts:124
reconcileSubmissions has cyclomatic complexity 15 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 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/flue-runtime/src/agent-coordinator.ts:238
buildActorQueryGatewayUrl has cyclomatic complexity 15 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 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/engine-client/actor-websocket-client.ts:229
(anonymous) has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:2570
rawHttpFetch has cyclomatic complexity 15 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/client/raw-utils.ts:34
#shouldRetryConnectionOpenError has cyclomatic complexity 15 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/client/actor-conn.ts:626
(anonymous) has cyclomatic complexity 14 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:166
deserializeActorKey has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/actor/keys.ts:90
configureServerlessPool has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rivetkit-typescript/packages/rivetkit/src/serverless/configure.ts:32
Do you agree with this assessment?
R3 · Large Files4.3 / 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.
rivetkit-typescript/packages/rivetkit/src/registry/native.ts has 5487 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1
rivetkit-typescript/packages/workflow-engine/src/context.ts has 2624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/workflow-engine/src/context.ts:1
rivetkit-typescript/packages/rivetkit/src/actor/config.ts has 2438 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1
rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts has 1589 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:1
integrations/workflow-world/src/actors/workflow-run.ts has 1433 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — integrations/workflow-world/src/actors/workflow-run.ts:1
rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts has 1169 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:1
rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts has 1168 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:1
REDACTED has 1159 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
rivetkit-typescript/packages/effect/src/RivetError.ts has 1152 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/effect/src/RivetError.ts:1
rivetkit-typescript/packages/traces/src/traces.ts has 1137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/traces/src/traces.ts:1
rivetkit-typescript/packages/rivetkit/src/workflow/context.ts has 1089 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:1
rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts has 1061 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:1
rivetkit-typescript/packages/workflow-engine/src/index.ts has 1057 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/workflow-engine/src/index.ts:1
rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts has 895 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:1
rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts has 764 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:1
integrations/workflow-world/src/actors/dispatcher.ts has 756 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — integrations/workflow-world/src/actors/dispatcher.ts:1
REDACTED has 735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
rivetkit-typescript/packages/rivetkit/src/client/client.ts has 688 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/client/client.ts:1
rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts has 628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:1
rivetkit-typescript/packages/rivetkit/src/engine-client/mod.ts has 623 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/engine-client/mod.ts:1
scripts/publish/src/lib/version.ts has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — scripts/publish/src/lib/version.ts:1
rivetkit-typescript/packages/workflow-engine/schemas/serde.ts has 574 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/workflow-engine/schemas/serde.ts:1
rivetkit-typescript/packages/workflow-engine/src/types.ts has 563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/workflow-engine/src/types.ts:1
rivetkit-typescript/packages/effect/src/Actor.ts has 560 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/effect/src/Actor.ts:1
REDACTED has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
rivetkit-typescript/packages/workflow-engine/src/storage.ts has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/workflow-engine/src/storage.ts:1
scripts/publish/src/ci/bin.ts has 504 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — scripts/publish/src/ci/bin.ts:1
rivetkit-typescript/packages/rivetkit/src/common/encoding.ts has 464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:1
rivetkit-typescript/packages/framework-base/src/mod.ts has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/framework-base/src/mod.ts:1
rivetkit-typescript/packages/traces/src/read-range.ts has 453 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/traces/src/read-range.ts:1
rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts has 439 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:1
rivetkit-typescript/packages/rivetkit/src/actor/errors.ts has 427 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/actor/errors.ts:1
rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts has 416 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:1
integrations/flue-runtime/src/agent-coordinator.ts has 402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — integrations/flue-runtime/src/agent-coordinator.ts:1
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 Coverage2.3 / 10Critical✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1, rivetkit-typescript/packages/workflow-engine/src/context.ts:1, rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1, …
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.
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 REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code6.5 / 10Adequate✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 64 application, 25 tooling and 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (×17) — rivetkit-typescript/packages/rivetkit/src/common/actor-persist-versioned.ts, rivetkit-typescript/packages/rivetkit/runtime/index.ts, rivetkit-typescript/packages/rivetkit/src/actor/utils.ts, …
no import path from any entry point (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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. (×11) — integrations/flue-runtime/src/stores/async-db.ts:12, rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:225, rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:249, …
Nothing ultimately consumes this binding: its only referrer is the re-export in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts in the same commit, or the barrel will import a name that no longer exists. (×5) — rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:174, rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:252, rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:258, …
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 REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×6) — REDACTED:37, REDACTED:38, REDACTED:39, …
Declared in rivetkit-typescript/packages/devtools/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. — rivetkit-typescript/packages/devtools/package.json:48
Declared in rivetkit-typescript/packages/effect/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. — rivetkit-typescript/packages/effect/package.json:37
Every import is type-only — move it to devDependencies. — rivetkit-typescript/packages/rivetkit/src/client/auth.ts:1
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.
rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts → rivetkit-typescript/packages/rivetkit/src/client/client.ts → rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts (one verified cycle inside a mutually-dependent group of 3 files) — rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:50
rivetkit-typescript/packages/rivetkit/src/common/encoding.ts → rivetkit-typescript/packages/rivetkit/src/common/utils.ts → rivetkit-typescript/packages/rivetkit/src/utils/env-vars.ts → rivetkit-typescript/packages/rivetkit/src/utils.ts → rivetkit-typescript/packages/rivetkit/src/common/encoding.ts (one verified cycle inside a mutually-dependent group of 6 files) — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:4
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (`axum::serve(` (rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:115)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — engine/packages/cli/src/commands/deploy/cluster.rs:203
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — examples/native-websockets/vercel.json:1
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
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.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
`if opts.ephemeral == false { self.msg_queue.lock().await.push(msg.clone()); }` follows `'send_immediately : { let Some(driver) = guard.deref() else { break 'send_imm…` (line 389) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — rivetkit-rust/packages/client/src/connection.rs:402
`# [ allow(unreachable_code) ] anyhow::Ok(())` follows `loop { interval.tick().await ?; ping.send_replace(clock.observe() ?.unix_ms); }` (line 1807) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — engine/packages/pegboard-envoy/src/connection.rs:1811
`# [ allow(unreachable_code) ] anyhow::Ok(())` follows `loop { interval.tick().await ?; renew().await ?; }` (line 1816) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — engine/packages/pegboard-envoy/src/connection.rs:1820
`# [ allow(unreachable_code) ] anyhow::Ok(())` follows `loop { interval.tick().await ?; refresh().await ?; }` (line 1825) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — engine/packages/pegboard-envoy/src/connection.rs:1829
`if state.operations.index().promotion_lists.contains_key(& worker) { continue; }` follows `{ continue; }` (line 90) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — engine/packages/depot-worker/src/tablet_maintainer_machine/state/promotion.rs:93
What to do
Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.3 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`anyValueFromJs` is exported and takes `value: unknown` from its caller, and it calls itself at line 145 (`anyValueFromJs`) with a piece of `value` (and at line 153, line 160) — and nowhere in `anyValueFromJs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `anyValueFromJs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-typescript/packages/traces/src/otlp.ts:145
`assertJsonCompatValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 141 (`assertJsonCompatValue`) with a piece of `value` (and at line 142, line 150, line 158, line 165) — and nowhere in `assertJsonCompatValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `assertJsonCompatValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:141
`encodeJsonCompatValue` is exported and takes `input: JsonCompatValue` from its caller, and it calls itself at line 324 (`encodeJsonCompatValue`) with a piece of `input` (and at line 334, line 335, line 344, line 360) — and nowhere in `encodeJsonCompatValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `encodeJsonCompatValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:324
`reviveJsonCompatValue` is exported and takes `input: any` from its caller, and it calls itself at line 395 (`reviveJsonCompatValue`) with a piece of `input` (and at line 396, line 421, line 428, line 435, line 440) — and nowhere in `reviveJsonCompatValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `reviveJsonCompatValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:395
`disconnect_transport_only` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 968 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect_transport_only` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:968
`with_application_span` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 304 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_application_span` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:304
`record_connections_updated` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 1816 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `record_connections_updated` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1816
`record_state_updated` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 1807 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `record_state_updated` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1807
`record_schedules_updated` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 1827 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `record_schedules_updated` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1827
`into_body` is public and takes a `Request` as its receiver from its caller, and it calls itself at line 139 with a piece of the document (and at line 231) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `into_body` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:139
`active_http_request_count` is public and takes a `ActorContext` as its receiver from its caller, and it recurses at line 791 through `observe_http_request_counter`, `http_request_counter`, `lookup_http_request_counter` and back with a piece of the document (and at line 805, line 817, line 825, line 846) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `active_http_request_count` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:791
`cbor_to_json` is public and takes `value: Value` from its caller, and it calls itself at line 71 with a piece of the document (and at line 80, line 84) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `cbor_to_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/rivetkit/src/action.rs:71
`clone` is public and takes a `Client` as its receiver from its caller, and it calls itself at line 143 with a piece of the document (and at line 146) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-rust/packages/client/src/client.rs:143
`action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 48 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/simple/sync/handle.rs:48
`disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 164 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/simple/sync/handle.rs:164
`action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 52 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/simple/async/handle.rs:52
`disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 180 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/simple/async/handle.rs:180
`action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 26 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/events/sync/handle.rs:26
`on_event` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 49 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `on_event` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/events/sync/handle.rs:49
`disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 66 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/events/sync/handle.rs:66
`action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 32 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/events/async/handle.rs:32
`on_event` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 69 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `on_event` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/events/async/handle.rs:69
`disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 90 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rivetkit-python/client/src/events/async/handle.rs:90
`tick_index` is public and takes a `Backoff` as its receiver from its caller, and it calls itself at line 50 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tick_index` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/util/src/throttle/legacy.rs:50
`current_duration` is public and takes a `Backoff` as its receiver from its caller, and it calls itself at line 55 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `current_duration` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/util/src/throttle/legacy.rs:55
`tick` is public and takes a `Backoff` as its receiver from its caller, and it calls itself at line 62 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tick` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/util/src/throttle/legacy.rs:62
`step` is public and takes a `Backoff` as its receiver from its caller, and it calls itself at line 67 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `step` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/util/src/throttle/legacy.rs:67
`clone` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 139 with a piece of the document (and at line 141) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/pegboard-envoy/src/queue.rs:139
`send` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 154 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/pegboard-envoy/src/queue.rs:154
`try_send` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 168 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `try_send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/pegboard-envoy/src/queue.rs:168
`recv` is public and takes a `Receiver` as its receiver from its caller, and it calls itself at line 191 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `recv` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/pegboard-envoy/src/queue.rs:191
`try_send` is public and takes a `Sender` as its receiver from its caller, and it calls itself at line 143 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `try_send` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/pegboard-envoy/src/connection/inbound.rs:143
`recv` is public and takes a `Receiver` as its receiver from its caller, and it calls itself at line 158 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `recv` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/pegboard-envoy/src/connection/inbound.rs:158
`poll_frame` is public and takes a `ResponseBody` as its receiver from its caller, and it calls itself at line 139 with a piece of the document (and at line 152, line 165) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `poll_frame` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/guard-core/src/response_body.rs:139
`is_end_stream` is public and takes a `ResponseBody` as its receiver from its caller, and it calls itself at line 226 with a piece of the document (and at line 227, line 228, line 239, line 240) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_end_stream` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/guard-core/src/response_body.rs:226
`size_hint` is public and takes a `ResponseBody` as its receiver from its caller, and it calls itself at line 246 with a piece of the document (and at line 247, line 248, line 251, line 252) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `size_hint` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/guard-core/src/response_body.rs:246
`shutdown` is public and takes a `Client` as its receiver from its caller, and it calls itself at line 29 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `shutdown` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/epoxy/src/client.rs:29
`env` is public and takes a `Client` as its receiver from its caller, and it calls itself at line 58 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `env` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/epoxy/src/client.rs:58
`replica_id` is public and takes a `Client` as its receiver from its caller, and it calls itself at line 114 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `replica_id` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/epoxy/src/client.rs:114
`shutdown` is public and takes a `VolumeHost` as its receiver from its caller, and it calls itself at line 929 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `shutdown` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — engine/packages/depot-worker/src/command/volume_host.rs:929
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`std::mem::forget(old)` (line 993) takes `old` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:993
`std::mem::forget(old)` (line 1008) takes `old` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:1008
`transaction` (line 891) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 897; the `return` on line 897 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:891
`tx` (line 144) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — engine/packages/pegboard-envoy/src/kv.rs:144
`tx` (line 169) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — engine/packages/pegboard-envoy/src/kv.rs:169
`tx` (line 203) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 238; the `return` on line 232 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — engine/packages/pegboard-envoy/src/kv.rs:203
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`debug` at line 43 is called with an argument built by `JSON.stringify(c.req.header())` (line 53), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — rivetkit-typescript/packages/rivetkit/src/common/router.ts:43
`tracing::trace!` at line 213 is called with an argument built by `reply.pages.iter().filter_map(|(_,bytes)|bytes.as_ref()).map(Bytes::len).sum::<usize>()` (line 225), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::trace! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls. — engine/packages/sqlite-prefetch/src/driver.rs:213
What to do
Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits. In Rust, hand the logger the value and let it format only what it writes: `debug!("rows: {:?}", rows)` or a field, `debug!(rows = ?rows, "loaded")` — `format_args!` and `?`/`%` fields defer the formatting. When the line needs a computed view (a `collect`, a `join`, a `serde_json::to_string`), put it behind `if log_enabled!(Level::Debug)` (`if tracing::enabled!(Level::DEBUG)` for tracing), which asks the target's own filter. The macros put their arguments behind the global maximum level only, so a collect or serialisation in the argument runs whenever any target is at debug, and the logger then drops this line.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`Logs.redirect_logs_dir` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — engine/packages/config/src/config/logs.rs:9
`Pegboard.gateway_port` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — engine/packages/config/src/config/pegboard.rs:101
`ServicesVersionOutput.rivetkit_version` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rivetkit-rust/packages/rivetkit-core/src/services_process.rs:48
`ServerlessActorPreload.prefixes` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rivetkit-rust/packages/shared-types/src/serverless_metadata.rs:62
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warn!` at line 2978 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:2978
`error!` at line 3027 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:3027
`debug!` at line 232 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/connection.rs:232
`debug!` at line 274 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/connection.rs:274
`debug!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/connection.rs:316
`debug!` at line 345 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/connection.rs:345
`debug!` at line 352 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/connection.rs:352
`debug!` at line 766 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/connection.rs:766
`debug!` at line 72 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/drivers/ws.rs:72
`debug!` at line 78 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/drivers/ws.rs:78
`debug!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/drivers/ws.rs:93
`debug!` at line 98 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/drivers/ws.rs:98
`debug!` at line 114 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — rivetkit-rust/packages/client/src/drivers/ws.rs:114
`info!` at line 86 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — engine/packages/guard/src/lib.rs:86
`warn!` at line 197 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — engine/packages/guard/src/lib.rs:197
`debug!` at line 202 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — engine/packages/guard/src/lib.rs:202
Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
`HistogramVec::new(HistogramOpts::new("rivetkit_serialize_size","size in bytes for any serialization",).buckets(serde_size_buckets()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:51
`HistogramVec::new(HistogramOpts::new("rivetkit_deserialize_size","size in bytes for any deserialization",).buckets(serde_size_buckets()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:60
`HistogramVec::new(HistogramOpts::new("rivetkit_serialize_duration_seconds","duration in seconds for any serialization",).buckets(MICRO_BUCKETS.to_vec()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:69
`HistogramVec::new(HistogramOpts::new("rivetkit_deserialize_duration_seconds","duration in seconds for any deserialization",).buckets(MICRO_BUCKETS.to_vec()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:78
`route_path(base_path,url)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handles_listener_request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/serverless.rs:750
`self.span.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `span` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:919
`StatusCode::from_u16(status)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `framework_error_status` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1133
`dispatch_error.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_scheduled_action` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×3) — rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2001, rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2010, rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2020
`SQLITE_PROFILE_METRICS.duration_seconds.lock().as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:509
`IntCounterVec::new(Opts::new("rivetkit_sqlite_operations_total","SQLite operation count without duration buckets",),query_labels,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:975
`CounterVec::new(Opts::new("rivetkit_sqlite_duration_seconds_total","cumulative SQLite operation seconds without duration buckets",),query_labels,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:983
`IntCounterVec::new(Opts::new("rivetkit_sqlite_pages_fetched_total","pages returned from storage per SQLite statement",),query_labels,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:991
`HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_phase_duration_seconds","SQLite operation phase duration in seconds",).buckets(sqlite_worker_duration_buckets()),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport","phase",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1011
`HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_round_trips","physical get_pages calls per SQLite operation",).buckets(sqlite_round_trip_count_buckets()),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1027
`HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_transaction_statement_count","user statements per explicit SQLite transaction",).buckets(sqlite_round_trip_count_buckets()),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1043
`IntCounterVec::new(Opts::new("rivetkit_sqlite_outcome_total","SQLite operation outcomes"),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport","outcome",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1056
`IntCounterVec::new(Opts::new("rivetkit_sqlite_local_pages_total","local SQLite page totals",),&["actor_name","type","page_kind","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1064
`IntCounterVec::new(Opts::new("rivetkit_sqlite_local_bytes_total","local SQLite logical byte totals",),&["actor_name","type","byte_kind","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1072
`HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_duration_seconds","physical get_pages request duration in seconds",).buckets(sqlite_worker_duration_buckets()),&["actor_name","request_ordinal","outcome_class","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1086
`HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_pages","pages per physical get_pages request",).buckets(sqlite_round_trip_count_buckets()),&["actor_name","request_ordinal","page_kind","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1100
`HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_response_bytes","bytes per physical get_pages response",).buckets(vec![512.0,4096.0,16_384.0,65_536.0,262_144.0,1_048_576.0,]),&["actor_name","request_ordinal","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1116
`IntCounterVec::new(Opts::new("rivetkit_sqlite_get_pages_missing_pages_total","missing pages in physical get_pages responses",),&["actor_name","request_ordinal","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1124
`IntCounterVec::new(Opts::new("rivetkit_sqlite_fingerprint_overflow_total","SQLite observations routed to the shared other fingerprint",),&["actor_name","type","reason"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1132
`IntCounterVec::new(Opts::new("rivetkit_sqlite_event_dropped_total","SQLite diagnostic events dropped before export",),&["actor_name","reason"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1140
`IntGaugeVec::new(Opts::new("rivetkit_sqlite_worker_queue_depth","queued native SQLite commands",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1148
`IntGaugeVec::new(Opts::new("rivetkit_sqlite_worker_inflight","native SQLite commands executing",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1156
`IntGaugeVec::new(Opts::new("rivetkit_sqlite_coordinator_queue_depth","operations waiting for SQLite transaction coordination",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1164
`IntGaugeVec::new(Opts::new("rivetkit_actor_active_count","current active actors in this process",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1221
`IntCounterVec::new(Opts::new("rivetkit_actor_started_total","total actors started in this process",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1229
`IntCounterVec::new(Opts::new("rivetkit_actor_stopped_total","total actors stopped in this process",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1237
`HistogramVec::new(HistogramOpts::new("rivetkit_actor_startup_phase_duration_seconds","actor startup phase duration in seconds",).buckets(startup_duration_buckets()),STARTUP_PHASE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1246
`HistogramVec::new(HistogramOpts::new("rivetkit_actor_create_state_duration_seconds","typed actor state creation time during startup in seconds",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1254
`HistogramVec::new(HistogramOpts::new("rivetkit_actor_create_vars_duration_seconds","typed actor vars creation time during startup in seconds",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1262
`HistogramVec::new(HistogramOpts::new("rivetkit_actor_runtime_callback_duration_seconds","foreign runtime lifecycle callback time during the startup preamble in seconds",).buckets(startup_duration_buckets()),RUNTIME_CALLBACK_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1271
`IntGaugeVec::new(Opts::new("rivetkit_actor_queue_depth","current actor queue depth"),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1276
`IntCounterVec::new(Opts::new("rivetkit_actor_queue_messages_sent_total","total queue messages sent",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1284
`IntCounterVec::new(Opts::new("rivetkit_actor_queue_messages_received_total","total queue messages received",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1292
`IntGaugeVec::new(Opts::new("rivetkit_actor_connections_active","current active actor connections",),ACTOR_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1300
What to do
Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 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 — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X10 Duplicated predicate — 28 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 45 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — AX6 reached only 16% of this repository's production lines — rust (335,639 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — 13 | COPY engine/sdks/typescript/ ./engine/sdks/typescript/ 14 | >>> COPY shared/typescript/ ./shared/typescript/ 15 | 16 | RUN pnpm install --frozen-lockfile -------------------- ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref a3521a07-04f8-4751-bc0e-91bbb80adc5d::3i06daz248zh8nw68q1dwyg0f: "/shared/typescript": not found; likely cause (the repository): a file the REDACTED copies (`shared/typescript`) is not in the repository's build context (it may be produced by a build step outside the REDACTED, or excluded by .dockerignore); runtime evidence skipped The cause is in the repository, not in our sandbox: a file the REDACTED copies (`shared/typescript`) is not in the repository's build context (it may be produced by a build step outside the REDACTED, or excluded by .dockerignore). Nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~2430 lines of test source are present (.rs, .ts) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 22 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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.
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 179 value object(s); 16 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
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 — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 15% of this repository's production lines — rust (335,639 lines), swift (4,142 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — X3 reached only 16% of this repository's production lines — rust (335,639 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
<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").
FileTooLong: registry/native.ts rivetkit-typescript/packages/rivetkit/src/registry/native.ts— FileTooLong — 4130 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3630 over it, 8.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: vfs/transport.rs engine/packages/sqlite-embedded/src/vfs/transport.rs— FileTooLong — 2866 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 2366 over it, 5.73× 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: tablet_maintainer_machine/runner.rs engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs— FileTooLong — 2831 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 2331 over it, 5.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/metrics.rs rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs— FileTooLong — 2598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2098 over it, 5.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: actor_machine/mod.rs engine/packages/pegboard/src/actor_machine/mod.rs— FileTooLong — 2541 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 2041 over it, 5.08× 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 — 2506 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 72 free functions. The bar is 500 significant lines; this is 2006 over it, 5.01× 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/connection.rs engine/packages/pegboard-envoy/src/connection.rs— FileTooLong — 2209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 1709 over it, 4.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: state/filesystem.rs engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs— FileTooLong — 2202 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 100 free functions. The bar is 500 significant lines; this is 1702 over it, 4.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: actor/task.rs rivetkit-rust/packages/rivetkit-core/src/actor/task.rs— FileTooLong — 2056 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: ActorTask (2 blocks, 318-3006). The bar is 500 significant lines; this is 1556 over it, 4.11× 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: versioned/v8_v9.rs engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs— FileTooLong — 1924 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 256 free functions. The bar is 500 significant lines; this is 1424 over it, 3.85× 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 — 1913 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1413 over it, 3.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: src/context.ts rivetkit-typescript/packages/workflow-engine/src/context.ts— FileTooLong — 1887 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1387 over it, 3.77× 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/legacy_backfill.rs engine/packages/pegboard/src/legacy_backfill.rs— FileTooLong — 1834 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 1334 over it, 3.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: src/metrics.rs engine/packages/depot-worker/src/metrics.rs— FileTooLong — 1824 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 1324 over it, 3.65× 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/routes.rs engine/packages/api-public-shim/src/routes.rs— FileTooLong — 1761 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 78 free functions. The bar is 500 significant lines; this is 1261 over it, 3.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: command/volume_host.rs engine/packages/depot-worker/src/command/volume_host.rs— FileTooLong — 1707 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 63% of them inside a single declaration: VolumeHost (3 blocks, 750-2334). The bar is 500 significant lines; this is 1207 over it, 3.41× 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: state/groups.rs engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs— FileTooLong — 1691 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 89 free functions. The bar is 500 significant lines; this is 1191 over it, 3.38× 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: filesystem/client.rs engine/packages/depot-client/src/filesystem/client.rs— FileTooLong — 1662 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 86% of them inside a single declaration: Filesystem (2 blocks, 319-2442). The bar is 500 significant lines; this is 1162 over it, 3.32× 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: state/lifecycle.rs engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs— FileTooLong — 1629 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1129 over it, 3.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: state/loaded_volume_replica.rs engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs— FileTooLong — 1563 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 1063 over it, 3.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: actor_machine/executor.rs engine/packages/pegboard/src/actor_machine/executor.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), declaring 35 free functions. The bar is 500 significant lines; this is 1028 over it, 3.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/catalog.rs engine/packages/pegboard/src/catalog.rs— FileTooLong — 1463 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 69 free functions. The bar is 500 significant lines; this is 963 over it, 2.93× 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/tablet_supervisor.rs engine/packages/depot-worker/src/tablet_supervisor.rs— FileTooLong — 1462 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: TabletSupervisor (5 blocks, 330-2208). The bar is 500 significant lines; this is 962 over it, 2.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/index.rs engine/packages/pegboard/src/index.rs— FileTooLong — 1451 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 951 over it, 2.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: state/forks.rs engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs— FileTooLong — 1445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 945 over it, 2.89× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FunctionTooLong: native.buildNativeFactory rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4159— FunctionTooLong — buildNativeFactory runs 1196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1096 over it, 11.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: 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: depot_log::log_shard_machine::state::loaded_volume_replica::admit_mutation engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs:1487— FunctionTooLong — depot_log::log_shard_machine::state::loaded_volume_replica::admit_mutation runs 576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 476 over it, 5.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot_worker::tablet_maintainer_machine::runner::store_io engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2750— FunctionTooLong — depot_worker::tablet_maintainer_machine::runner::store_io runs 480 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 380 over it, 4.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.
FunctionTooLong: depot_worker::services::storage::run engine/packages/depot-worker/src/services/storage.rs:173— FunctionTooLong — depot_worker::services::storage::run runs 369 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivetkit_napi::napi_actor_events::dispatch_event rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:428— FunctionTooLong — rivetkit_napi::napi_actor_events::dispatch_event runs 306 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 206 over it, 3.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivetkit_wasm::dispatch_event rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:774— FunctionTooLong — rivetkit_wasm::dispatch_event 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.
FunctionTooLong: pegboard_envoy::connection::handle_sub_stream engine/packages/pegboard-envoy/src/connection.rs:782— FunctionTooLong — pegboard_envoy::connection::handle_sub_stream runs 263 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pegboard_envoy::connection::run engine/packages/pegboard-envoy/src/connection.rs:125— FunctionTooLong — pegboard_envoy::connection::run runs 254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
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:176— FunctionTooLong — rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner runs 227 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 127 over it, 2.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.
FunctionTooLong: depot_volume::volume_client_machine::requests::admit engine/packages/depot-volume/src/volume_client_machine/requests.rs:18— FunctionTooLong — depot_volume::volume_client_machine::requests::admit runs 226 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 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivet_envoy_client::actor::actor_inner engine/sdks/rust/envoy-client/src/actor.rs:284— FunctionTooLong — rivet_envoy_client::actor::actor_inner runs 215 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 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot_worker::tablet_maintainer_machine::state::lifecycle::admit_open engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:262— FunctionTooLong — depot_worker::tablet_maintainer_machine::state::lifecycle::admit_open runs 207 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot_worker::tablet_maintainer_machine::state::lifecycle::load engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:1181— FunctionTooLong — depot_worker::tablet_maintainer_machine::state::lifecycle::load runs 193 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 93 over it, 1.93× 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_worker::tablet_maintainer_machine::state::lifecycle::row engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:753— FunctionTooLong — depot_worker::tablet_maintainer_machine::state::lifecycle::row runs 190 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 90 over it, 1.90× 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_gateway::routes::gateway engine/packages/pegboard-gateway/src/routes.rs:139— FunctionTooLong — pegboard_gateway::routes::gateway runs 189 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 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivet_envoy_client::connection::native::serve_connection engine/sdks/rust/envoy-client/src/connection/native.rs:215— FunctionTooLong — rivet_envoy_client::connection::native::serve_connection runs 188 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 88 over it, 1.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.
FunctionTooLong: depot_worker::services::tablet::serve engine/packages/depot-worker/src/services/tablet.rs:144— FunctionTooLong — depot_worker::services::tablet::serve 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.
FunctionTooLong: depot_worker::tablet_maintainer_machine::state::lifecycle::loaded engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:1485— FunctionTooLong — depot_worker::tablet_maintainer_machine::state::lifecycle::loaded runs 182 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 82 over it, 1.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivet_envoy_client::envoy::envoy_loop engine/sdks/rust/envoy-client/src/envoy.rs:568— FunctionTooLong — rivet_envoy_client::envoy::envoy_loop 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.
FunctionTooLong: depot_fs_core::keys::slatedb::encode_row engine/packages/depot-fs-core/src/keys/slatedb.rs:435— FunctionTooLong — depot_fs_core::keys::slatedb::encode_row runs 179 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 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot_fs_core::rollback::plan engine/packages/depot-fs-core/src/rollback.rs:243— FunctionTooLong — depot_fs_core::rollback::plan runs 176 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 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: depot_worker::tablet_maintainer_machine::state::unload::drive engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:1117— FunctionTooLong — depot_worker::tablet_maintainer_machine::state::unload::drive runs 176 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 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pegboard_v2_migrator::migrator_machine::executor::run engine/packages/pegboard-v2-migrator/src/migrator_machine/executor.rs:145— FunctionTooLong — pegboard_v2_migrator::migrator_machine::executor::run runs 169 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rivet_engine::run_config::start engine/packages/engine/src/run_config.rs:180— FunctionTooLong — rivet_engine::run_config::start runs 168 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 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
depot_worker::tablet_maintainer_machine::state::unload::drive (cognitive 84) engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:1117— depot_worker::tablet_maintainer_machine::state::unload::drive has cognitive complexity 84 (threshold 15). Drivers by points: if/else 30 (63 pts), boolean chains 14, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::lifecycle::loaded (cognitive 61) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:1485— depot_worker::tablet_maintainer_machine::state::lifecycle::loaded has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (36 pts), match/switch 7 (15 pts), boolean chains 10 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::differing_fields (cognitive 55) engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1203— depot_worker::tablet_maintainer_machine::state::differing_fields has cognitive complexity 55 (threshold 15). Drivers by points: if/else 55. 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.
depot_worker::tablet_maintainer_machine::state::store::drive_queue (cognitive 55) engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs:1223— depot_worker::tablet_maintainer_machine::state::store::drive_queue has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 5 (12 pts), loops 2 (5 pts), boolean chains 3 (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_worker::tablet_maintainer_machine::runner::run_filesystem_reads (cognitive 54) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2377— depot_worker::tablet_maintainer_machine::runner::run_filesystem_reads has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 9, match/switch 4 (7 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.
depot_worker::tablet_maintainer_machine::state::lifecycle::row (cognitive 52) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:753— depot_worker::tablet_maintainer_machine::state::lifecycle::row has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 9, match/switch 4 (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.
depot_worker::tablet_maintainer_machine::state::alarms::attempt_completed (cognitive 51) engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:966— depot_worker::tablet_maintainer_machine::state::alarms::attempt_completed has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (41 pts), match/switch 4 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::catch_up::drive (cognitive 51) engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs:236— depot_worker::tablet_maintainer_machine::state::catch_up::drive has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (40 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::lifecycle::admit_open (cognitive 50) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:262— depot_worker::tablet_maintainer_machine::state::lifecycle::admit_open has cognitive complexity 50 (threshold 15). Drivers by points: if/else 32 (35 pts), boolean chains 14, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
depot_worker::tablet_maintainer_machine::state::stop::completed (cognitive 49) engine/packages/depot-worker/src/tablet_maintainer_machine/state/stop.rs:363— depot_worker::tablet_maintainer_machine::state::stop::completed has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 11, loops 7 (11 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.
depot_worker::tablet_maintainer_machine::state::alarms::drive (cognitive 43) engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:773— depot_worker::tablet_maintainer_machine::state::alarms::drive has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 4 (9 pts), boolean chains 8, 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.
depot_worker::tablet_maintainer_machine::state::forks::stored (cognitive 43) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:1307— depot_worker::tablet_maintainer_machine::state::forks::stored has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 7, match/switch 3 (6 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.
depot_worker::tablet_maintainer_machine::state::groups::read_completed (cognitive 43) engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:1415— depot_worker::tablet_maintainer_machine::state::groups::read_completed has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 9, match/switch 5, loops 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
depot_worker::tablet_maintainer_machine::state::filesystem::loaded (cognitive 40) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:720— depot_worker::tablet_maintainer_machine::state::filesystem::loaded has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::deletion::drive (cognitive 39) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1288— depot_worker::tablet_maintainer_machine::state::deletion::drive has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5 (8 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::deletion::activate (cognitive 38) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:528— depot_worker::tablet_maintainer_machine::state::deletion::activate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 5 (8 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::forks::drive (cognitive 37) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:1686— depot_worker::tablet_maintainer_machine::state::forks::drive has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
depot_worker::tablet_maintainer_machine::state::filesystem::dispatch_flush (cognitive 36) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2318— depot_worker::tablet_maintainer_machine::state::filesystem::dispatch_flush has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, match/switch 2 (5 pts), loops 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::store::drive_session_reads (cognitive 36) engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs:952— depot_worker::tablet_maintainer_machine::state::store::drive_session_reads has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::filesystem::flushed (cognitive 35) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2538— depot_worker::tablet_maintainer_machine::state::filesystem::flushed has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::filesystem_reads::check (cognitive 34) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:257— depot_worker::tablet_maintainer_machine::state::filesystem_reads::check has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 11 (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.
depot_worker::tablet_maintainer_machine::state::materialize::peer_job (cognitive 34) engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.rs:480— depot_worker::tablet_maintainer_machine::state::materialize::peer_job has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 10, match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::runner::store_io (cognitive 32) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2750— depot_worker::tablet_maintainer_machine::runner::store_io has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 6 (12 pts), boolean chains 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
depot_worker::tablet_maintainer_machine::state::filesystem::pushed (cognitive 32) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:1450— depot_worker::tablet_maintainer_machine::state::filesystem::pushed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 7, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_worker::tablet_maintainer_machine::state::lifecycle::promote_caught_up (cognitive 32) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:1935— depot_worker::tablet_maintainer_machine::state::lifecycle::promote_caught_up has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 11, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MethodTooLong: ActorStateMachine.on_event engine/packages/pegboard/src/actor_machine/mod.rs:83— MethodTooLong — on_event runs 816 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 716 over it, 8.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MaintainerExecutor.execute engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1576— MethodTooLong — execute runs 586 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 486 over it, 5.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: ActorMetricCollectors.new rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1213— MethodTooLong — new runs 520 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 420 over it, 5.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.
MethodTooLong: LogShardExecutor.open_with_payload_retention engine/packages/depot-log/src/log_shard_machine/executor/recovery.rs:109— MethodTooLong — open_with_payload_retention runs 473 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 373 over it, 4.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TabletMaintainerMachine.on_event engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:286— MethodTooLong — on_event runs 470 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 370 over it, 4.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: Maintainer.start_with_alarms engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:309— MethodTooLong — start_with_alarms runs 453 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 353 over it, 4.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Executor.execute engine/packages/pegboard/src/actor_machine/executor.rs:1411— MethodTooLong — execute runs 422 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 322 over it, 4.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ManifestExecutor.execute engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:495— MethodTooLong — execute runs 355 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 255 over it, 3.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TopologyExecutor.execute engine/packages/topology/src/topology_machine/executor.rs:75— MethodTooLong — execute runs 345 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 245 over it, 3.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TabletSupervisor.reconcile engine/packages/depot-worker/src/tablet_supervisor.rs:900— MethodTooLong — reconcile runs 325 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 225 over it, 3.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RegistryDispatcher.handle_actor_connect_websocket rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:99— 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: VfsContext.resolve_pages engine/packages/sqlite-embedded/src/vfs/transport.rs:1663— MethodTooLong — resolve_pages runs 282 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 182 over it, 2.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: State.request_stop engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:44— MethodTooLong — request_stop runs 264 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 164 over it, 2.64× 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: FilesystemStore.read_operation engine/packages/depot-worker/src/filesystem/read.rs:204— MethodTooLong — read_operation runs 258 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 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Runner.process_attempt engine/packages/state-machine-durable/src/runner.rs:92— MethodTooLong — process_attempt runs 232 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 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Client.command_with engine/packages/depot-client/src/command.rs:182— MethodTooLong — command_with 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.
MethodTooLong: Filesystem.admit engine/packages/depot-client/src/filesystem/admission.rs:11— MethodTooLong — admit runs 217 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 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EnvoyClientMetrics.new engine/sdks/rust/envoy-client/src/metrics.rs:54— MethodTooLong — new runs 216 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 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ActorTask.start_actor rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:1270— MethodTooLong — start_actor 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.
MethodTooLong: SqliteProfileCollectors.new rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:958— MethodTooLong — new runs 203 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 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: 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:102— MethodTooLong — handle_inspector_websocket 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: VolumeHost.open engine/packages/depot-worker/src/command/volume_host.rs:1858— MethodTooLong — open runs 190 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 90 over it, 1.90× 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: OperationIndex.apply engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.rs:279— MethodTooLong — apply 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: FilesystemStore.checkpoint_change engine/packages/depot-worker/src/filesystem/checkpoints.rs:635— MethodTooLong — checkpoint_change 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.
depot_worker::tablet_maintainer_machine::state::operator_repair::activity::describe (cyclomatic 62) engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator_repair/activity.rs:221— depot_worker::tablet_maintainer_machine::state::operator_repair::activity::describe has cyclomatic complexity 62 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
depot_worker::tablet_maintainer_machine::state::differing_fields (cyclomatic 56) engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1203— depot_worker::tablet_maintainer_machine::state::differing_fields has cyclomatic complexity 56 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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_worker::tablet_maintainer_machine::state::unload::drive (cyclomatic 49) engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:1117— depot_worker::tablet_maintainer_machine::state::unload::drive 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.
depot_worker::tablet_maintainer_machine::state::lifecycle::admit_open (cyclomatic 43) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:262— depot_worker::tablet_maintainer_machine::state::lifecycle::admit_open has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot_worker::tablet_maintainer_machine::state::lifecycle::loaded (cyclomatic 42) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:1485— depot_worker::tablet_maintainer_machine::state::lifecycle::loaded has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
depot_worker::tablet_maintainer_machine::state::store::drive_queue (cyclomatic 41) engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs:1223— depot_worker::tablet_maintainer_machine::state::store::drive_queue has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
depot_worker::tablet_maintainer_machine::state::groups::read_completed (cyclomatic 37) engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:1415— depot_worker::tablet_maintainer_machine::state::groups::read_completed has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot_worker::tablet_maintainer_machine::state::alarms::attempt_completed (cyclomatic 36) engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:966— depot_worker::tablet_maintainer_machine::state::alarms::attempt_completed 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.
depot_worker::tablet_maintainer_machine::state::forks::stored (cyclomatic 36) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:1307— depot_worker::tablet_maintainer_machine::state::forks::stored 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.
depot_worker::tablet_maintainer_machine::state::lifecycle::row (cyclomatic 35) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:753— depot_worker::tablet_maintainer_machine::state::lifecycle::row 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_worker::tablet_maintainer_machine::runner::store_io (cyclomatic 33) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2750— depot_worker::tablet_maintainer_machine::runner::store_io has cyclomatic complexity 33 (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.
depot_worker::tablet_maintainer_machine::state::operator_repair::activity::summaries (cyclomatic 33) engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator_repair/activity.rs:121— depot_worker::tablet_maintainer_machine::state::operator_repair::activity::summaries has cyclomatic complexity 33 (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.
depot_worker::tablet_maintainer_machine::state::catch_up::drive (cyclomatic 32) engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs:236— depot_worker::tablet_maintainer_machine::state::catch_up::drive 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_worker::tablet_maintainer_machine::runner::run_filesystem_reads (cyclomatic 31) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2377— depot_worker::tablet_maintainer_machine::runner::run_filesystem_reads has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
depot_worker::tablet_maintainer_machine::state::filesystem::loaded (cyclomatic 31) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:720— depot_worker::tablet_maintainer_machine::state::filesystem::loaded has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
depot_worker::tablet_maintainer_machine::state::alarms::drive (cyclomatic 30) engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:773— depot_worker::tablet_maintainer_machine::state::alarms::drive has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
depot_worker::tablet_maintainer_machine::state::filesystem_reads::check (cyclomatic 29) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:257— depot_worker::tablet_maintainer_machine::state::filesystem_reads::check has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot_worker::tablet_maintainer_machine::state::materialize::peer_job (cyclomatic 29) engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.rs:480— depot_worker::tablet_maintainer_machine::state::materialize::peer_job 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.
depot_worker::tablet_maintainer_machine::state::stop::completed (cyclomatic 29) engine/packages/depot-worker/src/tablet_maintainer_machine/state/stop.rs:363— depot_worker::tablet_maintainer_machine::state::stop::completed 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.
depot_worker::tablet_maintainer_machine::replica_response (cyclomatic 28) engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:1178— depot_worker::tablet_maintainer_machine::replica_response has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: TabletMaintainerMachine::timer_name (cyclomatic 44) 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.
depot_worker::tablet_maintainer_machine::state::forks::peer (cyclomatic 27) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:2047— depot_worker::tablet_maintainer_machine::state::forks::peer 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.
depot_worker::tablet_maintainer_machine::state::fork_references::completed (cyclomatic 26) engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_references.rs:757— depot_worker::tablet_maintainer_machine::state::fork_references::completed has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot_worker::tablet_maintainer_machine::state::lifecycle::promote_caught_up (cyclomatic 26) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:1935— depot_worker::tablet_maintainer_machine::state::lifecycle::promote_caught_up 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.
depot_worker::tablet_coordinator_machine::state::apply (cyclomatic 25) engine/packages/depot-worker/src/tablet_coordinator_machine/state.rs:897— depot_worker::tablet_coordinator_machine::state::apply 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.
depot_worker::tablet_maintainer_machine::state::deletion::activate (cyclomatic 25) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:528— depot_worker::tablet_maintainer_machine::state::deletion::activate 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.
Hotspot: rivetkit-typescript/packages/rivetkit/src/registry/native.ts rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4159— rivetkit-typescript/packages/rivetkit/src/registry/native.ts changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 140 in native.buildNativeFactory at line 4159. 8 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: engine/packages/pegboard/src/actor_machine/mod.rs engine/packages/pegboard/src/actor_machine/mod.rs:83— engine/packages/pegboard/src/actor_machine/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in ActorStateMachine::on_event at line 83. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/pegboard/src/actor_machine/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: rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:774— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in rivetkit_wasm::dispatch_event at line 774. 2 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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/depot-worker/src/tablet_maintainer_machine/mod.rs engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:286— engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 144 in TabletMaintainerMachine::on_event at line 286. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/depot-worker/src/tablet_maintainer_machine/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/envoy.rs engine/sdks/rust/envoy-client/src/envoy.rs:568— engine/sdks/rust/envoy-client/src/envoy.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in rivet_envoy_client::envoy::envoy_loop at line 568. 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-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: rivetkit-rust/packages/rivetkit-core/src/actor/task.rs rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:1270— rivetkit-rust/packages/rivetkit-core/src/actor/task.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ActorTask::start_actor at line 1270. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- rivetkit-rust/packages/rivetkit-core/src/actor/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/sdks/rust/envoy-client/src/actor.rs engine/sdks/rust/envoy-client/src/actor.rs:284— engine/sdks/rust/envoy-client/src/actor.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in rivet_envoy_client::actor::actor_inner at line 284. 1 of those changes was a fix/bug commit, 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-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/sdks/rust/envoy-client/src/actor.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/connection.rs engine/packages/pegboard-envoy/src/connection.rs:782— engine/packages/pegboard-envoy/src/connection.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in pegboard_envoy::connection::handle_sub_stream at line 782. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/pegboard-envoy/src/connection.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:197— scripts/publish/src/lib/version.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in version.bumpPackageJsons at line 197. 2 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:623— rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in CoreRegistry::serve_with_config_and_handle_observer at line 623. 7 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- rivetkit-rust/packages/rivetkit-core/src/registry/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/src/actor_machine/executor.rs engine/packages/pegboard/src/actor_machine/executor.rs:1411— engine/packages/pegboard/src/actor_machine/executor.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in Executor::execute at line 1411. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/pegboard/src/actor_machine/executor.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:428— rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs changed 8 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 428. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: engine/packages/config/src/config/pegboard.rs engine/packages/config/src/config/pegboard.rs:207— engine/packages/config/src/config/pegboard.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Pegboard::validate at line 207. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/config/src/config/pegboard.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:357— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ActorHandleRaw.#sendActionAttempts at line 357. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: rivetkit-rust/packages/rivetkit/src/start.rs rivetkit-rust/packages/rivetkit/src/start.rs:346— rivetkit-rust/packages/rivetkit/src/start.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in rivetkit::start::handle_actor_event at line 346. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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/connection/native.rs engine/sdks/rust/envoy-client/src/connection/native.rs:215— engine/sdks/rust/envoy-client/src/connection/native.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in rivet_envoy_client::connection::native::serve_connection at line 215. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: engine/packages/pegboard-gateway/src/acquire.rs engine/packages/pegboard-gateway/src/acquire.rs:329— engine/packages/pegboard-gateway/src/acquire.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Acquire::run at line 329. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/pegboard-gateway/src/acquire.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/workflow-engine/src/context.ts rivetkit-typescript/packages/workflow-engine/src/context.ts:2380— rivetkit-typescript/packages/workflow-engine/src/context.ts changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in WorkflowContextImpl.executeRace at line 2380. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- rivetkit-typescript/packages/workflow-engine/src/context.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/state-machine-durable/src/runner.rs engine/packages/state-machine-durable/src/runner.rs:92— engine/packages/state-machine-durable/src/runner.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Runner::process_attempt at line 92. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/state-machine-durable/src/runner.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:124— scripts/publish/src/lib/packages.ts changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in packages.discoverPackages at line 124. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05: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: engine/packages/topology/src/topology_machine/executor.rs engine/packages/topology/src/topology_machine/executor.rs:75— engine/packages/topology/src/topology_machine/executor.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in TopologyExecutor::execute at line 75. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/topology/src/topology_machine/executor.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/depot-client/src/command.rs engine/packages/depot-client/src/command.rs:182— engine/packages/depot-client/src/command.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in Client::command_with at line 182. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/depot-client/src/command.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-conn.ts rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:979— rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ActorConnRaw.#handleOnClose at line 979. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- rivetkit-typescript/packages/rivetkit/src/client/actor-conn.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/depot-worker/src/tablet_maintainer_machine/state/operations.rs engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.rs:279— engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in OperationIndex::apply at line 279. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.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/depot-worker/src/tablet_maintainer_machine/state/operator_repair/activity.rs engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator_repair/activity.rs:221— engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator_repair/activity.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in depot_worker::tablet_maintainer_machine::state::operator_repair::activity::describe at line 221. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 17:42:40 -05:00' --until='2026-11-11 17:42:40 -05:00' --full-history --no-merges -- engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator_repair/activity.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.
+ 35 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/workflow-engine/src/context.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file integrations/workflow-world/src/actors/workflow-run.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/traces/src/traces.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/effect/src/RivetError.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/workflow-engine/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file integrations/workflow-world/src/actors/dispatcher.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/workflow-engine/schemas/serde.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/effect/src/Actor.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/workflow-engine/src/storage.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/framework-base/src/mod.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/traces/src/read-range.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file integrations/flue-runtime/src/agent-coordinator.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file rivetkit-typescript/packages/rivetkit/src/db/drizzle.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
+ 15 more in this group — see findings.md.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×40
Recursive walk over a caller-supplied document has no depth cap rivetkit-typescript/packages/traces/src/otlp.ts:145— `anyValueFromJs` is exported and takes `value: unknown` from its caller, and it calls itself at line 145 (`anyValueFromJs`) with a piece of `value` (and at line 153, line 160) — and nowhere in `anyValueFromJs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `anyValueFromJs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:141— `assertJsonCompatValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 141 (`assertJsonCompatValue`) with a piece of `value` (and at line 142, line 150, line 158, line 165) — and nowhere in `assertJsonCompatValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `assertJsonCompatValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:324— `encodeJsonCompatValue` is exported and takes `input: JsonCompatValue` from its caller, and it calls itself at line 324 (`encodeJsonCompatValue`) with a piece of `input` (and at line 334, line 335, line 344, line 360) — and nowhere in `encodeJsonCompatValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `encodeJsonCompatValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:395— `reviveJsonCompatValue` is exported and takes `input: any` from its caller, and it calls itself at line 395 (`reviveJsonCompatValue`) with a piece of `input` (and at line 396, line 421, line 428, line 435, line 440) — and nowhere in `reviveJsonCompatValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `reviveJsonCompatValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:968— `disconnect_transport_only` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 968 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect_transport_only` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:304— `with_application_span` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 304 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_application_span` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1816— `record_connections_updated` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 1816 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `record_connections_updated` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1807— `record_state_updated` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 1807 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `record_state_updated` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1827— `record_schedules_updated` is public and takes a `ActorContext` as its receiver from its caller, and it calls itself at line 1827 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `record_schedules_updated` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:139— `into_body` is public and takes a `Request` as its receiver from its caller, and it calls itself at line 139 with a piece of the document (and at line 231) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `into_body` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:791— `active_http_request_count` is public and takes a `ActorContext` as its receiver from its caller, and it recurses at line 791 through `observe_http_request_counter`, `http_request_counter`, `lookup_http_request_counter` and back with a piece of the document (and at line 805, line 817, line 825, line 846) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `active_http_request_count` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/rivetkit/src/action.rs:71— `cbor_to_json` is public and takes `value: Value` from its caller, and it calls itself at line 71 with a piece of the document (and at line 80, line 84) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `cbor_to_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-rust/packages/client/src/client.rs:143— `clone` is public and takes a `Client` as its receiver from its caller, and it calls itself at line 143 with a piece of the document (and at line 146) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/simple/sync/handle.rs:48— `action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 48 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/simple/sync/handle.rs:164— `disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 164 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/simple/async/handle.rs:52— `action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 52 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/simple/async/handle.rs:180— `disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 180 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/events/sync/handle.rs:26— `action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 26 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/events/sync/handle.rs:49— `on_event` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 49 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `on_event` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/events/sync/handle.rs:66— `disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 66 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/events/async/handle.rs:32— `action` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 32 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `action` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/events/async/handle.rs:69— `on_event` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 69 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `on_event` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rivetkit-python/client/src/events/async/handle.rs:90— `disconnect` is public and takes a `ActorHandle` as its receiver from its caller, and it calls itself at line 90 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `disconnect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap engine/packages/util/src/throttle/legacy.rs:50— `tick_index` is public and takes a `Backoff` as its receiver from its caller, and it calls itself at line 50 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `tick_index` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap engine/packages/util/src/throttle/legacy.rs:55— `current_duration` is public and takes a `Backoff` as its receiver from its caller, and it calls itself at line 55 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `current_duration` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
+ 15 more in this group — see findings.md.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×40
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:51— `HistogramVec::new(HistogramOpts::new("rivetkit_serialize_size","size in bytes for any serialization",).buckets(serde_size_buckets()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:60— `HistogramVec::new(HistogramOpts::new("rivetkit_deserialize_size","size in bytes for any deserialization",).buckets(serde_size_buckets()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:69— `HistogramVec::new(HistogramOpts::new("rivetkit_serialize_duration_seconds","duration in seconds for any serialization",).buckets(MICRO_BUCKETS.to_vec()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:78— `HistogramVec::new(HistogramOpts::new("rivetkit_deserialize_duration_seconds","duration in seconds for any deserialization",).buckets(MICRO_BUCKETS.to_vec()),SERDE_LABELS,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/serverless.rs:750— `route_path(base_path,url)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `handles_listener_request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:919— `self.span.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `span` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1133— `StatusCode::from_u16(status)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `framework_error_status` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2001— `dispatch_error.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_scheduled_action` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2010— `dispatch_error.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_scheduled_action` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2020— `dispatch_error.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `dispatch_scheduled_action` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:509— `SQLITE_PROFILE_METRICS.duration_seconds.lock().as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:975— `IntCounterVec::new(Opts::new("rivetkit_sqlite_operations_total","SQLite operation count without duration buckets",),query_labels,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:983— `CounterVec::new(Opts::new("rivetkit_sqlite_duration_seconds_total","cumulative SQLite operation seconds without duration buckets",),query_labels,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:991— `IntCounterVec::new(Opts::new("rivetkit_sqlite_pages_fetched_total","pages returned from storage per SQLite statement",),query_labels,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1011— `HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_phase_duration_seconds","SQLite operation phase duration in seconds",).buckets(sqlite_worker_duration_buckets()),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport","phase",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1027— `HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_round_trips","physical get_pages calls per SQLite operation",).buckets(sqlite_round_trip_count_buckets()),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1043— `HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_transaction_statement_count","user statements per explicit SQLite transaction",).buckets(sqlite_round_trip_count_buckets()),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1056— `IntCounterVec::new(Opts::new("rivetkit_sqlite_outcome_total","SQLite operation outcomes"),&["actor_name","type","fingerprint","fingerprint_source","transaction_mode","storage_transport","outcome",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1064— `IntCounterVec::new(Opts::new("rivetkit_sqlite_local_pages_total","local SQLite page totals",),&["actor_name","type","page_kind","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1072— `IntCounterVec::new(Opts::new("rivetkit_sqlite_local_bytes_total","local SQLite logical byte totals",),&["actor_name","type","byte_kind","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1086— `HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_duration_seconds","physical get_pages request duration in seconds",).buckets(sqlite_worker_duration_buckets()),&["actor_name","request_ordinal","outcome_class","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1100— `HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_pages","pages per physical get_pages request",).buckets(sqlite_round_trip_count_buckets()),&["actor_name","request_ordinal","page_kind","storage_transport",],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1116— `HistogramVec::new(HistogramOpts::new("rivetkit_sqlite_get_pages_response_bytes","bytes per physical get_pages response",).buckets(vec![512.0,4096.0,16_384.0,65_536.0,262_144.0,1_048_576.0,]),&["actor_name","request_ordinal","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1124— `IntCounterVec::new(Opts::new("rivetkit_sqlite_get_pages_missing_pages_total","missing pages in physical get_pages responses",),&["actor_name","request_ordinal","storage_transport"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1132— `IntCounterVec::new(Opts::new("rivetkit_sqlite_fingerprint_overflow_total","SQLite observations routed to the shared other fingerprint",),&["actor_name","type","reason"],)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
ClassTooLong: ActorTask rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:318— ClassTooLong — 1798 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 77 methods, 2 blocks, lines 318-3006. The bar is 400 significant lines; this is 1398 over it, 4.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: Filesystem engine/packages/depot-client/src/filesystem/client.rs:319— ClassTooLong — 1430 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 140 methods, 2 blocks, lines 319-2442. The bar is 400 significant lines; this is 1030 over it, 3.58× 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: ActorContext rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:65— ClassTooLong — 1153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 381 methods, 2 blocks, lines 279-2221. The bar is 400 significant lines; this is 753 over it, 2.88× 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: Maintainer engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:267— ClassTooLong — 1080 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 40 methods, 5 blocks, lines 267-3728. The bar is 400 significant lines; this is 680 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VolumeHost engine/packages/depot-worker/src/command/volume_host.rs:750— ClassTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 3 blocks, lines 750-2334. The bar is 400 significant lines; this is 672 over it, 2.68× 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: TabletSupervisor engine/packages/depot-worker/src/tablet_supervisor.rs:330— ClassTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 5 blocks, lines 330-2208. The bar is 400 significant lines; this is 642 over it, 2.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SqliteDb rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:248— ClassTooLong — 1004 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 112 methods, 5 blocks, lines 121-1787. The bar is 400 significant lines; this is 604 over it, 2.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VfsContext engine/packages/sqlite-embedded/src/vfs/transport.rs:701— ClassTooLong — 960 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, 3 blocks, lines 701-2474. The bar is 400 significant lines; this is 560 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ActorConnRaw rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:156— ClassTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 549 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ActorMetrics rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:155— ClassTooLong — 944 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 6 blocks, lines 155-3245. The bar is 400 significant lines; this is 544 over it, 2.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: ActorStateMachine engine/packages/pegboard/src/actor_machine/mod.rs:60— ClassTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods. The bar is 400 significant lines; this is 463 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ReadSession engine/packages/depot-worker/src/filesystem/session.rs:278— ClassTooLong — 815 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 2 blocks, lines 278-1461. The bar is 400 significant lines; this is 415 over it, 2.04× 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: Executor engine/packages/pegboard/src/actor_machine/executor.rs:187— ClassTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 6 blocks, lines 187-2025. The bar is 400 significant lines; this is 383 over it, 1.96× 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:84— ClassTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 324 over it, 1.81× 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:263— ClassTooLong — 722 significant lines (blank, comment-only and punctuation-only lines excluded), 119 methods. The bar is 400 significant lines; this is 322 over it, 1.81× 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 — 720 significant lines (blank, comment-only and punctuation-only lines excluded), 129 methods. The bar is 400 significant lines; this is 320 over it, 1.80× 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: FilesystemStore engine/packages/depot-worker/src/filesystem/store.rs:456— ClassTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 167 methods, 2 blocks, lines 456-1445. The bar is 400 significant lines; this is 264 over it, 1.66× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TabletMaintainerMachine engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:204— ClassTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods. The bar is 400 significant lines; this is 240 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Registry REDACTED:161— ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 225 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: EnvoyHandle engine/sdks/rust/envoy-client/src/handle.rs:16— ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 3 blocks, lines 16-980. The bar is 400 significant lines; this is 219 over it, 1.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: MaintainerExecutor engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1530— ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 2 blocks, lines 1530-2321. The bar is 400 significant lines; this is 219 over it, 1.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: ActorContextHandleAdapter rivetkit-typescript/packages/rivetkit/src/registry/native.ts:2792— ClassTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 213 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ActorMetricCollectors rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:219— ClassTooLong — 600 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 219-1867. The bar is 400 significant lines; this is 200 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: Sessions engine/packages/pegboard-envoy/src/sqlite/mod.rs:47— ClassTooLong — 577 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 3 blocks, lines 47-1563. The bar is 400 significant lines; this is 177 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WorkflowContext rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:462— ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. 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.
TodoComment rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1232— // TODO: Switch inspector routes to CBOR encoding — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4928— // TODO: Move this save hook into cleanupNativeSleepRuntimeState — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:75— // TODO: Add sane defaults for NODE_ENV=development — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:81— // TODO: Find a better way of passing around the test config — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:186— // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/engine-client/api-utils.ts:11— // TODO: Remove getEndpoint, but it's used in a lot of places — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/common/router.ts:124— // TODO: Remove any — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:219— // TODO: ws message queue — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:413— // TODO: Throw error if disconnect is called — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:113— // TODO(RVT-6193): Remove this legacy match after structured restart errors
TodoComment rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:132— // TODO(RVT-6193): Remove this legacy match after connection admission uses
TodoComment rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:200— // TODO(RVT-6193): Remove this exact string match after the runner surfaces
TodoComment rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:211— // TODO(RVT-6193): Remove these exact string matches after transport
TodoComment rivetkit-typescript/packages/rivetkit/src/client/raw-utils.ts:160— // TODO: Supportp rotocols — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-typescript/packages/rivetkit/src/client/raw-utils.ts:164— // TODO: Do we need encoding in rawWebSocket? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:240— // TODO: Impelment when ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:1147— // TODO: Share admission policy with ActorTask::dispatch_lifecycle_error. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:527— // TODO: Sample inbox depths periodically instead of on every loop iteration. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:1247— // TODO: Share admission policy with RegistryDispatcher::active_actor. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-rust/packages/client/src/drivers/sse.rs:7— // TODO: Implement SSE support via gateway — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-python/client/src/simple/sync/handle.rs:139— // TODO: Add more signal support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment rivetkit-python/client/src/simple/async/handle.rs:150— // TODO: Add more signal support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/sdks/rust/envoy-client/src/connection/native.rs:225— // TODO: Bound shared WebSocket writer memory across protocol message types. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/sdks/rust/envoy-client/src/connection/wasm.rs:164— // TODO: Bound shared WebSocket writer memory across protocol message types. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/packages/util/src/req.rs:23— // TODO: Parse all valid Retry-After formats. Currently only parses duration — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
+ 11 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium CVE · ×36
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 11 more in this group — see findings.md.
IC1 · Incompleteness & stubs· Empty method body · ×31
Empty method body — does nothing with its inputs engine/packages/depot-client/src/filesystem/backlog.rs:84— `observe_applied` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-log/src/log_shard_machine/runner.rs:226— `install_status_notifier` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/command/volume_host.rs:793— `set_alarm_owner` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics.rs:1924— `record_tablet_cold_get` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:18— `inc_by` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:20— `observe` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:22— `set` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:48— `record_member_repair` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:50— `record_recovery_scan` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:52— `record_status_observation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:54— `record_idle_visits` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/metrics_wasm.rs:60— `record_retention_check` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:2415— `unsupported` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/engine-context/src/context.rs:542— `remember_group_name` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/engine/src/depot_command/migrate_from_v2.rs:281— `progress` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/pegboard-envoy/src/connection.rs:2591— `advance_epoch` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/sqlite-embedded/src/pager_cache.rs:415— `x_shutdown` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/sqlite-embedded/src/pager_cache.rs:466— `x_cachesize` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/packages/sqlite-prefetch/src/harness/vfs.rs:274— `replay_read` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/sdks/rust/envoy-client/src/actor/http.rs:834— `send_response_abort` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/sdks/rust/envoy-client/src/handle.rs:202— `sleep_actor` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/sdks/rust/envoy-client/src/handle.rs:218— `stop_actor` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/sdks/rust/envoy-client/src/handle.rs:406— `set_alarm_with_ack` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/sdks/rust/envoy-client/src/handle.rs:768— `send_hibernatable_ws_message_ack` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs engine/sdks/rust/envoy-client/src/websocket.rs:43— `send` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
TooManyMethods: ActorContext rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:65— TooManyMethods — 381 methods, declared across 6 files: actor/context.rs (162), actor/state.rs (71), actor/schedule.rs (47), actor/sleep.rs (44), +2 more file(s). The bar is 30 methods; this is 351 over it, 12.70× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FilesystemStore engine/packages/depot-worker/src/filesystem/store.rs:456— TooManyMethods — 167 methods, declared across 17 files: filesystem/store.rs (39), filesystem/forks.rs (21), filesystem/checkpoints.rs (17), filesystem/fork_references.rs (15), +13 more file(s). The bar is 30 methods; this is 137 over it, 5.57× 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: Filesystem engine/packages/depot-client/src/filesystem/client.rs:319— TooManyMethods — 140 methods, declared across 9 files: filesystem/client.rs (90), filesystem/txn.rs (12), filesystem/recovery.rs (11), filesystem/file_batch.rs (7), +5 more file(s). The bar is 30 methods; this is 110 over it, 4.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NapiCoreRuntime rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:266— TooManyMethods — 129 methods. The bar is 30 methods; this is 99 over it, 4.30× the bar. Most of these members implement runtime.CoreRuntime (123 of 129 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:263— TooManyMethods — 119 methods. The bar is 30 methods; this is 89 over it, 3.97× the bar. Most of these members implement runtime.CoreRuntime (117 of 119 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:248— TooManyMethods — 112 methods, declared across 3 files: sqlite/mod.rs (74), sqlite/tx.rs (29), sqlite/deferred_bootstrap.rs (9). The bar is 30 methods; this is 82 over it, 3.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: ActorTask rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:318— TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.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: ActorContext rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:54— TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.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: WorkflowContextImpl rivetkit-typescript/packages/workflow-engine/src/context.ts:378— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EnvoyHandle engine/sdks/rust/envoy-client/src/handle.rs:16— 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: PubSub engine/packages/universalpubsub/src/pubsub/mod.rs:33— TooManyMethods — 53 methods, declared across 9 files: pubsub/lifecycle.rs (9), pubsub/mod.rs (8), pubsub/request.rs (8), stream/mod.rs (8), +5 more file(s). The bar is 30 methods; this is 23 over it, 1.77× 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: ActorMetrics rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:155— 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: Client engine/packages/depot-client/src/lib.rs:67— TooManyMethods — 50 methods, declared across 7 files: src/lib.rs (23), src/forks.rs (6), src/regional.rs (6), src/checkpoints.rs (5), +3 more file(s). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActorConnection rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:34— 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: VfsContext engine/packages/sqlite-embedded/src/vfs/transport.rs:701— 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: OverflowMap engine/packages/sqlite-prefetch/src/overflow/mod.rs:95— TooManyMethods — 46 methods, declared across 2 files: overflow/mod.rs (40), overflow/commit.rs (6). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WasmActorContext rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1292— 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: EngineContext engine/packages/engine-context/src/context.rs:361— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RegistryDispatcher rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:204— TooManyMethods — 42 methods, declared across 5 files: registry/inspector.rs (13), registry/mod.rs (12), registry/inspector_ws.rs (9), registry/http.rs (5), +1 more file(s). The bar is 30 methods; this is 12 over it, 1.40× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Ctx rivetkit-rust/packages/rivetkit/src/context.rs:24— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LogShardExecutor engine/packages/depot-log/src/log_shard_machine/executor/mod.rs:88— TooManyMethods — 41 methods, declared across 4 files: executor/mod.rs (18), executor/checkpoint.rs (11), executor/recovery.rs (7), executor/spare.rs (5). 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: Maintainer engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:267— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReadSession engine/packages/depot-worker/src/filesystem/session.rs:278— TooManyMethods — 38 methods, declared across 2 files: filesystem/session.rs (36), filesystem/base.rs (2). The bar is 30 methods; this is 8 over it, 1.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActorConnRaw rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:156— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ActorContextHandleAdapter rivetkit-typescript/packages/rivetkit/src/registry/native.ts:2792— 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.
Duplicated block (8 lines × 2) engine/packages/auth-jwt/src/key_ring_machine/executor.rs:55— engine/packages/auth-jwt/src/key_ring_machine/executor.rs:55-62 | engine/packages/cluster-config/src/cluster_config_machine/executor.rs:69-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/cluster-config/src/cluster_config_machine/executor.rs:69` it begins part-way through the construct above it, so those 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 (8 lines × 2) engine/packages/depot-volume/src/volume_client_machine/membership.rs:59— engine/packages/depot-volume/src/volume_client_machine/membership.rs:59-66 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/membership.rs:67-74 — 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 `engine/packages/depot-volume/src/volume_client_machine/membership.rs:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:279— engine/packages/depot-volume/src/volume_client_machine/recovery.rs:279-286 | engine/packages/depot-volume/src/volume_client_machine/recovery.rs:875-882 — both copies are in the same file, so extract the block into 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-worker/src/filesystem/checkpoints.rs:249— engine/packages/depot-worker/src/filesystem/checkpoints.rs:249-256 | engine/packages/depot-worker/src/filesystem/checkpoints.rs:259-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/checkpoints.rs:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) engine/packages/depot-worker/src/filesystem/checkpoints.rs:485— engine/packages/depot-worker/src/filesystem/checkpoints.rs:485-492 | engine/packages/depot-worker/src/filesystem/checkpoints.rs:987-994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/checkpoints.rs:485` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) engine/packages/depot-worker/src/filesystem/store.rs:1036— engine/packages/depot-worker/src/filesystem/store.rs:1036-1043 | engine/packages/depot-worker/src/filesystem/store.rs:1193-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/store.rs:1036` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:496— engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:496-503 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_references.rs:724-731 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:496` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1100— engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1100-1107 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:631-638 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) engine/packages/env/src/backends/production/fs.rs:241— engine/packages/env/src/backends/production/fs.rs:241-248 | engine/packages/env/src/backends/production/slatedb.rs:290-297 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/env/src/backends/production/fs.rs:241` 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 (8 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:2653— engine/packages/pegboard/src/actor_machine/mod.rs:2653-2660 | engine/packages/pegboard/src/commands.rs:530-537 — 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/pegboard/src/namespace_machine/mod.rs:1232— engine/packages/pegboard/src/namespace_machine/mod.rs:1232-1239 | engine/packages/pegboard/src/namespace_machine/mod.rs:1270-1277 — both copies are in the same file, so extract the block into 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/util/src/async_counter.rs:17— engine/packages/util/src/async_counter.rs:17-24 | engine/sdks/rust/envoy-client/src/async_counter.rs:26-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/async/client.rs:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/async/client.rs:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/async/client.rs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) rivetkit-rust/packages/client/src/protocol/codec.rs:135— rivetkit-rust/packages/client/src/protocol/codec.rs:135-142 | rivetkit-rust/packages/client/src/protocol/codec.rs:145-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/client/src/protocol/codec.rs:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:593— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:593-600 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:624-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 (8 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs:181— rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs:181-188 | rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:650-657 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/registry/inspector_ws.rs:181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:495— rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:495-502 | rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:540-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:495` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) engine/packages/depot-client/src/filesystem/txn.rs:381— engine/packages/depot-client/src/filesystem/txn.rs:381-388 | engine/packages/depot-client/src/filesystem/txn.rs:398-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 (8 lines × 2) rivetkit-python/client/src/simple/async/handle.rs:162— rivetkit-python/client/src/simple/async/handle.rs:162-169 | rivetkit-python/client/src/simple/sync/handle.rs:150-157 — `rivetkit-python/client/src/simple/async/handle.rs` and `rivetkit-python/client/src/simple/sync/handle.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 51 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 × 2) engine/packages/pegboard/src/actor_machine/mod.rs:2125— engine/packages/pegboard/src/actor_machine/mod.rs:2125-2132 | engine/packages/pegboard/src/legacy_backfill.rs:1722-1729 — before extracting anything, compare `engine/packages/pegboard/src/actor_machine/mod.rs` and `engine/packages/pegboard/src/legacy_backfill.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. 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/rivetkit-core/src/registry/http.rs:649— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:649-656 | rivetkit-rust/packages/shared-types/src/endpoint.rs:143-150 — 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/depot-client/src/filesystem/cache.rs:223— engine/packages/depot-client/src/filesystem/cache.rs:223-230 | engine/packages/depot-client/src/filesystem/rollback.rs:73-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) engine/sdks/rust/data/src/versioned/depot_fs.rs:125— engine/sdks/rust/data/src/versioned/depot_fs.rs:125-132 | engine/sdks/rust/data/src/versioned/mod.rs:50-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/depot_fs.rs:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/packages/cli/src/commands/logs.rs:77— engine/packages/cli/src/commands/logs.rs:77-82 | engine/packages/cli/src/commands/logs.rs:111-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 (6 lines × 2) engine/packages/depot-client/src/filesystem/client.rs:1700— engine/packages/depot-client/src/filesystem/client.rs:1700-1705 | engine/packages/depot-client/src/filesystem/client.rs:1776-1781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) engine/packages/depot-worker/src/command/groups.rs:234— engine/packages/depot-worker/src/command/groups.rs:234-239 | engine/packages/depot-worker/src/command/groups.rs:328-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/command/groups.rs:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/packages/depot-worker/src/filesystem/forks.rs:162— engine/packages/depot-worker/src/filesystem/forks.rs:162-167 | engine/packages/depot-worker/src/filesystem/forks.rs:176-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/forks.rs:162` 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 (6 lines × 2) engine/packages/depot-worker/src/filesystem/session.rs:791— engine/packages/depot-worker/src/filesystem/session.rs:791-796 | engine/packages/depot-worker/src/filesystem/session.rs:846-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/session.rs:791` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:60— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:60-66 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair_claims.rs:73-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1210— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1210-1215 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1352-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 (6 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:70— engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:70-75 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:2187-2192 — both copies are in the same file, so extract the block into 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-context/src/production/object_storage.rs:151— engine/packages/engine-context/src/production/object_storage.rs:151-156 | engine/packages/engine-context/src/production/object_storage.rs:172-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/engine-context/src/production/object_storage.rs:151` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/packages/engine/src/depot_command.rs:472— engine/packages/engine/src/depot_command.rs:472-477 | engine/packages/engine/src/depot_command.rs:502-507 — both copies are in the same file, so extract the block into 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/state-machine-durable/src/runner.rs:531— engine/packages/state-machine-durable/src/runner.rs:531-536 | engine/packages/state-machine-durable/src/runner.rs:568-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/state-machine-durable/src/runner.rs:531` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/sdks/rust/envoy-client/src/handle.rs:906— engine/sdks/rust/envoy-client/src/handle.rs:906-911 | engine/sdks/rust/envoy-client/src/handle.rs:946-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/handle.rs:906` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `SqliteRequest` in one and `RemoteSqliteRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:619— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:619-624 | rivetkit-rust/packages/shared-types/src/endpoint.rs:121-126 — 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-rust/packages/rivetkit-core/src/registry/http.rs:619` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:880— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:880-885 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:947-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:880` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `CreateConnStatePayload` in one and `BeforeConnectPayload` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:878` calls `set` and `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:945` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:693— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:693-698 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:712-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:3575— engine/packages/pegboard/src/actor_machine/mod.rs:3575-3580 | engine/packages/pegboard/src/namespace_machine/mod.rs:946-951 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `waiter` to `&wire::StartWaiter` in one and `&ns::NamespaceWaiter` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) engine/packages/sqlite-embedded/src/worker.rs:361— engine/packages/sqlite-embedded/src/worker.rs:361-366 | engine/sdks/rust/envoy-client/src/sqlite.rs:33-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/mod.rs:52— engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/mod.rs:52-57 | engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:29-34 — 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/sdks/rust/envoy-client/src/handle.rs:982— engine/sdks/rust/envoy-client/src/handle.rs:982-987 | engine/sdks/rust/envoy-client/src/tunnel.rs:116-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/tunnel.rs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:363— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:363-368 | 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/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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/actors/delete.rs:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/actors/reschedule.rs:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/packages/api-public/src/runner_pools/refresh_metadata.rs:58— engine/packages/api-public/src/runner_pools/refresh_metadata.rs:58-63 | engine/packages/api-public/src/runner_pools/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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/runner_pools/refresh_metadata.rs:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v1_to_auth_grants_v2.rs:10— engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v1_to_auth_grants_v2.rs:10-15 | engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v2_to_auth_grants_v1.rs:16-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v1_to_auth_grants_v2.rs:10` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `auth_grants_v1::TargetScope` in one and `auth_grants_v2::TargetScope` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (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:2037-2042 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `Buffer` in one and `Vec<u8>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) engine/packages/depot-client/src/filesystem/client.rs:1501— engine/packages/depot-client/src/filesystem/client.rs:1501-1511 | engine/packages/depot-client/src/filesystem/client.rs:1714-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-client/src/filesystem/client.rs:1501` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/depot-volume/src/ups/client.rs:93— engine/packages/depot-volume/src/ups/client.rs:93-103 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:270-280 — before extracting anything, compare `engine/packages/depot-volume/src/ups/client.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-volume/src/ups/client.rs:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/filesystem/fork_references.rs:1038— engine/packages/depot-worker/src/filesystem/fork_references.rs:1038-1048 | engine/packages/depot-worker/src/filesystem/fork_references.rs:1064-1074 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/fork_references.rs:1038` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spec` to `&FsForkSpec` in one and `FsForkSpec` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/filesystem/forks.rs:399— engine/packages/depot-worker/src/filesystem/forks.rs:399-409 | engine/packages/depot-worker/src/filesystem/forks.rs:622-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/forks.rs:399` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/filesystem/forks.rs:531— engine/packages/depot-worker/src/filesystem/forks.rs:531-541 | engine/packages/depot-worker/src/filesystem/forks.rs:690-700 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/forks.rs:531` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/filesystem/session.rs:774— engine/packages/depot-worker/src/filesystem/session.rs:774-784 | engine/packages/depot-worker/src/filesystem/session.rs:820-830 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/session.rs:774` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/stop_requests.rs:189— engine/packages/depot-worker/src/stop_requests.rs:189-199 | engine/packages/depot-worker/src/stop_requests.rs:225-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs:930— engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs:930-940 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:943-953 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:941` calls `VolumeSeqGap`, `Diverged` and `engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs:929` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) engine/packages/depot-worker/src/tablet_supervisor.rs:2150— engine/packages/depot-worker/src/tablet_supervisor.rs:2150-2160 | engine/packages/depot-worker/src/tablet_supervisor.rs:2195-2205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/error-macros/src/lib.rs:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/pegboard-gateway/src/routes.rs:315— engine/packages/pegboard-gateway/src/routes.rs:315-325 | engine/packages/pegboard-gateway/src/routes.rs:598-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard-gateway/src/routes.rs:315` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) engine/packages/sqlite-embedded/src/query.rs:282— engine/packages/sqlite-embedded/src/query.rs:282-292 | engine/packages/sqlite-embedded/src/query.rs:439-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/query.rs:282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/sqlite-embedded/src/query.rs:278` calls `Some`, `bind_params` and `engine/packages/sqlite-embedded/src/query.rs:438` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:2090— engine/packages/sqlite-embedded/src/vfs/transport.rs:2090-2100 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2245-2255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/vfs/transport.rs:2090` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/packages/sqlite-prefetch/src/prefetcher.rs:455— engine/packages/sqlite-prefetch/src/prefetcher.rs:455-465 | engine/packages/sqlite-prefetch/src/prefetcher.rs:724-734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-prefetch/src/prefetcher.rs:455` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) engine/packages/topology/src/topology_machine/lookup.rs:464— engine/packages/topology/src/topology_machine/lookup.rs:464-474 | engine/packages/topology/src/topology_machine/lookup.rs:514-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/topology/src/topology_machine/lookup.rs:464` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/sdks/rust/envoy-client/src/handle.rs:929— engine/sdks/rust/envoy-client/src/handle.rs:929-939 | engine/sdks/rust/envoy-client/src/handle.rs:969-979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/handle.rs:929` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/sdks/rust/envoy-client/src/sqlite.rs:559— engine/sdks/rust/envoy-client/src/sqlite.rs:559-569 | engine/sdks/rust/envoy-client/src/sqlite.rs:599-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/sqlite.rs:559` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:351— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:351-361 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:460-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:638— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:638-648 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:658-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:2181— engine/packages/sqlite-embedded/src/vfs/transport.rs:2181-2191 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2335-2345 — both copies are in the same file, so extract the block into 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:688— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:688-698 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:744-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:688` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:10— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:10-20 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:12-22 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 15 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:10` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::ActorData` in one and `pegboard_actor_v3::ActorData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:10— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:10-20 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:15-25 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:10` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::ActorData` in one and `pegboard_actor_v4::ActorData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1009— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1009-1019 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1069-1079 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1009` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::IndexUpsertActiveEnvoyRequest` in one and `pegboard_actor_v4::IndexUpsertActiveEnvoyRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:12— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:12-22 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:11-21 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:12` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v3::ActorData` in one and `pegboard_actor_v5::ActorData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) engine/packages/api-public-shim/src/routes.rs:1121— engine/packages/api-public-shim/src/routes.rs:1121-1129 | engine/packages/api-public-shim/src/routes.rs:1491-1499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public-shim/src/routes.rs:1121` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) engine/packages/depot-client/src/volumes/slot.rs:478— engine/packages/depot-client/src/volumes/slot.rs:478-486 | engine/packages/depot-client/src/volumes/slot.rs:742-750 — both copies are in the same file, so extract the block into 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-volume/src/volume_client_machine/executor/recovery.rs:147— engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:147-159 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:862-870 — 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 `engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:147` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-volume/src/volume_client_machine/runner.rs:859` calls `Some`, `take`, `clear` and `engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:146` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:514— engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:514-522 | engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:883-891 — before extracting anything, compare `engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs` and `engine/packages/depot-volume/src/volume_client_machine/pipeline.rs` as WHOLE FILES: this scan already matched 3 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 (9 lines × 2) engine/packages/depot-worker/src/filesystem/read.rs:439— engine/packages/depot-worker/src/filesystem/read.rs:439-447 | engine/packages/depot-worker/src/filesystem/read.rs:508-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/read.rs:439` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:215— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:215-224 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:239-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_cleanup.rs:149— engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_cleanup.rs:149-157 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_cleanup.rs:165-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_cleanup.rs:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1354— engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1354-1362 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:889-897 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) engine/packages/pegboard-gateway/src/websocket_tunnel.rs:175— engine/packages/pegboard-gateway/src/websocket_tunnel.rs:175-183 | engine/packages/pegboard-gateway/src/websocket_tunnel.rs:229-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:3850— engine/packages/sqlite-embedded/src/vfs/transport.rs:3850-3858 | engine/packages/sqlite-prefetch/src/harness/vfs.rs:384-392 — 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) rivetkit-rust/packages/client/src/remote_manager.rs:328— rivetkit-rust/packages/client/src/remote_manager.rs:328-336 | rivetkit-rust/packages/client/src/remote_manager.rs:393-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) rivetkit-rust/packages/client/src/remote_manager.rs:766— rivetkit-rust/packages/client/src/remote_manager.rs:766-774 | rivetkit-rust/packages/client/src/remote_manager.rs:810-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/client/src/remote_manager.rs:766` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:419— rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:419-427 | rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:472-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:872— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:872-880 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:896-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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:872` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:893` calls `Some`, `set_anyhow`, `from_str` and `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:871` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1070— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1070-1078 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1184-1192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1070` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:775— rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:775-783 | rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:803-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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/telemetry.rs:775` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) engine/packages/engine-context/src/production/object_storage.rs:169— engine/packages/engine-context/src/production/object_storage.rs:169-177 | engine/packages/engine-context/src/production/object_storage.rs:198-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/engine-context/src/production/object_storage.rs:169` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:179— engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:179-187 | engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:306-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:179` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:178` calls `V1`, `put_body` and `engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:305` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) engine/packages/depot-volume/src/ups/client.rs:218— engine/packages/depot-volume/src/ups/client.rs:218-226 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:391-399 — before extracting anything, compare `engine/packages/depot-volume/src/ups/client.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-volume/src/ups/client.rs:218` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:83— engine/packages/sqlite-embedded/src/vfs/transport.rs:83-91 | engine/packages/sqlite-embedded/src/worker.rs:2221-2229 — 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/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1037— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1037-1045 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1178-1186 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 15 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1037` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::NodePoolConfig` in one and `pegboard_actor_v3::NodePoolConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:997— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:997-1005 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1057-1065 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:997` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::ActiveEnvoyState` in one and `pegboard_actor_v4::ActiveEnvoyState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1179— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1179-1187 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1239-1247 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::NodePoolConfig` in one and `pegboard_actor_v4::NodePoolConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1019— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1019-1027 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1046-1054 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1019` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v3::ActiveEnvoyState` in one and `pegboard_actor_v5::ActiveEnvoyState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1201— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1201-1209 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1228-1236 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v3::NodePoolConfig` in one and `pegboard_actor_v5::NodePoolConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/packages/api-public-shim/src/lib.rs:278— engine/packages/api-public-shim/src/lib.rs:278-287 | engine/packages/pegboard-gateway/src/lib.rs:131-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public-shim/src/lib.rs:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) engine/packages/depot-worker/src/filesystem/fork_reads.rs:225— engine/packages/depot-worker/src/filesystem/fork_reads.rs:225-234 | engine/packages/depot-worker/src/filesystem/session.rs:2044-2053 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) engine/packages/depot-worker/src/filesystem/fork_references.rs:398— engine/packages/depot-worker/src/filesystem/fork_references.rs:398-407 | engine/packages/depot-worker/src/filesystem/fork_references.rs:665-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) engine/packages/depot-worker/src/tablet_coordinator_machine/state/split.rs:247— engine/packages/depot-worker/src/tablet_coordinator_machine/state/split.rs:247-256 | engine/packages/depot-worker/src/tablet_coordinator_machine/state/versions.rs:28-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_coordinator_machine/state/split.rs:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `report` to `&ParentLogImported` in one and `&VersionMarksReport` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:404— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:404-413 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:427-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:403` calls `begin_pass` and `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:426` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) engine/packages/engine/src/depot_command/health.rs:96— engine/packages/engine/src/depot_command/health.rs:96-105 | engine/packages/engine/src/depot_command/health.rs:143-152 — both copies are in the same file, so extract the block into 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-v2-migrator/src/operator.rs:24— engine/packages/pegboard-v2-migrator/src/operator.rs:24-33 | engine/packages/pegboard-v2-migrator/src/operator.rs:124-133 — both copies are in the same file, so extract the block into 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/actor_machine/mod.rs:2691— engine/packages/pegboard/src/actor_machine/mod.rs:2691-2700 | engine/packages/pegboard/src/legacy_backfill.rs:1740-1749 — before extracting anything, compare `engine/packages/pegboard/src/actor_machine/mod.rs` and `engine/packages/pegboard/src/legacy_backfill.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:2167— engine/packages/sqlite-embedded/src/vfs/transport.rs:2167-2176 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2320-2329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/vfs/transport.rs:2167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:3887— engine/packages/sqlite-embedded/src/vfs/transport.rs:3887-3896 | engine/packages/sqlite-prefetch/src/harness/vfs.rs:408-417 — 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/topology/src/topology_machine/publication.rs:200— engine/packages/topology/src/topology_machine/publication.rs:200-209 | engine/packages/topology/src/topology_machine/publication.rs:233-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/topology/src/topology_machine/publication.rs:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:24— engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:24-33 | engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v2_to_pegboard_v2_migrator_v1.rs:34-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:24` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:67— engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:67-76 | engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:86-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `topology_worker_heartbeat_v1::Data` in one and `topology_worker_heartbeat_v2::Heartbeat` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:126— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:126-135 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:150-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1712— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1712-1721 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1727-1736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `result` to `protocol::SqliteQueryResult` in one and `protocol::SqliteExecuteResult` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1023— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1023-1032 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1067-1076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1023` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1020` calls `Ok` and `rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1066` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:348— rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:348-357 | rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:407-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `response` to `ApplicationResponse` in one and `ServerlessResponse` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/packages/depot-worker/src/filesystem/checkpoints.rs:403— engine/packages/depot-worker/src/filesystem/checkpoints.rs:403-412 | engine/packages/depot-worker/src/filesystem/checkpoints.rs:932-941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/checkpoints.rs:403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) engine/packages/runtime/src/traces.rs:24— engine/packages/runtime/src/traces.rs:24-33 | rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:36-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:94— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:94-103 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:96-105 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 15 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::ActorCreateData` in one and `pegboard_actor_v3::ActorCreateData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:94— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:94-103 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:102-111 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::ActorCreateData` in one and `pegboard_actor_v4::ActorCreateData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:96— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:96-105 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:96-105 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v3::ActorCreateData` in one and `pegboard_actor_v5::ActorCreateData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:198— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:198-207 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:198-207 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v4::KeyOwner` in one and `pegboard_actor_v5::KeyOwner` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:3427— engine/packages/sqlite-embedded/src/vfs/transport.rs:3427-3436 | engine/packages/sqlite-embedded/src/vfs/transport.rs:3459-3468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/vfs/transport.rs:3427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:42— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:42-51 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:351-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/inspector-protocol/src/versioned.rs:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/packages/depot-fs-core/src/keys/slatedb.rs:1199— engine/packages/depot-fs-core/src/keys/slatedb.rs:1199-1205 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1327-1333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-fs-core/src/keys/slatedb.rs:1199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/packages/depot-volume/src/volume_client_machine/membership.rs:22— engine/packages/depot-volume/src/volume_client_machine/membership.rs:22-28 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/membership.rs:34-40 — 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-worker/src/filesystem/alarm_bootstrap.rs:111— engine/packages/depot-worker/src/filesystem/alarm_bootstrap.rs:111-117 | engine/packages/depot-worker/src/filesystem/alarm_bootstrap.rs:210-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/alarm_bootstrap.rs:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/packages/depot-worker/src/filesystem/forks.rs:207— engine/packages/depot-worker/src/filesystem/forks.rs:207-213 | engine/packages/depot-worker/src/filesystem/forks.rs:231-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) engine/packages/depot-worker/src/services/coordinator.rs:68— engine/packages/depot-worker/src/services/coordinator.rs:68-74 | engine/packages/depot-worker/src/services/log_shard.rs:80-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/services/coordinator.rs:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:359— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:359-365 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:380-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:1251— engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:1251-1257 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:1627-1633 — both copies are in the same file, so extract the block into 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-worker/src/tablet_maintainer_machine/state/stop.rs:409— engine/packages/depot-worker/src/tablet_maintainer_machine/state/stop.rs:409-415 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/stop.rs:531-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/stop.rs:409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:2496— engine/packages/pegboard/src/actor_machine/mod.rs:2496-2502 | engine/packages/pegboard/src/legacy_backfill.rs:1362-1368 — before extracting anything, compare `engine/packages/pegboard/src/actor_machine/mod.rs` and `engine/packages/pegboard/src/legacy_backfill.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. 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 × 2) engine/packages/pegboard/src/commands.rs:230— engine/packages/pegboard/src/commands.rs:230-236 | engine/packages/pegboard/src/commands.rs:292-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/commands.rs:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `wire::ActorCreateRequest` in one and `wire::MigrateFromV2Begin` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) engine/packages/pegboard/src/legacy_backfill.rs:1708— engine/packages/pegboard/src/legacy_backfill.rs:1708-1714 | engine/packages/pegboard/src/legacy_volumes.rs:339-345 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) engine/packages/sqlite-embedded/src/query.rs:400— engine/packages/sqlite-embedded/src/query.rs:400-406 | engine/packages/sqlite-embedded/src/query.rs:478-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/sqlite-embedded/src/query.rs:485` calls `default` and `engine/packages/sqlite-embedded/src/query.rs:408` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) engine/packages/topology/src/topology_machine/lease.rs:133— engine/packages/topology/src/topology_machine/lease.rs:133-139 | engine/packages/topology/src/topology_machine/publication.rs:59-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:537— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:537-543 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:648-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1175— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1175-1181 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1681-1687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) engine/packages/pegboard-gateway/src/migrate_from_v2/proxy.rs:144— engine/packages/pegboard-gateway/src/migrate_from_v2/proxy.rs:144-150 | engine/packages/pegboard-gateway/src/migrate_from_v2/proxy.rs:182-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard-gateway/src/migrate_from_v2/proxy.rs:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/packages/sqlite-prefetch/src/recency.rs:151— engine/packages/sqlite-prefetch/src/recency.rs:151-157 | engine/packages/sqlite-prefetch/src/recency.rs:209-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) engine/packages/auth-jwt/src/rotation.rs:154— engine/packages/auth-jwt/src/rotation.rs:154-160 | engine/packages/pegboard-v2-migrator/src/requests.rs:181-187 — 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 `engine/packages/auth-jwt/src/rotation.rs:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) engine/packages/depot-client/src/filesystem/cache.rs:446— engine/packages/depot-client/src/filesystem/cache.rs:446-452 | engine/packages/depot-client/src/filesystem/cache.rs:511-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-client/src/filesystem/cache.rs:446` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/mod.rs:75— engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/mod.rs:75-81 | engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:53-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) engine/packages/state-machine/src/state_machine.rs:102— engine/packages/state-machine/src/state_machine.rs:102-108 | engine/packages/topology/src/topology_machine/state.rs:262-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `op` to `OpId<S>` in one and `OperationId` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:965— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:965-971 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1004-1010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:965` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) engine/packages/sqlite-embedded/src/query.rs:163— engine/packages/sqlite-embedded/src/query.rs:163-169 | engine/packages/sqlite-embedded/src/query.rs:199-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1160— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1160-1166 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:120-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) engine/packages/cli/src/cloud.rs:286— engine/packages/cli/src/cloud.rs:286-297 | engine/packages/cli/src/cloud.rs:315-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/cli/src/cloud.rs:286` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/cli/src/cloud.rs:283` calls `status`, `Ok` and `engine/packages/cli/src/cloud.rs:314` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/filesystem/fork_references.rs:289— engine/packages/depot-worker/src/filesystem/fork_references.rs:289-300 | engine/packages/depot-worker/src/filesystem/fork_references.rs:691-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/fork_references.rs:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/filesystem/fork_references.rs:327— engine/packages/depot-worker/src/filesystem/fork_references.rs:327-338 | engine/packages/depot-worker/src/filesystem/fork_references.rs:767-778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/fork_references.rs:327` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/stop_requests.rs:162— engine/packages/depot-worker/src/stop_requests.rs:162-173 | engine/packages/depot-worker/src/stop_requests.rs:234-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/stop_requests.rs:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:829— engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:829-840 | engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:852-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:829` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:256— engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:256-267 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:309-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:542— engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:542-553 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_references.rs:770-781 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:542` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:2118— engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:2118-2129 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:2143-2154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:2118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator.rs:116— engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator.rs:116-127 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/operator_repair/mod.rs:235-246 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) engine/packages/engine/src/depot_peer.rs:17— engine/packages/engine/src/depot_peer.rs:17-28 | engine/packages/engine/src/depot_peer.rs:81-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/engine/src/depot_peer.rs:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/packages/pegboard-gateway/src/acquire.rs:742— engine/packages/pegboard-gateway/src/acquire.rs:742-753 | engine/packages/pegboard/src/actor_machine/mod.rs:2922-2933 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:1712— engine/packages/pegboard/src/actor_machine/mod.rs:1712-1723 | engine/packages/pegboard/src/legacy_backfill.rs:2687-2698 — before extracting anything, compare `engine/packages/pegboard/src/actor_machine/mod.rs` and `engine/packages/pegboard/src/legacy_backfill.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/actor_machine/mod.rs:1712` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/packages/pegboard/src/index.rs:1233— engine/packages/pegboard/src/index.rs:1233-1244 | engine/packages/pegboard/src/index.rs:1275-1286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/index.rs:1233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) engine/packages/sqlite-prefetch/src/overflow/commit.rs:401— engine/packages/sqlite-prefetch/src/overflow/commit.rs:401-412 | engine/packages/sqlite-prefetch/src/overflow/commit.rs:518-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/sqlite-prefetch/src/overflow/commit.rs:530` calls `extend` and `engine/packages/sqlite-prefetch/src/overflow/commit.rs:413` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) engine/sdks/rust/envoy-client/src/actor.rs:339— engine/sdks/rust/envoy-client/src/actor.rs:339-350 | engine/sdks/rust/envoy-client/src/actor.rs:355-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/actor.rs:339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (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: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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:157— rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:157-168 | rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:537-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/actors/reschedule.rs:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:258— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:258-269 | rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift:373-384 — 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:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×19
Edited copy of a member (13 corresponding lines) engine/packages/env/src/backends/production/external_http.rs:122— engine/packages/env/src/backends/production/external_http.rs:122-135 | engine/packages/env/src/backends/production/external_http.rs:138-150 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/pegboard/src/actor_machine/mod.rs:2493— engine/packages/pegboard/src/actor_machine/mod.rs:2493-2505 | engine/packages/pegboard/src/legacy_backfill.rs:1358-1373 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/api-builder/src/wrappers.rs:58— engine/packages/api-builder/src/wrappers.rs:58-77 | engine/packages/api-builder/src/wrappers.rs:113-135 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/api-builder/src/wrappers.rs:58— engine/packages/api-builder/src/wrappers.rs:58-78 | engine/packages/api-builder/src/wrappers.rs:113-136 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/api-builder/src/wrappers.rs:58— engine/packages/api-builder/src/wrappers.rs:58-79 | engine/packages/api-builder/src/wrappers.rs:113-137 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/membership.rs:58— engine/packages/depot-volume/src/volume_client_machine/membership.rs:58-70 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/membership.rs:66-78 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2166— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2166-2178 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2180-2198 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/membership.rs:21— engine/packages/depot-volume/src/volume_client_machine/membership.rs:21-33 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/membership.rs:33-45 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.rs:269— engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.rs:269-281 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.rs:466-478 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1074— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1074-1086 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:2536-2548 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/sqlite-prefetch/src/page.rs:281— engine/packages/sqlite-prefetch/src/page.rs:281-294 | engine/packages/sqlite-prefetch/src/recency.rs:338-350 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:281— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:281-293 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1746-1758 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:1655— engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:1655-1671 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:1945-1957 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:774— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:774-787 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:810-822 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/depot-client/src/filesystem/client.rs:2153— engine/packages/depot-client/src/filesystem/client.rs:2153-2167 | engine/packages/depot-client/src/filesystem/client.rs:2182-2194 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/sdks/rust/envoy-client/src/handle.rs:230— engine/sdks/rust/envoy-client/src/handle.rs:230-242 | engine/sdks/rust/envoy-client/src/handle.rs:890-903 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/util/src/async_counter.rs:105— engine/packages/util/src/async_counter.rs:105-119 | engine/sdks/rust/envoy-client/src/async_counter.rs:110-122 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:552— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:552-564 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:591-603 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) engine/packages/depot-volume/src/ups/client.rs:153— engine/packages/depot-volume/src/ups/client.rs:153-165 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:345-357 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×19
Edited copy of a member (11 corresponding lines) engine/packages/sqlite-prefetch/src/recency.rs:150— engine/packages/sqlite-prefetch/src/recency.rs:150-160 | engine/packages/sqlite-prefetch/src/recency.rs:208-218 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-client/src/filesystem/client.rs:1893— engine/packages/depot-client/src/filesystem/client.rs:1893-1905 | engine/packages/depot-client/src/filesystem/recovery.rs:45-55 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) rivetkit-rust/packages/client-protocol/src/versioned.rs:31— rivetkit-rust/packages/client-protocol/src/versioned.rs:31-41 | rivetkit-rust/packages/client-protocol/src/versioned.rs:437-632 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-worker/src/object_store_metrics.rs:666— engine/packages/depot-worker/src/object_store_metrics.rs:666-679 | engine/packages/depot-worker/src/object_store_metrics.rs:681-691 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-worker/src/metrics.rs:658— engine/packages/depot-worker/src/metrics.rs:658-668 | engine/packages/depot-worker/src/metrics.rs:670-681 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:398— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:398-408 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:415-427 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/members.rs:49— engine/packages/depot-worker/src/tablet_maintainer_machine/state/members.rs:49-59 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/members.rs:66-77 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/pegboard-envoy/src/connection.rs:2691— engine/packages/pegboard-envoy/src/connection.rs:2691-2705 | engine/packages/pegboard-v2-migrator/src/v3_actor.rs:80-90 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-client/src/client_protocol.rs:162— engine/packages/depot-client/src/client_protocol.rs:162-172 | engine/packages/depot-worker/src/command/volume_host.rs:2533-2543 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-worker/src/command/kv.rs:15— engine/packages/depot-worker/src/command/kv.rs:15-25 | engine/packages/pegboard/src/index.rs:622-635 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2949— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2949-2959 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3102-3113 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v1_to_auth_grants_v2.rs:47— engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v1_to_auth_grants_v2.rs:47-57 | engine/sdks/rust/data/src/versioned/auth_grants/auth_grants_v2_to_auth_grants_v1.rs:54-64 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1437— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1437-1447 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1450-1463 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-client/src/filesystem/client.rs:2068— engine/packages/depot-client/src/filesystem/client.rs:2068-2078 | engine/packages/depot-client/src/filesystem/client.rs:2238-2254 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-client/src/filesystem/cache.rs:258— engine/packages/depot-client/src/filesystem/cache.rs:258-268 | engine/packages/depot-client/src/filesystem/rollback.rs:104-114 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2853— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2853-2863 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2866-2876 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:10— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:10-20 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:11-21 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/pegboard/src/legacy_backfill.rs:1753— engine/packages/pegboard/src/legacy_backfill.rs:1753-1763 | engine/packages/pegboard/src/actor_machine/mod.rs:2676-2686 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) engine/packages/guard-core/src/errors.rs:138— engine/packages/guard-core/src/errors.rs:138-148 | rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:2072-2083 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×17
Edited copy of a member (14 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/logged_ops.rs:32— engine/packages/depot-worker/src/tablet_maintainer_machine/state/logged_ops.rs:32-47 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/maintainer_log/replay.rs:173-186 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/depot-client/src/filesystem/client.rs:2301— engine/packages/depot-client/src/filesystem/client.rs:2301-2314 | engine/packages/depot-client/src/filesystem/client.rs:2322-2342 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/depot-client/src/filesystem/txn.rs:380— engine/packages/depot-client/src/filesystem/txn.rs:380-393 | engine/packages/depot-client/src/filesystem/txn.rs:394-412 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:402— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:402-416 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:426-439 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:170— rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:170-183 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:185-198 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/cli/src/cloud.rs:281— engine/packages/cli/src/cloud.rs:281-297 | engine/packages/cli/src/cloud.rs:313-326 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:200— rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:200-213 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:215-231 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/pegboard/src/legacy_backfill.rs:1288— engine/packages/pegboard/src/legacy_backfill.rs:1288-1305 | engine/packages/pegboard/src/legacy_volumes.rs:300-313 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/pegboard/src/catalog.rs:413— engine/packages/pegboard/src/catalog.rs:413-426 | engine/packages/pegboard/src/catalog.rs:437-452 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:210— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:210-223 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1675-1688 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:715— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:715-730 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:2182-2195 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/sdks/rust/data/src/families.rs:184— engine/sdks/rust/data/src/families.rs:184-197 | engine/sdks/rust/data/src/families.rs:223-236 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:599— rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:599-612 | rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:631-644 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:65— engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:65-79 | engine/sdks/rust/data/src/versioned/topology_worker_heartbeat.rs:84-97 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1710— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1710-1723 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1725-1740 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/pegboard/src/actor_machine/mod.rs:2445— engine/packages/pegboard/src/actor_machine/mod.rs:2445-2458 | engine/packages/pegboard/src/actor_machine/mod.rs:2749-2763 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) engine/packages/depot-client/src/forks.rs:296— engine/packages/depot-client/src/forks.rs:296-309 | engine/packages/pegboard/src/actor_machine/executor.rs:1252-1268 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
pegboard::index::reconcile_active_envoy_page (cognitive 71) engine/packages/pegboard/src/index.rs:667— pegboard::index::reconcile_active_envoy_page has cognitive complexity 71 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 5 (10 pts), boolean chains 6, match/switch 1 (nesting depth added 40). 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::index::prepare_active_envoy_index (cognitive 48) engine/packages/pegboard/src/index.rs:851— pegboard::index::prepare_active_envoy_index has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 5 (11 pts), loops 3 (7 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::legacy_backfill::legacy_move_page (cognitive 40) engine/packages/pegboard/src/legacy_backfill.rs:249— pegboard::legacy_backfill::legacy_move_page has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 6 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::actor_machine::legacy_move_input (cognitive 27) engine/packages/pegboard/src/actor_machine/mod.rs:2517— pegboard::actor_machine::legacy_move_input has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 4 (7 pts), boolean chains 4 (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.
pegboard::legacy_namespace_rows::legacy_walk (cognitive 27) engine/packages/pegboard/src/legacy_namespace_rows.rs:233— pegboard::legacy_namespace_rows::legacy_walk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::catalog::pool_handler (cognitive 22) engine/packages/pegboard/src/catalog.rs:1102— pegboard::catalog::pool_handler has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, 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.
pegboard::legacy_backfill::claim_database (cognitive 21) engine/packages/pegboard/src/legacy_backfill.rs:2420— pegboard::legacy_backfill::claim_database has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::legacy_backfill::wait_ready (cognitive 21) engine/packages/pegboard/src/legacy_backfill.rs:2648— pegboard::legacy_backfill::wait_ready has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::actor_machine::try_complete_initialization (cognitive 19) engine/packages/pegboard/src/actor_machine/mod.rs:1384— pegboard::actor_machine::try_complete_initialization has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pegboard::actor_machine::needs_allocation_at_version (cognitive 18) engine/packages/pegboard/src/actor_machine/mod.rs:2945— pegboard::actor_machine::needs_allocation_at_version has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (9 pts), boolean chains 7, if/else 2 (nesting depth added 4). 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::legacy_backfill::finish (cognitive 18) engine/packages/pegboard/src/legacy_backfill.rs:739— pegboard::legacy_backfill::finish has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::legacy_backfill::probe_bucket (cognitive 18) engine/packages/pegboard/src/legacy_backfill.rs:963— pegboard::legacy_backfill::probe_bucket has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::legacy_backfill::move_actor (cognitive 18) engine/packages/pegboard/src/legacy_backfill.rs:1489— pegboard::legacy_backfill::move_actor has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (9 pts), if/else 8, boolean chains 1 (nesting depth added 3). 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::legacy_backfill::plan_move (cognitive 17) engine/packages/pegboard/src/legacy_backfill.rs:1803— pegboard::legacy_backfill::plan_move has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard::index::ensure_active_envoy_versions (cognitive 16) engine/packages/pegboard/src/index.rs:1034— pegboard::index::ensure_active_envoy_versions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::read_operation (cognitive 47) engine/packages/depot-worker/src/filesystem/read.rs:204— FilesystemStore::read_operation has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 12 (19 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.
FilesystemStore::select_fork_point (cognitive 44) engine/packages/depot-worker/src/filesystem/fork_references.rs:93— FilesystemStore::select_fork_point has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::checkpoint_change (cognitive 43) engine/packages/depot-worker/src/filesystem/checkpoints.rs:635— FilesystemStore::checkpoint_change has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 6 (11 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::read_base_rows (cognitive 35) engine/packages/depot-worker/src/filesystem/fork_reads.rs:66— FilesystemStore::read_base_rows has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 3 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 20). 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.
FilesystemStore::plan_range_whiteouts (cognitive 28) engine/packages/depot-worker/src/filesystem/apply.rs:388— FilesystemStore::plan_range_whiteouts has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::copy_materialized_page (cognitive 28) engine/packages/depot-worker/src/filesystem/materialize.rs:59— FilesystemStore::copy_materialized_page has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::fork_store_action (cognitive 25) engine/packages/depot-worker/src/filesystem/forks.rs:1063— FilesystemStore::fork_store_action has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 4 (6 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.
FilesystemStore::remember_fork_reference_over (cognitive 24) engine/packages/depot-worker/src/filesystem/forks.rs:419— FilesystemStore::remember_fork_reference_over has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::sweep_locked (cognitive 24) engine/packages/depot-worker/src/filesystem/store.rs:1272— FilesystemStore::sweep_locked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::fork_reference_request (cognitive 22) engine/packages/depot-worker/src/filesystem/fork_references.rs:1137— FilesystemStore::fork_reference_request has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 4 (6 pts), boolean chains 2 (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.
FilesystemStore::checkpoint_page (cognitive 21) engine/packages/depot-worker/src/filesystem/checkpoints.rs:202— FilesystemStore::checkpoint_page has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::apply_maintainer_op (cognitive 21) engine/packages/depot-worker/src/filesystem/maintainer_ops.rs:41— FilesystemStore::apply_maintainer_op has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 3 (6 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.
FilesystemStore::acquire_fork_reference (cognitive 20) engine/packages/depot-worker/src/filesystem/fork_references.rs:615— FilesystemStore::acquire_fork_reference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, match/switch 2, boolean chains 1, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FilesystemStore::copy_fork_metadata (cognitive 18) engine/packages/depot-worker/src/filesystem/forks.rs:523— FilesystemStore::copy_fork_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilesystemStore::plan_flush (cognitive 17) engine/packages/depot-worker/src/filesystem/store.rs:1022— FilesystemStore::plan_flush has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×15
Edited copy of a member (7 corresponding lines) engine/packages/depot-client/src/filesystem/cache.rs:66— engine/packages/depot-client/src/filesystem/cache.rs:66-72 | engine/packages/depot-worker/src/filesystem/fork_reads.rs:256-262 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/pegboard/src/keys/partition.rs:178— engine/packages/pegboard/src/keys/partition.rs:178-184 | engine/packages/pegboard/src/keys/partition.rs:193-200 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-fs-core/src/store.rs:162— engine/packages/depot-fs-core/src/store.rs:162-168 | engine/packages/depot-fs-core/src/store.rs:198-205 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/singleton-coordinator/src/singleton_coordinator_machine/snapshot.rs:40— engine/packages/singleton-coordinator/src/singleton_coordinator_machine/snapshot.rs:40-46 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:46-52 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1155— engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1155-1161 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1165-1171 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) rivetkit-rust/packages/client/src/handle.rs:200— rivetkit-rust/packages/client/src/handle.rs:200-207 | rivetkit-rust/packages/client/src/handle.rs:252-258 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/cli/src/commands/cluster/env.rs:77— engine/packages/cli/src/commands/cluster/env.rs:77-83 | engine/packages/cli/src/commands/cluster/secret.rs:82-88 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/engine/src/epoxy_services.rs:90— engine/packages/engine/src/epoxy_services.rs:90-100 | engine/packages/pegboard-v2-migrator/src/services/migrator.rs:94-100 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:126— rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:126-132 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2118-2125 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/engine-context/src/context.rs:160— engine/packages/engine-context/src/context.rs:160-166 | engine/packages/pegboard/src/catalog.rs:175-181 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:413— engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:413-419 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/maintainer_log/mod.rs:483-494 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_cleanup.rs:128— engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_cleanup.rs:128-134 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.rs:223-231 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:105— engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:105-111 | engine/packages/state-machine/src/deadline_queue.rs:157-163 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3522— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3522-3528 | engine/packages/engine/src/depot_peer.rs:218-226 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:186— engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:186-193 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:412-418 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 2) engine/packages/depot-client/src/filesystem/client.rs:1894— engine/packages/depot-client/src/filesystem/client.rs:1894-1898 | engine/packages/depot-client/src/filesystem/recovery.rs:46-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 (5 lines × 2) engine/packages/depot-worker/src/command/mod.rs:870— engine/packages/depot-worker/src/command/mod.rs:870-874 | engine/packages/depot-worker/src/command/mod.rs:912-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/command/mod.rs:870` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:143— engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:143-148 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:281-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:149` calls `request_count`, `Some` and `engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:286` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:442— engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:442-446 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/lifecycle.rs:459-463 — both copies are in the same file, so extract the block into 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/durable-reconciler/src/core/reconciliation_machine/mod.rs:77— engine/packages/durable-reconciler/src/core/reconciliation_machine/mod.rs:77-81 | engine/packages/durable-reconciler/src/core/reconciliation_machine/mod.rs:87-91 — both copies are in the same file, so extract the block into 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/env/src/backends/production/fs.rs:233— engine/packages/env/src/backends/production/fs.rs:233-237 | engine/packages/env/src/backends/production/slatedb.rs:284-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/env/src/backends/production/fs.rs:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `root` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) engine/packages/sqlite-prefetch/src/driver.rs:106— engine/packages/sqlite-prefetch/src/driver.rs:106-110 | engine/packages/sqlite-prefetch/src/driver.rs:141-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-prefetch/src/driver.rs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) engine/packages/depot-client/src/volume_requests.rs:232— engine/packages/depot-client/src/volume_requests.rs:232-236 | engine/packages/depot-client/src/volumes/mod.rs:495-499 — 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 `engine/packages/depot-client/src/volumes/mod.rs:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `mut` in one and `crate) fn with_dispatch_guard( mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) engine/packages/epoxy/src/commands.rs:96— engine/packages/epoxy/src/commands.rs:96-100 | engine/packages/pegboard/src/index.rs:2008-2012 — 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/src/legacy_backfill.rs:1334— engine/packages/pegboard/src/legacy_backfill.rs:1334-1338 | engine/packages/pegboard/src/legacy_volumes.rs:369-373 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) rivetkit-rust/packages/client/src/remote_manager.rs:206— rivetkit-rust/packages/client/src/remote_manager.rs:206-210 | rivetkit-rust/packages/client/src/remote_manager.rs:269-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) engine/packages/cli/src/commands/pool.rs:161— engine/packages/cli/src/commands/pool.rs:161-165 | engine/packages/cli/src/target.rs:287-291 — 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/api-peer/src/repair/inspect.rs:150— engine/packages/api-peer/src/repair/inspect.rs:150-154 | engine/packages/api-peer/src/repair/inspect.rs:174-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1161— engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1161-1165 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1172-1176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1040— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1040-1044 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:1048-1052 — both copies are in the same file, so extract the 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· Edited copy of a member (16 corresponding lines) · ×14
Edited copy of a member (16 corresponding lines) engine/packages/sqlite-embedded/src/page_buffer.rs:384— engine/packages/sqlite-embedded/src/page_buffer.rs:384-401 | engine/packages/sqlite-embedded/src/page_buffer.rs:414-429 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/depot-worker/src/filesystem/forks.rs:206— engine/packages/depot-worker/src/filesystem/forks.rs:206-221 | engine/packages/depot-worker/src/filesystem/forks.rs:230-245 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/util/src/async_counter.rs:57— engine/packages/util/src/async_counter.rs:57-75 | engine/sdks/rust/envoy-client/src/async_counter.rs:52-67 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rivetkit-python/client/src/events/async/handle.rs:65— rivetkit-python/client/src/events/async/handle.rs:65-84 | rivetkit-python/client/src/events/sync/handle.rs:47-62 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rivetkit-swift/Sources/RivetKitSwiftUI/Actor.swift:53— rivetkit-swift/Sources/RivetKitSwiftUI/Actor.swift:53-68 | rivetkit-swift/Sources/RivetKitSwiftUI/Actor.swift:70-85 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1187— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1187-1203 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:136-151 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/auth-jwt/src/keys.rs:51— engine/packages/auth-jwt/src/keys.rs:51-66 | engine/packages/auth-jwt/src/token_id.rs:41-56 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/pegboard/src/catalog.rs:739— engine/packages/pegboard/src/catalog.rs:739-754 | engine/packages/pegboard/src/commands.rs:611-628 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:97— rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:97-112 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2567-2582 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/util/src/async_counter.rs:77— engine/packages/util/src/async_counter.rs:77-99 | engine/sdks/rust/envoy-client/src/async_counter.rs:69-84 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rivetkit-rust/packages/rivetkit/src/registry.rs:154— rivetkit-rust/packages/rivetkit/src/registry.rs:154-169 | rivetkit-rust/packages/rivetkit/src/registry.rs:173-189 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:537— rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:537-553 | rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:555-570 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/depot-worker/src/filesystem/fork_reads.rs:238— engine/packages/depot-worker/src/filesystem/fork_reads.rs:238-253 | engine/packages/depot-worker/src/filesystem/session.rs:449-467 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) engine/packages/api-public-shim/src/lib.rs:23— engine/packages/api-public-shim/src/lib.rs:23-38 | engine/packages/pegboard-gateway/src/lib.rs:26-42 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×13
Edited copy of a member (10 corresponding lines) rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:233— rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:233-242 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:244-253 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:958— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:958-969 | rivetkit-swift/Sources/RivetKitClient/ActorHandle.swift:225-234 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) rivetkit-rust/packages/client-protocol/src/versioned.rs:330— rivetkit-rust/packages/client-protocol/src/versioned.rs:330-339 | rivetkit-rust/packages/client-protocol/src/versioned.rs:343-352 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/api-public-shim/src/routes.rs:2429— engine/packages/api-public-shim/src/routes.rs:2429-2441 | engine/packages/api-public-shim/src/routes.rs:2447-2456 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/depot-worker/src/services/storage.rs:157— engine/packages/depot-worker/src/services/storage.rs:157-169 | engine/packages/engine-context/src/services/depot_client.rs:185-194 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/sqlite-embedded/src/query.rs:130— engine/packages/sqlite-embedded/src/query.rs:130-139 | engine/packages/sqlite-embedded/src/query.rs:147-156 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1079— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1079-1088 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1331-1346 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:114— rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:114-123 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2105-2115 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/depot-client/src/filesystem/cache.rs:1379— engine/packages/depot-client/src/filesystem/cache.rs:1379-1388 | engine/packages/depot-client/src/filesystem/transaction.rs:705-714 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/maintainer_log/mod.rs:1480— engine/packages/depot-worker/src/tablet_maintainer_machine/state/maintainer_log/mod.rs:1480-1489 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/maintainer_log/mod.rs:1727-1736 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/member_repair.rs:230— engine/packages/depot-worker/src/tablet_maintainer_machine/state/member_repair.rs:230-239 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/opening.rs:368-378 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:552— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:552-561 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:406-415 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:94— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:94-103 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:96-105 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×13
Edited copy of a member (12 corresponding lines) engine/packages/api-peer/src/volumes/read.rs:129— engine/packages/api-peer/src/volumes/read.rs:129-140 | engine/packages/depot-client/src/filesystem/remote.rs:592-607 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:163— engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:163-174 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:874-888 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/api-builder/src/wrappers.rs:32— engine/packages/api-builder/src/wrappers.rs:32-75 | engine/packages/api-builder/src/wrappers.rs:91-133 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/api-builder/src/wrappers.rs:32— engine/packages/api-builder/src/wrappers.rs:32-76 | engine/packages/api-builder/src/wrappers.rs:91-134 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/api-peer/src/repair/inspect.rs:379— engine/packages/api-peer/src/repair/inspect.rs:379-390 | engine/packages/api-peer/src/repair/inspect.rs:409-420 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/http.rs:78— rivetkit-typescript/packages/rivetkit-napi/src/http.rs:78-92 | rivetkit-typescript/packages/rivetkit-napi/src/http.rs:95-106 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/pegboard-gateway/src/http_tunnel.rs:355— engine/packages/pegboard-gateway/src/http_tunnel.rs:355-368 | engine/packages/pegboard-gateway/src/websocket_tunnel.rs:326-337 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/api-public/src/auth/tokens.rs:28— engine/packages/api-public/src/auth/tokens.rs:28-42 | engine/packages/api-public/src/auth/tokens.rs:132-143 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:22— engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:22-33 | engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v2_to_pegboard_v2_migrator_v1.rs:32-43 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2631— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2631-2644 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2646-2657 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:229— engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:229-240 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/alarms.rs:241-254 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:500— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:500-511 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1965-1976 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) rivetkit-rust/packages/rivetkit/src/start.rs:507— rivetkit-rust/packages/rivetkit/src/start.rs:507-519 | rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:900-911 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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 22 project(s), so it's rigid to change.
Off the main sequence: rivet-sqlite-types — rivet-sqlite-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: rivetkit-actor-persist — rivetkit-actor-persist: 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-error — rivet-error: abstractness 0.00, instability 0.04, distance 0.96 — zone of pain — concrete and depended on by 22 project(s), so it's rigid to change.
Off the main sequence: rivet-metrics — rivet-metrics: abstractness 0.17, instability 0.00, distance 0.83 — zone of pain — concrete and depended on by 26 project(s), so it's rigid to change.
Off the main sequence: rivet-auth-policy — rivet-auth-policy: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: rivet-env — rivet-env: abstractness 0.20, instability 0.03, distance 0.76 — zone of pain — concrete and depended on by 28 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 1 project(s), so it's rigid to change.
Off the main sequence: rivet-data — rivet-data: abstractness 0.22, instability 0.04, distance 0.74 — zone of pain — concrete and depended on by 26 project(s), so it's rigid to change.
Off the main sequence: depot-fs-core — depot-fs-core: abstractness 0.01, instability 0.25, distance 0.74 — zone of pain — concrete and depended on by 9 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 1 project(s), so it's rigid to change.
Off the main sequence: depot-types — depot-types: abstractness 0.00, instability 0.27, distance 0.73 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
FilesystemStore::read_operation (cyclomatic 37) engine/packages/depot-worker/src/filesystem/read.rs:204— FilesystemStore::read_operation has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FilesystemStore::checkpoint_change (cyclomatic 34) engine/packages/depot-worker/src/filesystem/checkpoints.rs:635— FilesystemStore::checkpoint_change has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FilesystemStore::select_fork_point (cyclomatic 24) engine/packages/depot-worker/src/filesystem/fork_references.rs:93— FilesystemStore::select_fork_point 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.
FilesystemStore::fork_store_action (cyclomatic 23) engine/packages/depot-worker/src/filesystem/forks.rs:1063— FilesystemStore::fork_store_action 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.
FilesystemStore::remember_fork_reference_over (cyclomatic 22) engine/packages/depot-worker/src/filesystem/forks.rs:419— FilesystemStore::remember_fork_reference_over 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.
FilesystemStore::fork_reference_request (cyclomatic 21) engine/packages/depot-worker/src/filesystem/fork_references.rs:1137— FilesystemStore::fork_reference_request 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.
FilesystemStore::acquire_fork_reference (cyclomatic 19) engine/packages/depot-worker/src/filesystem/fork_references.rs:615— FilesystemStore::acquire_fork_reference 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.
FilesystemStore::copy_materialized_page (cyclomatic 19) engine/packages/depot-worker/src/filesystem/materialize.rs:59— FilesystemStore::copy_materialized_page 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.
FilesystemStore::sweep_locked (cyclomatic 19) engine/packages/depot-worker/src/filesystem/store.rs:1272— FilesystemStore::sweep_locked has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FilesystemStore::plan_range_whiteouts (cyclomatic 18) engine/packages/depot-worker/src/filesystem/apply.rs:388— FilesystemStore::plan_range_whiteouts 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.
FilesystemStore::apply_maintainer_op (cyclomatic 18) engine/packages/depot-worker/src/filesystem/maintainer_ops.rs:41— FilesystemStore::apply_maintainer_op 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.
FilesystemStore::read_base_rows (cyclomatic 17) engine/packages/depot-worker/src/filesystem/fork_reads.rs:66— FilesystemStore::read_base_rows has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×12
Edited copy of a member (8 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:318— engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:318-325 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:345-352 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/cli/src/commands/pool.rs:157— engine/packages/cli/src/commands/pool.rs:157-167 | engine/packages/cli/src/target.rs:286-293 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/cluster-config/src/cluster_config_machine/state.rs:37— engine/packages/cluster-config/src/cluster_config_machine/state.rs:37-44 | engine/packages/singleton-coordinator/src/singleton_coordinator_machine/state.rs:72-81 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/depot-worker/src/filesystem/session.rs:923— engine/packages/depot-worker/src/filesystem/session.rs:923-930 | engine/packages/depot-worker/src/filesystem/session.rs:1111-1128 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/depot-client/src/filesystem/txn.rs:413— engine/packages/depot-client/src/filesystem/txn.rs:413-420 | engine/packages/depot-client/src/filesystem/txn.rs:473-483 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/sqlite-embedded/src/page_buffer.rs:106— engine/packages/sqlite-embedded/src/page_buffer.rs:106-113 | engine/packages/sqlite-embedded/src/page_buffer.rs:114-124 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/pegboard-gateway/src/routes.rs:917— engine/packages/pegboard-gateway/src/routes.rs:917-924 | engine/packages/pegboard-gateway/src/migrate_from_v2/mod.rs:85-92 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/sqlite-embedded/src/query.rs:729— engine/packages/sqlite-embedded/src/query.rs:729-736 | rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:990-997 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:1233— rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:1233-1240 | rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:1264-1272 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:475— rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:475-483 | rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:893-900 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:113— engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:113-120 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_references.rs:108-115 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) engine/packages/depot-log/src/log_shard_machine/state/replica_table.rs:112— engine/packages/depot-log/src/log_shard_machine/state/replica_table.rs:112-121 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/volume_keys.rs:82-89 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×12
Edited copy of a member (6 corresponding lines) engine/packages/keys/src/keys/codec.rs:405— engine/packages/keys/src/keys/codec.rs:405-410 | engine/packages/keys/src/keys/codec.rs:445-450 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/packages/auth-jwt/src/key_ring_machine/mod.rs:266— engine/packages/auth-jwt/src/key_ring_machine/mod.rs:266-271 | engine/packages/cluster-config/src/cluster_config_machine/mod.rs:249-254 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/packages/pegboard-v2-migrator/src/commands.rs:68— engine/packages/pegboard-v2-migrator/src/commands.rs:68-74 | engine/packages/pegboard/src/index.rs:999-1004 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1246— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1246-1252 | rivetkit-swift/Sources/RivetKitClient/Errors.swift:9-14 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/sdks/rust/migrate-from-v2-protocol/src/lib.rs:66— engine/sdks/rust/migrate-from-v2-protocol/src/lib.rs:66-71 | rivetkit-rust/packages/rivetkit-core/src/actor/keys.rs:120-125 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/packages/depot-client/src/volume_requests.rs:448— engine/packages/depot-client/src/volume_requests.rs:448-453 | engine/packages/depot-volume/src/ups.rs:37-42 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1409— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1409-1414 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1516-1521 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:2892— engine/packages/depot-worker/src/tablet_maintainer_machine/state/groups.rs:2892-2897 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/retired.rs:271-276 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1388— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1388-1393 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1531-1539 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:3265— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:3265-3270 | rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:25-30 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/packages/depot-fs-core/src/keys/slatedb.rs:355— engine/packages/depot-fs-core/src/keys/slatedb.rs:355-361 | engine/packages/depot-fs-core/src/work.rs:27-32 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) engine/packages/depot-worker/src/filesystem/repair.rs:22— engine/packages/depot-worker/src/filesystem/repair.rs:22-28 | engine/packages/depot-worker/src/filesystem/store.rs:172-177 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
rivet_envoy_client::envoy::envoy_loop (cognitive 71) engine/sdks/rust/envoy-client/src/envoy.rs:568— rivet_envoy_client::envoy::envoy_loop has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (57 pts), match/switch 3 (9 pts), boolean chains 3, loops 2 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::connection::native::serve_connection (cognitive 68) engine/sdks/rust/envoy-client/src/connection/native.rs:215— rivet_envoy_client::connection::native::serve_connection has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (48 pts), match/switch 7 (17 pts), loops 2, boolean chains 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::actor::actor_inner (cognitive 64) engine/sdks/rust/envoy-client/src/actor.rs:284— rivet_envoy_client::actor::actor_inner has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (50 pts), match/switch 4 (13 pts), loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::actor::http::send_response (cognitive 44) engine/sdks/rust/envoy-client/src/actor/http.rs:656— 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:1115— 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::wasm::imp::single_connection (cognitive 34) engine/sdks/rust/envoy-client/src/connection/wasm.rs:92— rivet_envoy_client::connection::wasm::imp::single_connection has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 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::tunnel::handle_tunnel_message (cognitive 28) engine/sdks/rust/envoy-client/src/tunnel.rs:153— rivet_envoy_client::tunnel::handle_tunnel_message has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, match/switch 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.
rivet_envoy_client::actor::http::handle_req_chunk (cognitive 23) engine/sdks/rust/envoy-client/src/actor/http.rs:432— rivet_envoy_client::actor::http::handle_req_chunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::commands::handle_commands (cognitive 23) engine/sdks/rust/envoy-client/src/commands.rs:114— rivet_envoy_client::commands::handle_commands has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3, 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.
rivet_envoy_client::tunnel::handle_request_start (cognitive 19) engine/sdks/rust/envoy-client/src/tunnel.rs:418— rivet_envoy_client::tunnel::handle_request_start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_envoy_client::connection::native::connection_loop (cognitive 16) engine/sdks/rust/envoy-client/src/connection/native.rs:65— rivet_envoy_client::connection::native::connection_loop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_volume::volume_client_machine::requests::admit (cognitive 50) engine/packages/depot-volume/src/volume_client_machine/requests.rs:18— depot_volume::volume_client_machine::requests::admit has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (37 pts), boolean chains 10, match/switch 1 (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.
depot_volume::volume_client_machine::recovery::read (cognitive 29) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:496— depot_volume::volume_client_machine::recovery::read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, match/switch 2 (4 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.
depot_volume::volume_client_machine::membership::adopt (cognitive 25) engine/packages/depot-volume/src/volume_client_machine/membership.rs:139— depot_volume::volume_client_machine::membership::adopt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_volume::volume_client_machine::recovery::begin_recovery (cognitive 25) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:23— depot_volume::volume_client_machine::recovery::begin_recovery has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
depot_volume::volume_client_machine::recovery::copy (cognitive 23) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:897— depot_volume::volume_client_machine::recovery::copy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 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.
depot_volume::volume_client_machine::lifecycle::opened (cognitive 22) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:112— depot_volume::volume_client_machine::lifecycle::opened has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 3 (4 pts), boolean chains 3, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
depot_volume::volume_client_machine::lifecycle::expired (cognitive 22) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:422— depot_volume::volume_client_machine::lifecycle::expired has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_volume::volume_client_machine::pipeline::send_to (cognitive 19) engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:47— depot_volume::volume_client_machine::pipeline::send_to has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_volume::volume_client_machine::pipeline::fence_with_error (cognitive 19) engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:850— depot_volume::volume_client_machine::pipeline::fence_with_error has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_volume::volume_client_machine::waiting::dispatch (cognitive 18) engine/packages/depot-volume/src/volume_client_machine/waiting.rs:124— depot_volume::volume_client_machine::waiting::dispatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_volume::volume_client_machine::repair::fetched (cognitive 16) engine/packages/depot-volume/src/volume_client_machine/repair.rs:359— depot_volume::volume_client_machine::repair::fetched has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 4, match/switch 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFields: ActorContextInner rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:88— TooManyFields — 91 stored fields. The bar is 30 stored fields; this is 61 over it, 3.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.
TooManyFields: MaintainerState engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:634— TooManyFields — 82 stored fields beside 15 methods. The bar is 30 stored fields; this is 52 over it, 2.73× 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: DepotConfig engine/packages/config/src/config/depot.rs:11— TooManyFields — 59 stored fields beside 19 methods. The bar is 30 stored fields; this is 29 over it, 1.97× 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:219— TooManyFields — 50 stored fields beside 1 method. The bar is 30 stored fields; this is 20 over it, 1.67× 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: StoreSnapshot engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:94— TooManyFields — 48 stored fields. The bar is 30 stored fields; this is 18 over it, 1.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: VolumeClientState engine/packages/depot-volume/src/volume_client_machine/state.rs:340— TooManyFields — 45 stored fields beside 15 methods. The bar is 30 stored fields; this is 15 over it, 1.50× 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: VfsContext engine/packages/sqlite-embedded/src/vfs/transport.rs:701— TooManyFields — 33 stored fields beside 47 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: OperationIndex engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.rs:66— TooManyFields — 33 stored fields beside 5 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LogShardConfig engine/packages/depot-log/src/log_shard_machine/types.rs:321— TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: JsActorConfig rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:153— TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: MaintainerExecutor engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1530— 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.
pegboard::index::reconcile_active_envoy_page (cyclomatic 33) engine/packages/pegboard/src/index.rs:667— pegboard::index::reconcile_active_envoy_page has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pegboard::index::prepare_active_envoy_index (cyclomatic 28) engine/packages/pegboard/src/index.rs:851— pegboard::index::prepare_active_envoy_index 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.
pegboard::actor_machine::needs_allocation_at_version (cyclomatic 26) engine/packages/pegboard/src/actor_machine/mod.rs:2945— pegboard::actor_machine::needs_allocation_at_version 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::legacy_backfill::legacy_move_page (cyclomatic 24) engine/packages/pegboard/src/legacy_backfill.rs:249— pegboard::legacy_backfill::legacy_move_page 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.
pegboard::actor_machine::legacy_move_input (cyclomatic 23) engine/packages/pegboard/src/actor_machine/mod.rs:2517— pegboard::actor_machine::legacy_move_input 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::legacy_backfill::move_actor (cyclomatic 22) engine/packages/pegboard/src/legacy_backfill.rs:1489— pegboard::legacy_backfill::move_actor 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::actor_machine::try_complete_initialization (cyclomatic 18) engine/packages/pegboard/src/actor_machine/mod.rs:1384— pegboard::actor_machine::try_complete_initialization has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Event::name (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.
pegboard::legacy_namespace_rows::legacy_walk (cyclomatic 18) engine/packages/pegboard/src/legacy_namespace_rows.rs:233— pegboard::legacy_namespace_rows::legacy_walk 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::legacy_backfill::finish (cyclomatic 17) engine/packages/pegboard/src/legacy_backfill.rs:739— pegboard::legacy_backfill::finish 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.
pegboard::catalog::pool_handler (cyclomatic 16) engine/packages/pegboard/src/catalog.rs:1102— pegboard::catalog::pool_handler 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_fs_core::rollback::plan (cognitive 85) engine/packages/depot-fs-core/src/rollback.rs:243— depot_fs_core::rollback::plan has cognitive complexity 85 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 11 (17 pts), match/switch 9 (16 pts), boolean chains 6 (nesting depth added 42). 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.
depot_fs_core::rules::resolve_within (cognitive 31) engine/packages/depot-fs-core/src/rules.rs:651— depot_fs_core::rules::resolve_within has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, loops 2 (4 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.
depot_fs_core::overlay::merge (cognitive 26) engine/packages/depot-fs-core/src/overlay.rs:114— depot_fs_core::overlay::merge has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_fs_core::rules::rename_with (cognitive 26) engine/packages/depot-fs-core/src/rules.rs:268— depot_fs_core::rules::rename_with has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
depot_fs_core::apply::apply (cognitive 25) engine/packages/depot-fs-core/src/apply.rs:91— depot_fs_core::apply::apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 1 (2 pts), boolean chains 1, 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.
depot_fs_core::keys::slatedb::decode_key (cognitive 23) engine/packages/depot-fs-core/src/keys/slatedb.rs:907— depot_fs_core::keys::slatedb::decode_key has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 10. 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.
depot_fs_core::rules::setattr (cognitive 22) engine/packages/depot-fs-core/src/rules.rs:497— depot_fs_core::rules::setattr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 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.
depot_fs_core::rules::write (cognitive 20) engine/packages/depot-fs-core/src/rules.rs:417— depot_fs_core::rules::write has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_fs_core::keys::slatedb::decode_stamped_row (cognitive 19) engine/packages/depot-fs-core/src/keys/slatedb.rs:767— depot_fs_core::keys::slatedb::decode_stamped_row has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 10 (19 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.
depot_fs_core::keys::slatedb::encode_row (cognitive 16) engine/packages/depot-fs-core/src/keys/slatedb.rs:435— depot_fs_core::keys::slatedb::encode_row has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 10 (16 pts) (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×10
Edited copy of a member (9 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:176— engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:176-187 | engine/sdks/rust/data/src/versioned/pegboard_actor/mod.rs:304-314 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:115— rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:115-123 | rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:125-142 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:177— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:177-185 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:233-244 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) engine/packages/util/src/async_counter.rs:16— engine/packages/util/src/async_counter.rs:16-24 | engine/sdks/rust/envoy-client/src/async_counter.rs:25-33 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) engine/packages/pegboard/src/namespace_machine/mod.rs:720— engine/packages/pegboard/src/namespace_machine/mod.rs:720-728 | engine/packages/pegboard/src/namespace_machine/mod.rs:1062-1070 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rivetkit-rust/packages/client-protocol/src/versioned.rs:555— rivetkit-rust/packages/client-protocol/src/versioned.rs:555-639 | rivetkit-rust/packages/actor-persist/src/versioned.rs:423-431 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) engine/packages/cluster-config/src/cluster_config_machine/executor.rs:55— engine/packages/cluster-config/src/cluster_config_machine/executor.rs:55-63 | engine/packages/auth-jwt/src/key_ring_machine/executor.rs:31-39 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:1069— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:1069-1077 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1228-1236 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:996— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:996-1004 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1046-1054 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1105— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1105-1113 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:160-168 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×10
Edited copy of a member (17 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:897— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:897-914 | rivetkit-typescript/packages/rivetkit-napi/src/http.rs:222-238 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) engine/packages/pegboard-envoy/src/connection.rs:2488— engine/packages/pegboard-envoy/src/connection.rs:2488-2504 | engine/packages/pegboard-envoy/src/connection.rs:2507-2523 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:751— engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:751-772 | engine/packages/depot-volume/src/volume_client_machine/repair.rs:254-270 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:336— engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:336-352 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:454-471 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:357— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:357-374 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/cold_store.rs:378-394 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:903— rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:903-919 | rivetkit-rust/packages/rivetkit-core/src/actor/connection.rs:926-946 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) engine/packages/pegboard/src/catalog.rs:1360— engine/packages/pegboard/src/catalog.rs:1360-1376 | engine/packages/pegboard/src/index.rs:1913-1929 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:168— rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:168-188 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:341-357 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:35— rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:35-51 | rivetkit-swift/Sources/RivetKitClient/RivetKitClient.swift:59-75 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1030— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1030-1050 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1060-1076 — 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) · ×9
Edited copy of a member (15 corresponding lines) engine/packages/error-macros/src/lib.rs:507— engine/packages/error-macros/src/lib.rs:507-539 | engine/packages/error-macros/src/lib.rs:549-573 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) engine/sdks/rust/envoy-client/src/handle.rs:553— engine/sdks/rust/envoy-client/src/handle.rs:553-567 | engine/sdks/rust/envoy-client/src/handle.rs:574-589 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) engine/packages/engine/src/allocator.rs:29— engine/packages/engine/src/allocator.rs:29-43 | engine/packages/engine/src/allocator.rs:46-64 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:144— engine/packages/depot-volume/src/volume_client_machine/executor/recovery.rs:144-159 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:856-870 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:60— rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:60-74 | rivetkit-typescript/packages/rivetkit-napi/src/kv.rs:82-96 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:81— rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:81-96 | rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:210-224 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:484— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:484-498 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:797-811 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) engine/packages/pegboard-envoy/src/queue.rs:95— engine/packages/pegboard-envoy/src/queue.rs:95-109 | engine/packages/pegboard-gateway/src/namespace_fallback.rs:71-85 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) engine/sdks/rust/envoy-client/src/handle.rs:491— engine/sdks/rust/envoy-client/src/handle.rs:491-507 | engine/sdks/rust/envoy-client/src/handle.rs:515-529 — 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.
depot_fs_core::rollback::plan (cyclomatic 47) engine/packages/depot-fs-core/src/rollback.rs:243— depot_fs_core::rollback::plan has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
depot_fs_core::apply::apply (cyclomatic 28) engine/packages/depot-fs-core/src/apply.rs:91— depot_fs_core::apply::apply 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.
depot_fs_core::keys::slatedb::encode_row (cyclomatic 27) engine/packages/depot-fs-core/src/keys/slatedb.rs:435— depot_fs_core::keys::slatedb::encode_row 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.
depot_fs_core::keys::slatedb::decode_key (cyclomatic 23) engine/packages/depot-fs-core/src/keys/slatedb.rs:907— depot_fs_core::keys::slatedb::decode_key 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.
depot_fs_core::rules::rename_with (cyclomatic 23) engine/packages/depot-fs-core/src/rules.rs:268— depot_fs_core::rules::rename_with 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.
depot_fs_core::rules::resolve_within (cyclomatic 20) engine/packages/depot-fs-core/src/rules.rs:651— depot_fs_core::rules::resolve_within 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.
depot_fs_core::keys::slatedb::decode_stamped_row (cyclomatic 18) engine/packages/depot-fs-core/src/keys/slatedb.rs:767— depot_fs_core::keys::slatedb::decode_stamped_row 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.
depot_fs_core::overlay::merge (cyclomatic 16) engine/packages/depot-fs-core/src/overlay.rs:114— depot_fs_core::overlay::merge 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_volume::volume_client_machine::requests::admit (cyclomatic 32) engine/packages/depot-volume/src/volume_client_machine/requests.rs:18— depot_volume::volume_client_machine::requests::admit 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_volume::volume_client_machine::recovery::read (cyclomatic 24) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:496— depot_volume::volume_client_machine::recovery::read 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.
depot_volume::volume_client_machine::recovery::begin_recovery (cyclomatic 23) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:23— depot_volume::volume_client_machine::recovery::begin_recovery 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.
depot_volume::volume_client_machine::lifecycle::opened (cyclomatic 20) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:112— depot_volume::volume_client_machine::lifecycle::opened has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot_volume::volume_client_machine::pipeline::answered (cyclomatic 20) engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:161— depot_volume::volume_client_machine::pipeline::answered has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
depot_volume::volume_client_machine::lifecycle::claimed (cyclomatic 19) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:269— depot_volume::volume_client_machine::lifecycle::claimed 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.
depot_volume::volume_client_machine::membership::adopt (cyclomatic 17) engine/packages/depot-volume/src/volume_client_machine/membership.rs:139— depot_volume::volume_client_machine::membership::adopt 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_volume::volume_client_machine::recovery::copy (cyclomatic 17) engine/packages/depot-volume/src/volume_client_machine/recovery.rs:897— depot_volume::volume_client_machine::recovery::copy 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_log::log_shard_machine::state::loaded_volume_replica::admit_mutation (cognitive 109) engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs:1487— depot_log::log_shard_machine::state::loaded_volume_replica::admit_mutation has cognitive complexity 109 (threshold 15). Drivers by points: if/else 44 (61 pts), match/switch 17 (28 pts), boolean chains 20 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_log::log_shard_machine::state::status_notices::dispatch (cognitive 37) engine/packages/depot-log/src/log_shard_machine/state/status_notices.rs:416— depot_log::log_shard_machine::state::status_notices::dispatch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_log::log_shard_machine::state::reads::synced_page (cognitive 29) engine/packages/depot-log/src/log_shard_machine/state/reads.rs:281— depot_log::log_shard_machine::state::reads::synced_page has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 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_log::log_shard_machine::state::memory_batches::release_replies (cognitive 24) engine/packages/depot-log/src/log_shard_machine/state/memory_batches.rs:786— depot_log::log_shard_machine::state::memory_batches::release_replies has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (7 pts), loops 2 (4 pts) (nesting depth added 16). 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.
depot_log::log_shard_machine::state::memory_batches::dispatch (cognitive 19) engine/packages/depot-log/src/log_shard_machine/state/memory_batches.rs:677— depot_log::log_shard_machine::state::memory_batches::dispatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_log::log_shard_machine::state::memory_batches::written_to_disk (cognitive 19) engine/packages/depot-log/src/log_shard_machine/state/memory_batches.rs:1104— depot_log::log_shard_machine::state::memory_batches::written_to_disk has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (14 pts), loops 1 (4 pts), if/else 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
depot_log::log_shard_machine::runner::run_io (cognitive 18) engine/packages/depot-log/src/log_shard_machine/runner.rs:610— depot_log::log_shard_machine::runner::run_io has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 2 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
depot_log::log_shard_machine::state::loaded_volume_replica::admit (cognitive 17) engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs:1118— depot_log::log_shard_machine::state::loaded_volume_replica::admit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 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.
Filesystem::admit (cognitive 51) engine/packages/depot-client/src/filesystem/admission.rs:11— Filesystem::admit has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 10, match/switch 7 (10 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.
Filesystem::prepare_group (cognitive 43) engine/packages/depot-client/src/filesystem/transaction.rs:422— Filesystem::prepare_group has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 5 (8 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filesystem::expire_notes (cognitive 38) engine/packages/depot-client/src/filesystem/client.rs:1128— Filesystem::expire_notes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 4, match/switch 2 (3 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filesystem::refresh_inner (cognitive 37) engine/packages/depot-client/src/filesystem/client.rs:1542— Filesystem::refresh_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 6 (13 pts), boolean chains 8 (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.
Filesystem::reclaim_closed (cognitive 33) engine/packages/depot-client/src/filesystem/client.rs:2362— Filesystem::reclaim_closed has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filesystem::replay (cognitive 19) engine/packages/depot-client/src/filesystem/replay.rs:24— Filesystem::replay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filesystem::read_open_view (cognitive 17) engine/packages/depot-client/src/filesystem/client.rs:733— Filesystem::read_open_view has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Filesystem::await_commit (cognitive 16) engine/packages/depot-client/src/filesystem/recovery.rs:185— Filesystem::await_commit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (14 lines × 2) engine/packages/depot-client/src/filesystem/txn.rs:328— engine/packages/depot-client/src/filesystem/txn.rs:328-341 | engine/packages/depot-client/src/filesystem/txn.rs:353-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-client/src/filesystem/txn.rs:328` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:308— engine/packages/pegboard/src/actor_machine/mod.rs:308-321 | engine/packages/pegboard/src/actor_machine/mod.rs:849-862 — both copies are in the same file, so extract the block into 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/sqlite-embedded/src/query.rs:283— engine/packages/sqlite-embedded/src/query.rs:283-296 | engine/packages/sqlite-embedded/src/query.rs:357-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/query.rs:283` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) engine/packages/sqlite-embedded/src/query.rs:440— engine/packages/sqlite-embedded/src/query.rs:440-453 | engine/packages/sqlite-embedded/src/query.rs:523-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/query.rs:440` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) engine/sdks/rust/envoy-client/src/actor.rs:989— engine/sdks/rust/envoy-client/src/actor.rs:989-1002 | engine/sdks/rust/envoy-client/src/actor.rs:1227-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/sdks/rust/envoy-client/src/actor.rs:1242` calls `id_to_str` and `engine/sdks/rust/envoy-client/src/actor.rs:1003` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) engine/sdks/rust/envoy-client/src/handle.rs:914— engine/sdks/rust/envoy-client/src/handle.rs:914-927 | engine/sdks/rust/envoy-client/src/handle.rs:954-967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/handle.rs:914` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:567— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:567-580 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:649-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:567` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) engine/packages/depot-volume/src/ups/client.rs:262— engine/packages/depot-volume/src/ups/client.rs:262-275 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:435-448 — before extracting anything, compare `engine/packages/depot-volume/src/ups/client.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-volume/src/ups/client.rs:262` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) engine/packages/depot-fs-core/src/keys/slatedb.rs:1106— engine/packages/depot-fs-core/src/keys/slatedb.rs:1106-1118 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1228-1240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-fs-core/src/keys/slatedb.rs:1106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:145— engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:145-157 | engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:221-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:145` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:94— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:94-106 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair_claims.rs:153-165 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:94` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) engine/sdks/rust/envoy-client/src/metrics.rs:219— engine/sdks/rust/envoy-client/src/metrics.rs:219-231 | engine/sdks/rust/envoy-client/src/metrics.rs:249-261 — both copies are in the same file, so extract the block into 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-typescript/packages/rivetkit-napi/src/actor_factory.rs:1056— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1056-1068 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3275-3287 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1056` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/async/client.rs:27` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/sync/client.rs:24` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:226— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:226-238 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:348-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:226` 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.
Outbound HTTP without resilience engine/packages/cli/src/auth.rs:141— `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/cli/src/auth.rs:223— `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/cli/src/auth.rs:239— `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/cli/src/cloud.rs:159— `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/env/src/backends/production/external_http.rs:40— `reqwest::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 engine/packages/env/src/backends/production/http.rs:124— `reqwest::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 engine/packages/env/src/backends/production/http.rs:161— `reqwest::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:157— `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.
rivet_envoy_client::envoy::envoy_loop (cyclomatic 49) engine/sdks/rust/envoy-client/src/envoy.rs:568— rivet_envoy_client::envoy::envoy_loop 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.
rivet_envoy_client::actor::actor_inner (cyclomatic 38) engine/sdks/rust/envoy-client/src/actor.rs:284— rivet_envoy_client::actor::actor_inner 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.
rivet_envoy_client::connection::native::serve_connection (cyclomatic 34) engine/sdks/rust/envoy-client/src/connection/native.rs:215— rivet_envoy_client::connection::native::serve_connection has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rivet_envoy_client::actor::http::send_response (cyclomatic 23) engine/sdks/rust/envoy-client/src/actor/http.rs:656— 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 23) engine/sdks/rust/envoy-client/src/connection/wasm.rs:92— rivet_envoy_client::connection::wasm::imp::single_connection 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::tunnel::handle_tunnel_message (cyclomatic 22) engine/sdks/rust/envoy-client/src/tunnel.rs:153— rivet_envoy_client::tunnel::handle_tunnel_message 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::envoy::handle_conn_message (cyclomatic 21) engine/sdks/rust/envoy-client/src/envoy.rs:869— rivet_envoy_client::envoy::handle_conn_message 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_envoy::connection::handle_sub_stream (cognitive 62) engine/packages/pegboard-envoy/src/connection.rs:782— pegboard_envoy::connection::handle_sub_stream has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (32 pts), match/switch 8 (20 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_envoy::lifecycle::deliver_within (cognitive 46) engine/packages/pegboard-envoy/src/lifecycle.rs:278— pegboard_envoy::lifecycle::deliver_within has cognitive complexity 46 (threshold 15). Drivers by points: match/switch 14 (42 pts), if/else 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 29). 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::kv::execute (cognitive 31) engine/packages/pegboard-envoy/src/kv.rs:130— pegboard_envoy::kv::execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (9 pts), match/switch 3 (7 pts) (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_envoy::connection::run (cognitive 30) engine/packages/pegboard-envoy/src/connection.rs:125— pegboard_envoy::connection::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 5 (9 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.
pegboard_envoy::connection::handle_ws_msg (cognitive 28) engine/packages/pegboard-envoy/src/connection.rs:1401— pegboard_envoy::connection::handle_ws_msg has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (7 pts), loops 1 (2 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pegboard_envoy::connection::read_socket (cognitive 26) engine/packages/pegboard-envoy/src/connection.rs:1263— pegboard_envoy::connection::read_socket has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (9 pts), loops 2 (5 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.
pegboard_envoy::routes::connect (cognitive 17) engine/packages/pegboard-envoy/src/routes.rs:287— pegboard_envoy::routes::connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 6 (7 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RegistryDispatcher::handle_actor_connect_websocket (cognitive 46) rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:99— 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:102— 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::stop_actor (cognitive 19) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:1198— RegistryDispatcher::stop_actor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (4 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.
RegistryDispatcher::active_actor (cognitive 18) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:1142— 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.
RegistryDispatcher::handle_raw_websocket (cognitive 17) rivetkit-rust/packages/rivetkit-core/src/registry/websocket.rs:512— RegistryDispatcher::handle_raw_websocket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RegistryDispatcher::start_actor (cognitive 16) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:883— RegistryDispatcher::start_actor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×7
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×7
Edited copy of a member (18 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:57— engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:57-80 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair_claims.rs:69-86 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:191— rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:191-208 | rivetkit-rust/packages/rivetkit-core/src/actor/messages.rs:294-312 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) engine/packages/depot-volume/src/ups/client.rs:86— engine/packages/depot-volume/src/ups/client.rs:86-103 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:263-280 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:123— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:123-140 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:147-164 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1179— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1179-1196 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:278-295 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1714— engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1714-1731 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:692-713 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) engine/sdks/rust/envoy-client/src/handle.rs:281— engine/sdks/rust/envoy-client/src/handle.rs:281-298 | engine/sdks/rust/envoy-client/src/handle.rs:315-335 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
State::request_stop (cognitive 100) engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:44— State::request_stop has cognitive complexity 100 (threshold 15). Drivers by points: if/else 37 (72 pts), boolean chains 10, loops 4 (10 pts), match/switch 2 (8 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.
State::write_batch (cognitive 35) engine/packages/depot-worker/src/tablet_coordinator_machine/state.rs:454— State::write_batch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 9, 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.
State::read_response (cognitive 27) engine/packages/depot-worker/src/tablet_coordinator_machine/state.rs:201— State::read_response has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 3, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::prepare_grant_write (cognitive 24) engine/packages/depot-worker/src/tablet_coordinator_machine/state/handoff.rs:49— State::prepare_grant_write has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::handoff_readiness (cognitive 24) engine/packages/depot-worker/src/tablet_coordinator_machine/state/handoff.rs:226— State::handoff_readiness has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 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.
State::balance (cognitive 22) engine/packages/depot-worker/src/tablet_coordinator_machine/state/balancing.rs:601— State::balance has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OverflowMap::apply (cognitive 70) engine/packages/sqlite-prefetch/src/overflow/mod.rs:570— OverflowMap::apply has cognitive complexity 70 (threshold 15). Drivers by points: if/else 14 (45 pts), match/switch 6 (14 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 44). 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.
OverflowMap::plan_commit (cognitive 62) engine/packages/sqlite-prefetch/src/overflow/commit.rs:240— OverflowMap::plan_commit has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (38 pts), loops 9 (12 pts), boolean chains 9, match/switch 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OverflowMap::plan_purge (cognitive 27) engine/packages/sqlite-prefetch/src/overflow/commit.rs:464— OverflowMap::plan_purge has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OverflowMap::advance_walks (cognitive 18) engine/packages/sqlite-prefetch/src/overflow/mod.rs:528— OverflowMap::advance_walks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OverflowMap::committed (cognitive 17) engine/packages/sqlite-prefetch/src/overflow/commit.rs:663— OverflowMap::committed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 6, boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OverflowMap::follow_free_list (cognitive 16) engine/packages/sqlite-prefetch/src/overflow/commit.rs:563— OverflowMap::follow_free_list has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (6 pts), boolean chains 1, loops 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.
ReadSession::chunk_versions (cognitive 63) engine/packages/depot-worker/src/filesystem/session.rs:1289— ReadSession::chunk_versions has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (49 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadSession::scan_within (cognitive 43) engine/packages/depot-worker/src/filesystem/session.rs:1158— ReadSession::scan_within has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 5, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadSession::hidden_by_own_whiteouts (cognitive 25) engine/packages/depot-worker/src/filesystem/session.rs:710— ReadSession::hidden_by_own_whiteouts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (7 pts), match/switch 1 (5 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.
ReadSession::scan_overlay (cognitive 23) engine/packages/depot-worker/src/filesystem/session.rs:936— ReadSession::scan_overlay has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (7 pts), match/switch 4 (7 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.
ReadSession::resolve_chunks (cognitive 20) engine/packages/depot-worker/src/filesystem/base.rs:70— ReadSession::resolve_chunks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 pts), loops 3 (4 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.
ReadSession::versions (cognitive 18) engine/packages/depot-worker/src/filesystem/session.rs:484— ReadSession::versions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 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.
rivet_topology::topology_machine::lease::handle_list_storage_workers_response (cognitive 31) engine/packages/topology/src/topology_machine/lease.rs:720— rivet_topology::topology_machine::lease::handle_list_storage_workers_response has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 6 (9 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_topology::topology_machine::lease::handle_response (cognitive 29) engine/packages/topology/src/topology_machine/lease.rs:468— rivet_topology::topology_machine::lease::handle_response has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 6 (7 pts), boolean chains 6 (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.
rivet_topology::topology_machine::lease::timer (cognitive 22) engine/packages/topology/src/topology_machine/lease.rs:1279— rivet_topology::topology_machine::lease::timer has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 3 (10 pts), boolean chains 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rivet_topology::discovery::list_storage (cognitive 19) engine/packages/topology/src/discovery.rs:46— rivet_topology::discovery::list_storage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_topology::topology_machine::lookup::handle_lookup_endpoint_response (cognitive 19) engine/packages/topology/src/topology_machine/lookup.rs:118— rivet_topology::topology_machine::lookup::handle_lookup_endpoint_response has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_topology::topology_machine::lease::handle_initial_heartbeat_read (cognitive 16) engine/packages/topology/src/topology_machine/lease.rs:1061— rivet_topology::topology_machine::lease::handle_initial_heartbeat_read has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_v2_migrator::migrator_machine::on_written (cognitive 29) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:538— pegboard_v2_migrator::migrator_machine::on_written has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts), match/switch 3 (5 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pegboard_v2_migrator::migrator_machine::on_page (cognitive 22) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:808— pegboard_v2_migrator::migrator_machine::on_page has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_v2_migrator::migrator_machine::executor::run (cognitive 19) engine/packages/pegboard-v2-migrator/src/migrator_machine/executor.rs:145— pegboard_v2_migrator::migrator_machine::executor::run has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 10 (19 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.
pegboard_v2_migrator::import::stream_once (cognitive 17) engine/packages/pegboard-v2-migrator/src/import.rs:200— pegboard_v2_migrator::import::stream_once has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_v2_migrator::migrator_machine::persist (cognitive 17) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:1644— pegboard_v2_migrator::migrator_machine::persist has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_v2_migrator::services::migrator::start (cognitive 17) engine/packages/pegboard-v2-migrator/src/services/migrator.rs:107— pegboard_v2_migrator::services::migrator::start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (21 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/cold.rs:315— engine/packages/depot-worker/src/tablet_maintainer_machine/state/cold.rs:315-335 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:1460-1480 — 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 (21 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:727— engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:727-747 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1332-1352 — 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 (21 lines × 2) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:65— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:65-85 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:374-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/inspector-protocol/src/versioned.rs:65` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) rivetkit-rust/packages/shared-types/src/actor_key/mod.rs:37— rivetkit-rust/packages/shared-types/src/actor_key/mod.rs:37-57 | rivetkit-rust/packages/shared-types/src/actor_key/slash.rs:21-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/shared-types/src/actor_key/slash.rs:21` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-rust/packages/shared-types/src/actor_key/slash.rs:17` calls `is_empty`, `to_owned` and `rivetkit-rust/packages/shared-types/src/actor_key/mod.rs:36` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) engine/packages/sqlite-embedded/src/query.rs:248— engine/packages/sqlite-embedded/src/query.rs:248-268 | engine/packages/sqlite-embedded/src/query.rs:317-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/query.rs:248` 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 (21 lines × 2) engine/packages/depot-client/src/volumes/slot.rs:165— engine/packages/depot-client/src/volumes/slot.rs:165-185 | engine/packages/depot-client/src/volumes/slot.rs:261-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-client/src/volumes/slot.rs:165` 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.
pegboard_envoy::connection::handle_sub_stream (cyclomatic 31) engine/packages/pegboard-envoy/src/connection.rs:782— pegboard_envoy::connection::handle_sub_stream has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pegboard_envoy::lifecycle::deliver_within (cyclomatic 30) engine/packages/pegboard-envoy/src/lifecycle.rs:278— pegboard_envoy::lifecycle::deliver_within has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pegboard_envoy::connection::run (cyclomatic 20) engine/packages/pegboard-envoy/src/connection.rs:125— pegboard_envoy::connection::run 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_envoy::connection::handle_ws_msg (cyclomatic 20) engine/packages/pegboard-envoy/src/connection.rs:1401— pegboard_envoy::connection::handle_ws_msg 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_envoy::kv::execute (cyclomatic 20) engine/packages/pegboard-envoy/src/kv.rs:130— pegboard_envoy::kv::execute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) engine/packages/depot-volume/src/volume_client_machine/runner.rs:458— engine/packages/depot-volume/src/volume_client_machine/runner.rs:458-472 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:606-625 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:630-646 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:650-669 — 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/sqlite-embedded/src/pager_cache.rs:575— engine/packages/sqlite-embedded/src/pager_cache.rs:575-599 | engine/packages/sqlite-embedded/src/pager_cache.rs:606-636 | engine/packages/sqlite-embedded/src/pager_cache.rs:638-664 | engine/packages/sqlite-embedded/src/pager_cache.rs:688-713 — 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/sqlite-embedded/src/query.rs:247— engine/packages/sqlite-embedded/src/query.rs:247-308 | engine/packages/sqlite-embedded/src/query.rs:316-391 | engine/packages/sqlite-embedded/src/query.rs:399-470 | engine/packages/sqlite-embedded/src/query.rs:477-560 — 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/sdks/rust/envoy-client/src/tunnel.rs:365— engine/sdks/rust/envoy-client/src/tunnel.rs:365-389 | engine/sdks/rust/envoy-client/src/tunnel.rs:395-416 | engine/sdks/rust/envoy-client/src/tunnel.rs:622-670 | engine/sdks/rust/envoy-client/src/tunnel.rs:677-714 — 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:645— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:645-660 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:662-678 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:680-697 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:699-717 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×5
Edited copy of a member (34 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:589— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:589-622 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:666-709 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) engine/packages/pegboard/src/index.rs:1231— engine/packages/pegboard/src/index.rs:1231-1264 | engine/packages/pegboard/src/index.rs:1273-1308 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:77— rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:77-111 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3344-3377 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:492— rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:492-525 | rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:534-568 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) engine/packages/topology/src/topology_machine/lease.rs:969— engine/packages/topology/src/topology_machine/lease.rs:969-1005 | engine/packages/topology/src/topology_machine/lease.rs:1013-1046 — 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 (19 corresponding lines) · ×5
Edited copy of a member (19 corresponding lines) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:230— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:230-264 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1246-1264 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) engine/packages/pegboard-envoy/src/sqlite/routing.rs:10— engine/packages/pegboard-envoy/src/sqlite/routing.rs:10-28 | engine/packages/pegboard-envoy/src/sqlite/routing.rs:31-49 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:637— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:637-655 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:657-675 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) engine/packages/cli/src/cloud.rs:523— engine/packages/cli/src/cloud.rs:523-549 | engine/packages/cli/src/target.rs:243-261 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:37— engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v1_to_pegboard_v2_migrator_v2.rs:37-55 | engine/sdks/rust/data/src/versioned/pegboard_v2_migrator/pegboard_v2_migrator_v2_to_pegboard_v2_migrator_v1.rs:47-65 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×5
Edited copy of a member (23 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1348— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1348-1370 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3609-3638 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/requests.rs:519— engine/packages/depot-volume/src/volume_client_machine/requests.rs:519-541 | engine/packages/depot-volume/src/volume_client_machine/requests.rs:544-575 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) rivetkit-rust/packages/actor-persist/src/versioned.rs:457— rivetkit-rust/packages/actor-persist/src/versioned.rs:457-479 | rivetkit-rust/packages/actor-persist/src/versioned.rs:481-503 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) engine/packages/universalpubsub/src/pubsub/stream/packet.rs:88— engine/packages/universalpubsub/src/pubsub/stream/packet.rs:88-113 | engine/packages/universalpubsub/src/pubsub/stream/packet.rs:131-153 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:247— rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:247-272 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:274-296 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 2) engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:80— engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:80-97 | engine/packages/depot-volume/src/volume_client_machine/recovery.rs:957-974 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:2148— engine/packages/sqlite-embedded/src/vfs/transport.rs:2148-2165 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2301-2318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/vfs/transport.rs:2148` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) rivetkit-rust/packages/client/src/handle.rs:99— rivetkit-rust/packages/client/src/handle.rs:99-116 | rivetkit-rust/packages/client/src/handle.rs:165-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/client/src/handle.rs:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:288— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:288-305 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:427-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:288` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1167— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1167-1184 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:1269-1286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) engine/packages/pegboard/src/catalog.rs:1025— engine/packages/pegboard/src/catalog.rs:1025-1041 | engine/packages/pegboard/src/catalog.rs:1244-1260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/catalog.rs:1025` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `wire::NamespaceReadRequest` in one and `wire::PoolListRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) engine/packages/sqlite-embedded/src/query.rs:653— engine/packages/sqlite-embedded/src/query.rs:653-669 | engine/packages/sqlite-embedded/src/query.rs:701-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/query.rs:653` 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 (17 lines × 2) engine/packages/util/src/throttle.rs:151— engine/packages/util/src/throttle.rs:151-167 | engine/packages/util/src/throttle.rs:207-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/util/src/throttle.rs:151` 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 (17 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1888— rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1888-1904 | rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1940-1956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1888` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) rivetkit-rust/packages/rivetkit/src/start.rs:134— rivetkit-rust/packages/rivetkit/src/start.rs:134-150 | rivetkit-rust/packages/rivetkit/src/start.rs:167-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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit/src/start.rs:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) engine/packages/depot-volume/src/ups/client.rs:238— engine/packages/depot-volume/src/ups/client.rs:238-252 | engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs:411-425 — before extracting anything, compare `engine/packages/depot-volume/src/ups/client.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/executor/repair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2948— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2948-2962 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:3005-3019 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:2948` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/version_marks.rs:143— engine/packages/depot-worker/src/tablet_maintainer_machine/state/version_marks.rs:143-157 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/version_marks.rs:179-193 — both copies are in the same file, so extract the block into 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) rivetkit-rust/packages/client/src/remote_manager.rs:349— rivetkit-rust/packages/client/src/remote_manager.rs:349-363 | rivetkit-rust/packages/client/src/remote_manager.rs:414-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/client/src/remote_manager.rs:349` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1182— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1182-1196 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:281-295 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1182` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `JsSqliteProfilingConfig` in one and `WasmSqliteProfilingConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12–13 lines × 2) engine/packages/depot-client/src/filesystem/client.rs:1782— engine/packages/depot-client/src/filesystem/client.rs:1782-1793 | engine/packages/depot-client/src/filesystem/client.rs:1940-1952 — both copies are in the same file, so extract the block into 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/error-macros/src/lib.rs:550` calls `value` and `engine/packages/error-macros/src/lib.rs:515` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) engine/packages/sqlite-prefetch/src/driver.rs:112— engine/packages/sqlite-prefetch/src/driver.rs:112-124 | engine/packages/sqlite-prefetch/src/driver.rs:147-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-prefetch/src/driver.rs:112` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–13 lines × 2) engine/packages/topology/src/topology.rs:199— engine/packages/topology/src/topology.rs:199-210 | engine/packages/topology/src/topology.rs:475-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 (12–13 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:389— rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:389-401 | rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:435-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:389` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2441— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2441-2446 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2481-2486 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2513-2518 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2512` calls `repair_read_op` and `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2440` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) engine/packages/pegboard-envoy/src/sqlite/routing.rs:20— engine/packages/pegboard-envoy/src/sqlite/routing.rs:20-25 | engine/packages/pegboard-envoy/src/sqlite/routing.rs:41-46 | engine/packages/pegboard-envoy/src/sqlite/routing.rs:311-316 — 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/api-public/src/actors/list.rs:45— engine/packages/api-public/src/actors/list.rs:45-50 | engine/packages/api-public/src/namespaces.rs:25-30 | engine/packages/api-public/src/runners.rs:27-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/api-public/src/actors/list.rs:54` calls `Name`, `clone` and `engine/packages/api-public/src/namespaces.rs:34` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) engine/packages/api-public/src/actors/create.rs:45— engine/packages/api-public/src/actors/create.rs:45-50 | engine/packages/api-public/src/actors/get_or_create.rs:53-58 | engine/packages/api-public/src/runner_pools/serverless_health_check.rs:63-68 — before extracting anything, compare `engine/packages/api-public/src/actors/create.rs` and `engine/packages/api-public/src/actors/get_or_create.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/actors/create.rs:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) 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.
X12 · Unreachable branch· Statement is unreachable · ×5
Statement is unreachable — control never gets past the statement before it rivetkit-rust/packages/client/src/connection.rs:402— `if opts.ephemeral == false { self.msg_queue.lock().await.push(msg.clone()); }` follows `'send_immediately : { let Some(driver) = guard.deref() else { break 'send_imm…` (line 389) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
Statement is unreachable — control never gets past the statement before it engine/packages/pegboard-envoy/src/connection.rs:1811— `# [ allow(unreachable_code) ] anyhow::Ok(())` follows `loop { interval.tick().await ?; ping.send_replace(clock.observe() ?.unix_ms); }` (line 1807) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
Statement is unreachable — control never gets past the statement before it engine/packages/pegboard-envoy/src/connection.rs:1820— `# [ allow(unreachable_code) ] anyhow::Ok(())` follows `loop { interval.tick().await ?; renew().await ?; }` (line 1816) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
Statement is unreachable — control never gets past the statement before it engine/packages/pegboard-envoy/src/connection.rs:1829— `# [ allow(unreachable_code) ] anyhow::Ok(())` follows `loop { interval.tick().await ?; refresh().await ?; }` (line 1825) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
Statement is unreachable — control never gets past the statement before it engine/packages/depot-worker/src/tablet_maintainer_machine/state/promotion.rs:93— `if state.operations.index().promotion_lists.contains_key(& worker) { continue; }` follows `{ continue; }` (line 90) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
depot_log::log_shard_machine::state::loaded_volume_replica::admit_mutation (cyclomatic 90) engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs:1487— depot_log::log_shard_machine::state::loaded_volume_replica::admit_mutation has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent 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_log::log_shard_machine::state::loaded_volume_replica::admit (cyclomatic 20) engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs:1118— depot_log::log_shard_machine::state::loaded_volume_replica::admit has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depot_log::log_shard_machine::runner::run_io (cyclomatic 17) engine/packages/depot-log/src/log_shard_machine/runner.rs:610— depot_log::log_shard_machine::runner::run_io 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.
depot_log::log_shard_machine::state::status_notices::dispatch (cyclomatic 16) engine/packages/depot-log/src/log_shard_machine/state/status_notices.rs:416— depot_log::log_shard_machine::state::status_notices::dispatch 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.
State::request_stop (cyclomatic 52) engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:44— State::request_stop has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
State::write_batch (cyclomatic 25) engine/packages/depot-worker/src/tablet_coordinator_machine/state.rs:454— State::write_batch 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.
State::read_response (cyclomatic 21) engine/packages/depot-worker/src/tablet_coordinator_machine/state.rs:201— State::read_response 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.
State::balance (cyclomatic 19) engine/packages/depot-worker/src/tablet_coordinator_machine/state/balancing.rs:601— State::balance 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.
Filesystem::admit (cyclomatic 45) engine/packages/depot-client/src/filesystem/admission.rs:11— Filesystem::admit has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Filesystem::refresh_inner (cyclomatic 27) engine/packages/depot-client/src/filesystem/client.rs:1542— Filesystem::refresh_inner has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Filesystem::expire_notes (cyclomatic 25) engine/packages/depot-client/src/filesystem/client.rs:1128— Filesystem::expire_notes 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.
Filesystem::prepare_group (cyclomatic 23) engine/packages/depot-client/src/filesystem/transaction.rs:422— Filesystem::prepare_group 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_topology::topology_machine::lease::handle_response (cyclomatic 29) engine/packages/topology/src/topology_machine/lease.rs:468— rivet_topology::topology_machine::lease::handle_response has cyclomatic complexity 29 (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.
rivet_topology::topology_machine::lease::handle_list_storage_workers_response (cyclomatic 26) engine/packages/topology/src/topology_machine/lease.rs:720— rivet_topology::topology_machine::lease::handle_list_storage_workers_response 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.
rivet_topology::topology_machine::lease::timer (cyclomatic 20) engine/packages/topology/src/topology_machine/lease.rs:1279— rivet_topology::topology_machine::lease::timer has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
rivet_topology::discovery::list_storage (cyclomatic 16) engine/packages/topology/src/discovery.rs:46— rivet_topology::discovery::list_storage 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_gateway::routes::prepare (cyclomatic 24) engine/packages/pegboard-gateway/src/routes.rs:467— pegboard_gateway::routes::prepare has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pegboard_gateway::routes::gateway (cyclomatic 21) engine/packages/pegboard-gateway/src/routes.rs:139— pegboard_gateway::routes::gateway 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_gateway::migrate_from_v2::proxy::pump (cyclomatic 16) engine/packages/pegboard-gateway/src/migrate_from_v2/proxy.rs:225— pegboard_gateway::migrate_from_v2::proxy::pump 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.
pegboard_gateway::websocket_tunnel::proxy (cyclomatic 16) engine/packages/pegboard-gateway/src/websocket_tunnel.rs:149— pegboard_gateway::websocket_tunnel::proxy 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.
pegboard_gateway::routes::gateway (cognitive 39) engine/packages/pegboard-gateway/src/routes.rs:139— pegboard_gateway::routes::gateway has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 8 (15 pts), loops 1 (2 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.
pegboard_gateway::routes::prepare (cognitive 30) engine/packages/pegboard-gateway/src/routes.rs:467— pegboard_gateway::routes::prepare has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 8 (13 pts), if/else 6 (9 pts), boolean chains 6, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pegboard_gateway::websocket_tunnel::proxy (cognitive 23) engine/packages/pegboard-gateway/src/websocket_tunnel.rs:149— pegboard_gateway::websocket_tunnel::proxy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 4 (9 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.
pegboard_gateway::routes::forwarded_headers (cognitive 17) engine/packages/pegboard-gateway/src/routes.rs:928— pegboard_gateway::routes::forwarded_headers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 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.
ActorContext::teardown_sleep_state (cognitive 38) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:690— 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::apply_state_deltas_inner (cognitive 23) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:787— ActorContext::apply_state_deltas_inner has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ActorContext::prepare_state_deltas (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1407— 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:580— 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.
sqlite_embedded::worker::run_command_inner (cognitive 34) engine/packages/sqlite-embedded/src/worker.rs:1646— sqlite_embedded::worker::run_command_inner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
sqlite_embedded::query::exec_statements (cognitive 23) engine/packages/sqlite-embedded/src/query.rs:395— sqlite_embedded::query::exec_statements has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sqlite_embedded::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.
sqlite_embedded::query::exec_statements_profiled (cognitive 23) engine/packages/sqlite-embedded/src/query.rs:473— sqlite_embedded::query::exec_statements_profiled has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sqlite_embedded::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.
sqlite_embedded::pager_cache::x_fetch (cognitive 17) engine/packages/sqlite-embedded/src/pager_cache.rs:477— sqlite_embedded::pager_cache::x_fetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner (cognitive 29) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:176— rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_core::actor::internal_storage::clear_table_bounded (cognitive 21) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1263— 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::registry::actor_connect::encode_actor_connect_message_cbor_manual (cognitive 19) rivetkit-rust/packages/rivetkit-core/src/registry/actor_connect.rs:297— 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.
rivetkit_core::actor::sqlite::tx::insert_terminal_state (cognitive 18) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:1606— rivetkit_core::actor::sqlite::tx::insert_terminal_state has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqlite_prefetch::driver::read (cognitive 27) engine/packages/sqlite-prefetch/src/driver.rs:58— sqlite_prefetch::driver::read has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 4 (8 pts), loops 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.
sqlite_prefetch::overflow::chain::decode_row (cognitive 19) engine/packages/sqlite-prefetch/src/overflow/chain.rs:181— sqlite_prefetch::overflow::chain::decode_row has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqlite_prefetch::harness::oracle::check (cognitive 17) engine/packages/sqlite-prefetch/src/harness/oracle.rs:85— sqlite_prefetch::harness::oracle::check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 4 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqlite_prefetch::harness::trace::parse_selected (cognitive 17) engine/packages/sqlite-prefetch/src/harness/trace.rs:72— sqlite_prefetch::harness::trace::parse_selected has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×4
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×4
Edited copy of a member (39 corresponding lines) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:458— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:458-498 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:776-814 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) rivetkit-rust/packages/client/src/handle.rs:88— rivetkit-rust/packages/client/src/handle.rs:88-126 | rivetkit-rust/packages/client/src/handle.rs:154-192 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) engine/packages/pegboard/src/namespace_machine/executor.rs:246— engine/packages/pegboard/src/namespace_machine/executor.rs:246-307 | engine/packages/pegboard/src/namespace_machine/executor.rs:316-354 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2457— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2457-2495 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:2596-2636 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×4
Edited copy of a member (29 corresponding lines) engine/packages/depot-worker/src/stop_requests.rs:149— engine/packages/depot-worker/src/stop_requests.rs:149-177 | engine/packages/depot-worker/src/stop_requests.rs:218-256 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) engine/packages/pegboard/src/index.rs:1585— engine/packages/pegboard/src/index.rs:1585-1616 | engine/packages/pegboard/src/index.rs:1624-1652 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) rivetkit-rust/packages/rivetkit/src/start.rs:122— rivetkit-rust/packages/rivetkit/src/start.rs:122-150 | rivetkit-rust/packages/rivetkit/src/start.rs:152-183 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1876— rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1876-1904 | rivetkit-rust/packages/rivetkit-core/src/actor/context.rs:1928-1956 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:618— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:618-639 | rivetkit-rust/packages/shared-types/src/endpoint.rs:120-141 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) engine/packages/engine/src/depot_peer.rs:158— engine/packages/engine/src/depot_peer.rs:158-179 | engine/packages/engine/src/depot_peer.rs:188-209 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) rivetkit-rust/packages/shared-types/src/actor_key/mod.rs:36— rivetkit-rust/packages/shared-types/src/actor_key/mod.rs:36-57 | rivetkit-rust/packages/shared-types/src/actor_key/slash.rs:16-41 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:723— rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:723-744 | rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:897-919 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (22 lines × 2) engine/packages/api-public/src/runner_pools/delete.rs:62— engine/packages/api-public/src/runner_pools/delete.rs:62-83 | engine/packages/api-public/src/runner_pools/upsert.rs:109-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (22 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:848— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:848-869 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:972-993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:848` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1106— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1106-1127 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:245-266 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) engine/packages/auth-jwt/src/key_ring_machine/mod.rs:424— engine/packages/auth-jwt/src/key_ring_machine/mod.rs:424-445 | engine/packages/cluster-config/src/cluster_config_machine/mod.rs:353-375 — 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 `engine/packages/auth-jwt/src/key_ring_machine/mod.rs:424` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) engine/packages/pegboard/src/index.rs:1599— engine/packages/pegboard/src/index.rs:1599-1616 | engine/packages/pegboard/src/index.rs:1636-1652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/index.rs:1599` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) rivetkit-python/client/src/simple/async/handle.rs:91— rivetkit-python/client/src/simple/async/handle.rs:91-107 | rivetkit-python/client/src/simple/sync/handle.rs:81-98 — `rivetkit-python/client/src/simple/async/handle.rs` and `rivetkit-python/client/src/simple/sync/handle.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/simple/sync/handle.rs:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:496— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:496-513 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:552-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:496` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:700— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:700-716 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:756-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:700` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) engine/packages/depot-worker/src/tablet_coordinator_machine/mod.rs:111— engine/packages/depot-worker/src/tablet_coordinator_machine/mod.rs:111-126 | engine/packages/depot-worker/src/tablet_coordinator_machine/mod.rs:151-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_coordinator_machine/mod.rs:111` 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) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:64— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:64-79 | rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:522-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:241— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:241-256 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:363-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:241` 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/sqlite-prefetch/src/harness/readahead.rs:273— engine/packages/sqlite-prefetch/src/harness/readahead.rs:273-288 | engine/packages/sqlite-prefetch/src/harness/readahead.rs:558-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) engine/packages/depot-worker/src/filesystem/forks.rs:394— engine/packages/depot-worker/src/filesystem/forks.rs:394-403 | engine/packages/depot-worker/src/filesystem/forks.rs:508-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/forks.rs:394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:553— engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:553-563 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:633-642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) rivetkit-python/client/src/events/async/handle.rs:70— rivetkit-python/client/src/events/async/handle.rs:70-79 | rivetkit-python/client/src/events/sync/handle.rs:50-60 — 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-python/client/src/events/sync/handle.rs:50` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) 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 (10 lines × 4) engine/sdks/rust/envoy-client/src/tunnel.rs:366— engine/sdks/rust/envoy-client/src/tunnel.rs:366-375 | engine/sdks/rust/envoy-client/src/tunnel.rs:396-405 | engine/sdks/rust/envoy-client/src/tunnel.rs:623-632 | engine/sdks/rust/envoy-client/src/tunnel.rs:678-687 — 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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/async/client.rs:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/events/async/client.rs:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:488— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:488-497 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:793-802 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:488-497 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:793-802 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:488` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v4::Create` in one and `pegboard_actor_v4::ActorCreateRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–9 lines × 2) engine/packages/cli/src/auth.rs:191— engine/packages/cli/src/auth.rs:191-199 | engine/packages/cli/src/auth.rs:245-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–9 lines × 2) engine/packages/depot-volume/src/volume_client_machine/membership.rs:166— engine/packages/depot-volume/src/volume_client_machine/membership.rs:166-173 | engine/packages/depot-volume/src/volume_client_machine/repair.rs:65-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-volume/src/volume_client_machine/membership.rs:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) engine/packages/env/src/backends/production/clock.rs:112— engine/packages/env/src/backends/production/clock.rs:112-120 | engine/packages/env/src/backends/production/clock.rs:170-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/env/src/backends/production/clock.rs:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) engine/sdks/rust/envoy-client/src/stringify.rs:79— engine/sdks/rust/envoy-client/src/stringify.rs:79-87 | engine/sdks/rust/envoy-client/src/stringify.rs:147-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/stringify.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Hollow method — returns a constant without doing the work engine/packages/config/src/config/epoxy.rs:12— `validate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work engine/packages/engine/src/main.rs:278— `print_command_output` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work engine/packages/sqlite-prefetch/src/harness/vfs.rs:615— `vfs_get_last_error` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work engine/sdks/rust/envoy-client/src/connection/wasm.rs:381— `start_connection` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
X18 · Disposal-pattern correctness· Explicit release owed and not made on every path · ×4
Explicit release owed and not made on every path rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:891— `transaction` (line 891) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 897; the `return` on line 897 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
Explicit release owed and not made on every path engine/packages/pegboard-envoy/src/kv.rs:144— `tx` (line 144) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
Explicit release owed and not made on every path engine/packages/pegboard-envoy/src/kv.rs:169— `tx` (line 169) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
Explicit release owed and not made on every path engine/packages/pegboard-envoy/src/kv.rs:203— `tx` (line 203) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 238; the `return` on line 232 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
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:99— 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:102— 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.
OverflowMap::plan_commit (cyclomatic 39) engine/packages/sqlite-prefetch/src/overflow/commit.rs:240— OverflowMap::plan_commit has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OverflowMap::apply (cyclomatic 26) engine/packages/sqlite-prefetch/src/overflow/mod.rs:570— OverflowMap::apply has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OverflowMap::committed (cyclomatic 17) engine/packages/sqlite-prefetch/src/overflow/commit.rs:663— OverflowMap::committed 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.
ActorTask::start_actor (cyclomatic 28) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:1270— ActorTask::start_actor 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.
ActorTask::run_live (cyclomatic 24) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:518— ActorTask::run_live 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.
ActorTask::handle_dispatch (cyclomatic 16) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:971— ActorTask::handle_dispatch 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.
rivetkit_wasm::dispatch_event (cognitive 63) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:774— 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::run_preamble (cognitive 22) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:676— rivetkit_wasm::run_preamble has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (22 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.
rivetkit_wasm::start_wasm_serverless_request (cognitive 20) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:2961— 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_napi::napi_actor_events::dispatch_event (cognitive 48) rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:428— 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_preamble (cognitive 17) rivetkit-typescript/packages/rivetkit-napi/src/napi_actor_events.rs:233— rivetkit_napi::napi_actor_events::run_preamble has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 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.
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.
ActorTask::run_live (cognitive 35) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:518— ActorTask::run_live has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 4 (11 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.
ActorTask::start_actor (cognitive 30) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:1270— ActorTask::start_actor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 5, match/switch 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ActorTask::handle_dispatch (cognitive 21) rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:971— ActorTask::handle_dispatch has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 3 (4 pts), boolean chains 1 (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.
SqliteDb::release_transaction (cognitive 31) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:1069— SqliteDb::release_transaction has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqliteDb::finish_transaction_inner (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:836— SqliteDb::finish_transaction_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 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.
SqliteDb::close_backend (cognitive 16) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1072— SqliteDb::close_backend has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (7 pts), boolean chains 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.
Slot::open_filesystem_timed (cognitive 30) engine/packages/depot-client/src/volumes/slot.rs:523— Slot::open_filesystem_timed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Slot::checkpoint (cognitive 19) engine/packages/depot-client/src/volumes/slot.rs:157— Slot::checkpoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 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.
Slot::create_locked (cognitive 16) engine/packages/depot-client/src/volumes/slot.rs:380— Slot::create_locked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_singleton_coordinator::singleton_coordinator_machine::handle_read (cognitive 29) engine/packages/singleton-coordinator/src/singleton_coordinator_machine/mod.rs:1006— rivet_singleton_coordinator::singleton_coordinator_machine::handle_read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 4 (6 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_singleton_coordinator::runtime::watch_worker (cognitive 22) engine/packages/singleton-coordinator/src/runtime.rs:202— rivet_singleton_coordinator::runtime::watch_worker has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 4 (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.
rivet_singleton_coordinator::singleton_coordinator_machine::publication::event (cognitive 16) engine/packages/singleton-coordinator/src/singleton_coordinator_machine/publication.rs:115— rivet_singleton_coordinator::singleton_coordinator_machine::publication::event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_auth_jwt::key_ring_machine::transition (cognitive 28) engine/packages/auth-jwt/src/key_ring_machine/mod.rs:72— rivet_auth_jwt::key_ring_machine::transition has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 5 (12 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
rivet_auth_jwt::rotation::serve (cognitive 19) engine/packages/auth-jwt/src/rotation.rs:141— rivet_auth_jwt::rotation::serve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_auth_jwt::planner::reconcile_issuer (cognitive 18) engine/packages/auth-jwt/src/planner.rs:307— 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_engine::run_config::start (cognitive 21) engine/packages/engine/src/run_config.rs:180— rivet_engine::run_config::start has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 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.
rivet_engine::depot_command::health::sample (cognitive 20) engine/packages/engine/src/depot_command/health.rs:46— rivet_engine::depot_command::health::sample has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (12 pts), match/switch 3 (5 pts), if/else 2 (3 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rivet_engine::depot_command::migrate_from_v2::migrate (cognitive 19) engine/packages/engine/src/depot_command/migrate_from_v2.rs:125— rivet_engine::depot_command::migrate_from_v2::migrate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (7 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.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×3
Edited copy of a member (32 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/cold.rs:312— engine/packages/depot-worker/src/tablet_maintainer_machine/state/cold.rs:312-343 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:1454-1492 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:81— rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:81-121 | rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:132-163 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) rivetkit-rust/packages/client/src/remote_manager.rs:255— rivetkit-rust/packages/client/src/remote_manager.rs:255-286 | rivetkit-rust/packages/client/src/remote_manager.rs:288-319 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1040— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:1040-1071 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3259-3289 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) engine/sdks/rust/envoy-client/src/sqlite.rs:545— engine/sdks/rust/envoy-client/src/sqlite.rs:545-578 | engine/sdks/rust/envoy-client/src/sqlite.rs:585-615 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) engine/packages/depot-worker/src/command/groups.rs:198— engine/packages/depot-worker/src/command/groups.rs:198-228 | engine/packages/depot-worker/src/command/groups.rs:291-322 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×3
Edited copy of a member (26 corresponding lines) engine/packages/depot-worker/src/command/mod.rs:859— engine/packages/depot-worker/src/command/mod.rs:859-884 | engine/packages/depot-worker/src/command/mod.rs:897-926 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) engine/packages/depot-worker/src/tablet_supervisor.rs:2137— engine/packages/depot-worker/src/tablet_supervisor.rs:2137-2162 | engine/packages/depot-worker/src/tablet_supervisor.rs:2176-2207 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:281— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:281-310 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:325-350 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×3
Edited copy of a member (24 corresponding lines) rivetkit-swift/Sources/RivetKitClient/RemoteManager.swift:109— rivetkit-swift/Sources/RivetKitClient/RemoteManager.swift:109-132 | rivetkit-swift/Sources/RivetKitClient/RemoteManager.swift:134-157 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) rivetkit-rust/packages/engine-process/src/lib.rs:858— rivetkit-rust/packages/engine-process/src/lib.rs:858-881 | rivetkit-rust/packages/engine-process/src/lib.rs:883-910 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) engine/packages/api-public/src/namespaces.rs:32— engine/packages/api-public/src/namespaces.rs:32-59 | engine/packages/api-public/src/namespaces.rs:83-106 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×3
Edited copy of a member (28 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/retired.rs:414— engine/packages/depot-worker/src/tablet_maintainer_machine/state/retired.rs:414-441 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/retired.rs:524-551 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) rivetkit-python/client/src/simple/async/handle.rs:84— rivetkit-python/client/src/simple/async/handle.rs:84-112 | rivetkit-python/client/src/simple/sync/handle.rs:75-102 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) engine/packages/auth-jwt/src/rotation.rs:60— engine/packages/auth-jwt/src/rotation.rs:60-87 | engine/packages/pegboard-v2-migrator/src/requests.rs:93-125 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×3
Edited copy of a member (21 corresponding lines) rivetkit-python/client/src/events/sync/handle.rs:25— rivetkit-python/client/src/events/sync/handle.rs:25-45 | rivetkit-python/client/src/simple/sync/handle.rs:45-70 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:225— rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:225-245 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:467-489 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:799— engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:799-824 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/forks.rs:945-965 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) rivetkit-rust/packages/client/src/protocol/codec.rs:355— rivetkit-rust/packages/client/src/protocol/codec.rs:355-374 | rivetkit-rust/packages/rivetkit-core/src/registry/actor_connect.rs:264-287 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:205— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:205-224 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:228-247 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) engine/packages/api-peer/src/repair/calls.rs:496— engine/packages/api-peer/src/repair/calls.rs:496-517 | engine/packages/api-peer/src/repair/diagnostics.rs:24-43 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×3
Edited copies of one member (4 members, 14+ corresponding lines) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:304— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:304-317 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:320-333 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:336-349 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:352-367 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:418— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:418-431 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:435-450 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1883-1896 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1900-1915 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) engine/packages/api-builder/src/extract.rs:39— engine/packages/api-builder/src/extract.rs:39-52 | engine/packages/api-builder/src/extract.rs:71-86 | engine/packages/api-builder/src/extract.rs:98-111 | engine/packages/api-builder/src/extract.rs:123-136 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×3
Edited copies of one member (3 members, 8+ corresponding lines) engine/packages/depot-worker/src/object_store_metrics.rs:693— engine/packages/depot-worker/src/object_store_metrics.rs:693-700 | engine/packages/depot-worker/src/object_store_metrics.rs:737-744 | engine/packages/depot-worker/src/object_store_metrics.rs:746-753 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:946— engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:946-953 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1157-1165 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1168-1176 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) engine/sdks/rust/envoy-client/src/metrics.rs:352— engine/sdks/rust/envoy-client/src/metrics.rs:352-359 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:3354-3361 | rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs:156-163 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×3
Edited copy of a member (4 corresponding lines) engine/packages/depot-volume/src/volume_client_machine/membership.rs:36— engine/packages/depot-volume/src/volume_client_machine/membership.rs:36-39 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/membership.rs:59-62 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) engine/packages/depot-client/src/filesystem/cache.rs:272— engine/packages/depot-client/src/filesystem/cache.rs:272-275 | engine/packages/depot-client/src/filesystem/rollback.rs:147-150 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1277— engine/packages/depot-worker/src/tablet_maintainer_machine/state/deletion.rs:1277-1280 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/unload.rs:833-836 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (25 lines × 2) engine/packages/util/src/throttle.rs:173— engine/packages/util/src/throttle.rs:173-197 | engine/packages/util/src/throttle.rs:233-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/util/src/throttle.rs:173` 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 (25 lines × 2) rivetkit-python/client/src/simple/async/handle.rs:127— rivetkit-python/client/src/simple/async/handle.rs:127-151 | rivetkit-python/client/src/simple/sync/handle.rs:116-140 — `rivetkit-python/client/src/simple/async/handle.rs` and `rivetkit-python/client/src/simple/sync/handle.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/simple/async/handle.rs:127` 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 (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:3348-3372 — 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-typescript/packages/rivetkit-napi/src/lib.rs:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:106` calls `and_then`, `as_deref` and `rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:3373` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (24 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:520— engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:520-543 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs:570-593 — before extracting anything, compare `engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:198— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:198-221 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:320-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1127— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1127-1150 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:87-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–19 lines × 2) engine/packages/engine/src/epoxy_services.rs:69— engine/packages/engine/src/epoxy_services.rs:69-87 | engine/packages/pegboard-v2-migrator/src/services/migrator.rs:76-91 — 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 `engine/packages/engine/src/epoxy_services.rs:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/engine/src/epoxy_services.rs:91` calls `send_replace` and `engine/packages/pegboard-v2-migrator/src/services/migrator.rs:95` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–19 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:627— engine/packages/pegboard/src/actor_machine/mod.rs:627-642 | engine/packages/pegboard/src/actor_machine/mod.rs:805-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/actor_machine/mod.rs:627` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–19 lines × 2) engine/packages/pegboard/src/index.rs:1380— engine/packages/pegboard/src/index.rs:1380-1398 | engine/packages/pegboard/src/index.rs:1445-1460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/index.rs:1380` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 3) engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:525— engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:525-536 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1481-1492 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs:575-586 — before extracting anything, compare `engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 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 × 3) engine/packages/pegboard/src/catalog.rs:835— engine/packages/pegboard/src/catalog.rs:835-846 | engine/packages/pegboard/src/catalog.rs:1027-1038 | engine/packages/pegboard/src/catalog.rs:1246-1257 — 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/guard-core/src/response_body.rs:138— engine/packages/guard-core/src/response_body.rs:138-149 | engine/packages/guard-core/src/response_body.rs:151-162 | engine/packages/guard-core/src/response_body.rs:164-175 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/actors/reschedule.rs:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) engine/packages/depot-log/src/log_shard_machine/state/reads.rs:46— engine/packages/depot-log/src/log_shard_machine/state/reads.rs:46-54 | engine/packages/depot-log/src/log_shard_machine/state/reads.rs:113-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-log/src/log_shard_machine/state/reads.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:818— engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:818-827 | engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:842-850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:818` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) engine/packages/depot-volume/src/volume_client_machine/runner.rs:459— engine/packages/depot-volume/src/volume_client_machine/runner.rs:459-466 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:607-614 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:632-639 | engine/packages/depot-volume/src/volume_client_machine/runner.rs:655-662 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) engine/packages/sqlite-embedded/src/pager_cache.rs:577— engine/packages/sqlite-embedded/src/pager_cache.rs:577-584 | engine/packages/sqlite-embedded/src/pager_cache.rs:611-618 | engine/packages/sqlite-embedded/src/pager_cache.rs:640-647 | engine/packages/sqlite-embedded/src/pager_cache.rs:690-697 — 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 `engine/packages/sqlite-embedded/src/pager_cache.rs:577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) engine/packages/depot-fs-core/src/keys/slatedb.rs:886— engine/packages/depot-fs-core/src/keys/slatedb.rs:886-893 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1113-1120 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1200-1207 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1235-1242 — 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 `engine/packages/depot-fs-core/src/keys/slatedb.rs:886` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) engine/packages/pegboard-envoy/src/connection.rs:1243— engine/packages/pegboard-envoy/src/connection.rs:1243-1249 | engine/packages/pegboard-envoy/src/connection.rs:1533-1539 | engine/packages/pegboard-envoy/src/connection/inbound.rs:62-68 — 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/pegboard-envoy/src/routes.rs:275— engine/packages/pegboard-envoy/src/routes.rs:275-281 | engine/packages/pegboard-gateway/src/routes.rs:998-1004 | engine/packages/pegboard-gateway/src/routes.rs:1392-1398 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard-envoy/src/routes.rs:275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `ws` to `WebSocketUpgrade` in one and `Result<WebSocketUpgrade, WebSocketUpgradeRejection>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 3) engine/packages/sqlite-embedded/src/vfs/transport.rs:1413— engine/packages/sqlite-embedded/src/vfs/transport.rs:1413-1419 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2184-2190 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2338-2344 — 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.
Unfinished branch — a todo!() / unimplemented!() arm in a real function rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:929— `dispatch_event` does real work, but one of its branches is `anyhow!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
Unfinished branch — a todo!() / unimplemented!() arm in a real function rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:966— `dispatch_event` does real work, but one of its branches is `anyhow!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
Unfinished branch — a todo!() / unimplemented!() arm in a real function rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1005— `dispatch_event` does real work, but one of its branches is `anyhow!` with a "not implemented" message — a case that was never written, and a panic the first time it is reached. Implement the case, or return an error that says why it is not handled.
Duplicated block (27 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/actor/config.ts:565— rivetkit-typescript/packages/rivetkit/src/actor/config.ts:565 · rivetkit-typescript/packages/rivetkit/src/actor/config.ts:603 — 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.
Duplicated block (27 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1782— rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1782 · rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1826 — 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 (27 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4985— rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4985 · rivetkit-typescript/packages/rivetkit/src/registry/native.ts:5082 — 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.
Configuration option is read nowhere engine/packages/config/src/config/logs.rs:9— `Logs.redirect_logs_dir` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere engine/packages/config/src/config/pegboard.rs:101— `Pegboard.gateway_port` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere rivetkit-rust/packages/shared-types/src/serverless_metadata.rs:62— `ServerlessActorPreload.prefixes` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Executor::execute (cyclomatic 45) engine/packages/pegboard/src/actor_machine/executor.rs:1411— Executor::execute has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Executor::execute (cyclomatic 21) engine/packages/pegboard/src/namespace_machine/executor.rs:411— Executor::execute 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.
Prefetcher::plan (cyclomatic 31) engine/packages/sqlite-prefetch/src/prefetcher.rs:395— Prefetcher::plan has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Prefetcher::fetched (cyclomatic 26) engine/packages/sqlite-prefetch/src/prefetcher.rs:539— Prefetcher::fetched 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.
View::load (cyclomatic 29) engine/packages/depot-client/src/filesystem/cache.rs:1585— View::load 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.
View::prefetch_chunks (cyclomatic 20) engine/packages/depot-client/src/filesystem/cache.rs:1487— View::prefetch_chunks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
pegboard_v2_migrator::migrator_machine::executor::run (cyclomatic 27) engine/packages/pegboard-v2-migrator/src/migrator_machine/executor.rs:145— pegboard_v2_migrator::migrator_machine::executor::run 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.
pegboard_v2_migrator::migrator_machine::on_page (cyclomatic 18) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:808— pegboard_v2_migrator::migrator_machine::on_page 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.
VolumeHost::admit_locked (cyclomatic 25) engine/packages/depot-worker/src/command/volume_host.rs:1305— VolumeHost::admit_locked 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.
VolumeHost::open (cyclomatic 17) engine/packages/depot-worker/src/command/volume_host.rs:1858— VolumeHost::open 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.
ReadSession::scan_within (cyclomatic 23) engine/packages/depot-worker/src/filesystem/session.rs:1158— ReadSession::scan_within 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.
ReadSession::chunk_versions (cyclomatic 22) engine/packages/depot-worker/src/filesystem/session.rs:1289— ReadSession::chunk_versions 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_engine::depot_command::tablet (cyclomatic 19) engine/packages/engine/src/depot_command.rs:484— rivet_engine::depot_command::tablet 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.
rivet_engine::run_config::start (cyclomatic 17) engine/packages/engine/src/run_config.rs:180— rivet_engine::run_config::start has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ActorContext::teardown_sleep_state (cyclomatic 19) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:690— 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 18) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:787— ActorContext::apply_state_deltas_inner 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.
LogShardExecutor::open_with_payload_retention (cognitive 178) engine/packages/depot-log/src/log_shard_machine/executor/recovery.rs:109— LogShardExecutor::open_with_payload_retention has cognitive complexity 178 (threshold 15). Drivers by points: if/else 41 (122 pts), match/switch 10 (27 pts), loops 9 (17 pts), boolean chains 12 (nesting depth added 106). 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.
LogShardExecutor::write_to_disk_with_roll (cognitive 18) engine/packages/depot-log/src/log_shard_machine/executor/mod.rs:350— LogShardExecutor::write_to_disk_with_roll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
View::load (cognitive 69) engine/packages/depot-client/src/filesystem/cache.rs:1585— View::load has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (42 pts), match/switch 5 (12 pts), loops 4 (10 pts), boolean chains 5 (nesting depth added 40). 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.
View::prefetch_chunks (cognitive 33) engine/packages/depot-client/src/filesystem/cache.rs:1487— View::prefetch_chunks has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (10 pts), match/switch 3 (7 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabletSupervisor::reconcile (cognitive 60) engine/packages/depot-worker/src/tablet_supervisor.rs:900— TabletSupervisor::reconcile has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (35 pts), match/switch 6 (10 pts), boolean chains 8, loops 6 (7 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.
TabletSupervisor::operator (cognitive 18) engine/packages/depot-worker/src/tablet_supervisor.rs:818— TabletSupervisor::operator has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (9 pts), if/else 3 (6 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Collector::batch (cognitive 56) engine/packages/topology/src/heartbeat_gc.rs:378— Collector::batch has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (29 pts), match/switch 5 (18 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Collector::pass (cognitive 23) engine/packages/topology/src/heartbeat_gc.rs:245— Collector::pass has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_api_peer::volumes::serve (cognitive 55) engine/packages/api-peer/src/volumes/mod.rs:260— rivet_api_peer::volumes::serve has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 4 (11 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 29). 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_api_peer::volumes::handle (cognitive 16) engine/packages/api-peer/src/volumes/mod.rs:172— rivet_api_peer::volumes::handle has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (6 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Prefetcher::plan (cognitive 51) engine/packages/sqlite-prefetch/src/prefetcher.rs:395— Prefetcher::plan has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 12 (15 pts), match/switch 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Prefetcher::fetched (cognitive 44) engine/packages/sqlite-prefetch/src/prefetcher.rs:539— Prefetcher::fetched has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 5 (6 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VolumeHost::admit_locked (cognitive 32) engine/packages/depot-worker/src/command/volume_host.rs:1305— VolumeHost::admit_locked has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 5 (9 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.
VolumeHost::open (cognitive 16) engine/packages/depot-worker/src/command/volume_host.rs:1858— VolumeHost::open has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (7 pts), if/else 5 (6 pts), boolean chains 3 (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.
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.
rivetkit_client::connection::start_connection (cognitive 24) rivetkit-rust/packages/client/src/connection.rs:740— rivetkit_client::connection::start_connection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (10 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Server::get_pages (cognitive 31) engine/packages/sqlite-prefetch/src/harness/server.rs:202— Server::get_pages has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (9 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Server::expand_overflow (cognitive 20) engine/packages/sqlite-prefetch/src/harness/server.rs:299— Server::expand_overflow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_api_public_shim::routes::list_actors (cognitive 24) engine/packages/api-public-shim/src/routes.rs:1800— rivet_api_public_shim::routes::list_actors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (7 pts), loops 2 (4 pts), boolean chains 2 (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.
rivet_api_public_shim::routes::fork_actor_inner (cognitive 19) engine/packages/api-public-shim/src/routes.rs:1416— rivet_api_public_shim::routes::fork_actor_inner has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (9 pts), if/else 6 (7 pts), boolean chains 2, loops 1 (nesting depth added 4). 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_cli::util::build_resources (cognitive 24) engine/packages/cli/src/util.rs:53— 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_cli::commands::deploy::cluster::wait_for_build (cognitive 16) engine/packages/cli/src/commands/deploy/cluster.rs:255— rivet_cli::commands::deploy::cluster::wait_for_build has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseSlot::perform (cognitive 23) engine/packages/sqlite-embedded/src/worker.rs:981— DatabaseSlot::perform has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (4 pts), boolean chains 2 (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.
DatabaseSlot::run_one (cognitive 16) engine/packages/sqlite-embedded/src/worker.rs:875— DatabaseSlot::run_one has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 3 (4 pts), boolean chains 3 (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.
CoreRegistry::serve_with_config_and_handle_observer (cognitive 23) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:623— CoreRegistry::serve_with_config_and_handle_observer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 5 (7 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.
CoreRegistry::health (cognitive 18) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:405— 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.
CoreServerlessRuntime::start_response (cognitive 17) rivetkit-rust/packages/rivetkit-core/src/serverless.rs:419— CoreServerlessRuntime::start_response has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (4 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.
CoreServerlessRuntime::ensure_envoy (cognitive 16) rivetkit-rust/packages/rivetkit-core/src/serverless.rs:579— CoreServerlessRuntime::ensure_envoy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: actor-http-client.ts ↔ actor-websocket-client.ts rivetkit-typescript/packages/rivetkit/src/engine-client/actor-http-client.ts:1— `rivetkit-typescript/packages/rivetkit/src/engine-client/actor-http-client.ts` and `rivetkit-typescript/packages/rivetkit/src/engine-client/actor-websocket-client.ts` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `6a52d2ee` fix(gateway): support skip ready wait routing; `4df4d5ae` chore(rivetkit): doc skip ready wait; `fc57d3c1` feat(rivetkit): support gateway bypass client requests — run `git show` on any of them.
Change coupling: lib.rs ↔ napi-runtime.ts rivetkit-rust/packages/rivetkit-core/src/lib.rs:1— `rivetkit-rust/packages/rivetkit-core/src/lib.rs` and `rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts` change together 50% of the time (10 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:916— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:916-929 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:915-928 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:938-951 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:976-989 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:965-978 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:965-978 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) rivetkit-rust/packages/actor-persist/src/versioned.rs:52— rivetkit-rust/packages/actor-persist/src/versioned.rs:52-65 | rivetkit-rust/packages/client-protocol/src/versioned.rs:31-41 | rivetkit-rust/packages/client-protocol/src/versioned.rs:437-608 | rivetkit-rust/packages/client-protocol/src/versioned.rs:665-675 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:39-51 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:348-360 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/packages/depot-fs-core/src/keys/slatedb.rs:878— engine/packages/depot-fs-core/src/keys/slatedb.rs:878-905 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1105-1157 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1189-1222 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1227-1249 | engine/packages/depot-fs-core/src/keys/slatedb.rs:1320-1348 — 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:129— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:129-149 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:175-198 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:201-224 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:227-255 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:258-287 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×2
Edited copy of a member (46 corresponding lines) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1125— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:1125-1170 | rivetkit-swift/Sources/RivetKitClient/CBORSupport.swift:86-134 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) engine/packages/pegboard/src/actor_machine/mod.rs:2190— engine/packages/pegboard/src/actor_machine/mod.rs:2190-2239 | engine/packages/pegboard/src/actor_machine/mod.rs:2247-2292 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×2
Edited copy of a member (35 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:687— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:687-721 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:743-780 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) engine/packages/sqlite-embedded/src/query.rs:642— engine/packages/sqlite-embedded/src/query.rs:642-676 | engine/packages/sqlite-embedded/src/query.rs:682-727 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) engine/packages/pegboard/src/catalog.rs:1016— engine/packages/pegboard/src/catalog.rs:1016-1054 | engine/packages/pegboard/src/catalog.rs:1237-1273 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) rivetkit-rust/packages/client/src/remote_manager.rs:726— rivetkit-rust/packages/client/src/remote_manager.rs:726-774 | rivetkit-rust/packages/client/src/remote_manager.rs:782-818 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) engine/packages/runtime/src/lib.rs:206— engine/packages/runtime/src/lib.rs:206-247 | rivetkit-rust/packages/rivetkit-core/src/tokio_runtime_metrics.rs:138-185 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:487— engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:487-528 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_references.rs:715-756 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) rivetkit-rust/packages/client/src/remote_manager.rs:327— rivetkit-rust/packages/client/src/remote_manager.rs:327-384 | rivetkit-rust/packages/client/src/remote_manager.rs:392-434 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) engine/packages/api-public/src/actors/create.rs:57— engine/packages/api-public/src/actors/create.rs:57-99 | engine/packages/api-public/src/actors/get_or_create.rs:65-107 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) engine/packages/depot-fs-core/src/txn.rs:365— engine/packages/depot-fs-core/src/txn.rs:365-391 | engine/packages/depot-fs-core/src/txn.rs:395-419 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) engine/packages/pegboard/src/actor_machine/executor.rs:2062— engine/packages/pegboard/src/actor_machine/executor.rs:2062-2087 | engine/packages/pegboard/src/namespace_machine/executor.rs:665-689 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×2
Edited copies of one member (3 members, 21+ corresponding lines) rivetkit-rust/packages/actor-persist/src/versioned.rs:197— rivetkit-rust/packages/actor-persist/src/versioned.rs:197-221 | rivetkit-rust/packages/actor-persist/src/versioned.rs:223-243 | rivetkit-rust/packages/actor-persist/src/versioned.rs:245-265 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) engine/sdks/rust/envoy-client/src/kv.rs:114— engine/sdks/rust/envoy-client/src/kv.rs:114-134 | engine/sdks/rust/envoy-client/src/sqlite.rs:491-511 | engine/sdks/rust/envoy-client/src/sqlite.rs:513-533 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×2
Edited copies of one member (3 members, 12+ corresponding lines) engine/packages/depot-client/src/filesystem/remote.rs:387— engine/packages/depot-client/src/filesystem/remote.rs:387-404 | engine/packages/depot-client/src/filesystem/remote.rs:413-424 | engine/packages/depot-client/src/filesystem/remote.rs:435-447 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/queue.rs:349— rivetkit-typescript/packages/rivetkit-napi/src/queue.rs:349-362 | rivetkit-typescript/packages/rivetkit-napi/src/queue.rs:367-382 | rivetkit-typescript/packages/rivetkit-napi/src/queue.rs:387-398 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:30— rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:30-36 | rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:38-44 | rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:46-58 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) engine/packages/env/src/capabilities/tokio/task.rs:158— engine/packages/env/src/capabilities/tokio/task.rs:158-164 | engine/packages/env/src/capabilities/tokio/task.rs:212-219 | engine/packages/env/src/capabilities/tokio/task.rs:226-233 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) engine/packages/pegboard/src/catalog.rs:1907— engine/packages/pegboard/src/catalog.rs:1907-1916 | engine/packages/pegboard/src/catalog.rs:1939-1948 | engine/packages/pegboard/src/namespace_machine/mod.rs:930-942 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) engine/packages/depot-worker/src/filesystem/pending_work.rs:202— engine/packages/depot-worker/src/filesystem/pending_work.rs:202-211 | engine/packages/depot-worker/src/filesystem/session.rs:1998-2007 | engine/packages/pegboard-envoy/src/kv.rs:319-328 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) 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/runner_pools/delete.rs:32-37 | engine/packages/api-public/src/runner_pools/list.rs:51-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:349— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem.rs:349-355 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:1144-1149 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/poll.rs:385-390 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×2
Edited copy of a member (5 corresponding lines) engine/packages/depot-client/src/lib.rs:58— engine/packages/depot-client/src/lib.rs:58-62 | engine/packages/depot-client/src/volume_requests.rs:499-503 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) engine/packages/env/src/capabilities/fs.rs:134— engine/packages/env/src/capabilities/fs.rs:134-141 | engine/packages/env/src/capabilities/host.rs:65-69 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (32 lines × 2) rivetkit-python/client/src/events/async/handle.rs:27— rivetkit-python/client/src/events/async/handle.rs:27-58 | rivetkit-python/client/src/simple/async/handle.rs:47-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (32 lines × 2) engine/packages/sqlite-embedded/src/query.rs:408— engine/packages/sqlite-embedded/src/query.rs:408-439 | engine/packages/sqlite-embedded/src/query.rs:487-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/query.rs:408` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/sqlite-embedded/src/query.rs:485` calls `default` and `engine/packages/sqlite-embedded/src/query.rs:406` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (29 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:478— engine/packages/pegboard/src/actor_machine/mod.rs:478-506 | engine/packages/pegboard/src/actor_machine/mod.rs:812-840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/actor_machine/mod.rs:478` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:437— rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:437-465 | rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:488-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:437` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) engine/packages/config/src/lib.rs:257— engine/packages/config/src/lib.rs:257-276 | engine/packages/config/src/lib.rs:282-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/config/src/lib.rs:257` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1710— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1710-1729 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1731-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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1710` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–18 lines × 2) engine/packages/pegboard-envoy/src/routes.rs:354— engine/packages/pegboard-envoy/src/routes.rs:354-368 | engine/packages/pegboard-envoy/src/routes.rs:396-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard-envoy/src/routes.rs:396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–18 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:924— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:924-941 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:1017-1031 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:655— engine/packages/pegboard/src/actor_machine/mod.rs:655-666 | engine/packages/pegboard/src/actor_machine/mod.rs:835-849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/actor_machine/mod.rs:655` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/pegboard/src/actor_machine/mod.rs:652` calls `clone`, `stop_actor` and `engine/packages/pegboard/src/actor_machine/mod.rs:833` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–15 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:450— rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:450-464 | rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:468-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/sleep.rs:468` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–14 lines × 2) engine/packages/pegboard/src/index.rs:348— engine/packages/pegboard/src/index.rs:348-359 | engine/packages/pegboard/src/index.rs:370-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/index.rs:348` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–14 lines × 2) rivetkit-rust/packages/client/src/remote_manager.rs:745— rivetkit-rust/packages/client/src/remote_manager.rs:745-758 | rivetkit-rust/packages/client/src/remote_manager.rs:795-806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/client/src/remote_manager.rs:745` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-rust/packages/client/src/remote_manager.rs:743` calls `push`, `as_str` and `rivetkit-rust/packages/client/src/remote_manager.rs:794` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 3) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:381— engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:381-389 | engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:278-286 | engine/packages/depot-volume/src/volume_client_machine/repair.rs:150-159 — before extracting anything, compare `engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs` and `engine/packages/depot-volume/src/volume_client_machine/pipeline.rs` as WHOLE FILES: this scan already matched 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-volume/src/volume_client_machine/repair.rs:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) engine/packages/depot-worker/src/stop_requests.rs:152— engine/packages/depot-worker/src/stop_requests.rs:152-160 | engine/packages/depot-worker/src/stop_requests.rs:188-197 | engine/packages/depot-worker/src/stop_requests.rs:224-233 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/stop_requests.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–10 lines × 2) engine/packages/depot-worker/src/filesystem/read.rs:246— engine/packages/depot-worker/src/filesystem/read.rs:246-253 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:190-199 — 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 `engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–10 lines × 2) engine/packages/sqlite-embedded/src/pager_cache.rs:491— engine/packages/sqlite-embedded/src/pager_cache.rs:491-498 | engine/packages/sqlite-embedded/src/pager_cache.rs:538-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/pager_cache.rs:491` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1842— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1842-1850 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1875-1883 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1911-1919 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1944-1952 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2020-2028 — 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 `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1842` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1865— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1865-1873 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1898-1906 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1934-1942 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1967-1975 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2049-2057 — 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 `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1865` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1977` calls `clone` and `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1875` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 2) engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:399— engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:399-405 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:416-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/state/filesystem_reads.rs:399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/util.rs:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 6) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1609— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1609-1615 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1842-1848 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1875-1881 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1911-1917 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1944-1950 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2020-2026 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1839` calls `observe` and `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1608` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 6) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:532— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:532-538 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:531-537 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:553-559 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:577-583 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:576-582 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:576-582 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::MigrateFromV2Begin` in one and `pegboard_actor_v3::MigrateFromV2Begin` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 4) engine/packages/sqlite-embedded/src/page_buffer.rs:85— engine/packages/sqlite-embedded/src/page_buffer.rs:85-91 | engine/packages/sqlite-embedded/src/page_buffer.rs:133-139 | engine/packages/sqlite-embedded/src/worker.rs:351-357 | engine/sdks/rust/envoy-client/src/sqlite.rs:23-29 — 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 (7 lines × 4) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:649— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:649-655 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:666-672 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:684-690 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:703-709 — 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:649` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:383— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:383-391 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:605-613 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:404-412 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:635-643 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:445-453 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:746-754 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:444-452 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:745-753 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::Create` in one and `pegboard_actor_v1::ActorCreateRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:791— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:791-799 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:826-834 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:933-941 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:932-940 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:955-963 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:993-1001 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:982-990 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:982-990 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:791` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::EnvoyUpsertRequest` in one and `pegboard_actor_v2::EnvoyUpsertRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:395— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:395-404 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:416-425 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:457-466 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:456-465 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:478-487 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:502-511 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:501-510 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:501-510 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:395` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::Reallocate` in one and `pegboard_actor_v2::Reallocate` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:708— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:708-717 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:744-753 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:850-859 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:849-858 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:872-881 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:910-919 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:899-908 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:899-908 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:708` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::IndexListActorsRequest` in one and `pegboard_actor_v2::IndexListActorsRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:408— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:408-414 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:429-435 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:470-476 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:469-475 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:491-497 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:515-521 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:514-520 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:514-520 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::UpdateRoute` in one and `pegboard_actor_v2::UpdateRoute` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1103— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1103-1109 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:1135-1141 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1245-1251 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1244-1250 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1267-1273 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1305-1311 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1294-1300 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1294-1300 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::PoolStatus` in one and `pegboard_actor_v2::PoolStatus` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Low cohesion: Connection (LCOM4 6) engine/packages/env/src/capabilities/http.rs:153— Connection'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: CoreRegistry (LCOM4 4) rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:131— 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.
Skeleton type — most members are unfinished engine/packages/depot-worker/src/metrics_wasm.rs:11— `impl Discard` has 3 unfinished methods out of 5 — a scaffolded type that was never implemented.
Skeleton type — most members are unfinished engine/sdks/rust/envoy-client/src/websocket.rs:42— `impl WebSocketSender` has 2 unfinished methods out of 4 — a scaffolded type that was never implemented.
R10 · Code Duplication· Duplicated block with local edits (44 matched lines × 2 locations) · ×2
Duplicated block with local edits (44 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 — 216 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 (44 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:434 — the two spans are one implementation copied and then locally edited — 331 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 (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:697— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:697 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:771 — 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 (29 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:445— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:445 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:806 — 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 (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 (26 lines × 2 locations) rivetkit-typescript/packages/rivetkit/scripts/actor-config-schema-gen.ts:6— rivetkit-typescript/packages/rivetkit/scripts/actor-config-schema-gen.ts:6 · rivetkit-typescript/packages/rivetkit/scripts/registry-config-schema-gen.ts:6 — 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 (26 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:891— rivetkit-typescript/packages/rivetkit/src/registry/native.ts:891 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:176 — 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 (22 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/actor/config.ts:43— rivetkit-typescript/packages/rivetkit/src/actor/config.ts:43 · rivetkit-typescript/packages/rivetkit/src/registry/native.ts:762 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (22 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:443— rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:443 · rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Dead file (~1 LoC) rivetkit-typescript/packages/rivetkit/src/common/actor-persist.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×2
JavaScript dependencies are not locked examples/multiplayer-game/package.json:14— examples/multiplayer-game/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
JavaScript dependencies are not locked examples/sandbox/package.json:15— examples/sandbox/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X18 · Disposal-pattern correctness· Owned value's release suppressed and never restored · ×2
Owned value's release suppressed and never restored rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:993— `std::mem::forget(old)` (line 993) takes `old` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
Owned value's release suppressed and never restored rivetkit-typescript/packages/rivetkit-napi/src/actor_context.rs:1008— `std::mem::forget(old)` (line 1008) takes `old` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×1
Focus outline removed in CSS without a :focus replacement examples/experimental-durable-streams-ai-agent/frontend/App.css:238— `.input-wrapper textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×1
Animation without a prefers-reduced-motion guard rivetkit-typescript/packages/devtools/src/hooks/useDraggable.ts:127— `element.animate()` moves (`Web Animations API keyframes`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
ActorStateMachine::on_event (cyclomatic 157) engine/packages/pegboard/src/actor_machine/mod.rs:83— ActorStateMachine::on_event has cyclomatic complexity 157 (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.
TabletMaintainerMachine::on_event (cyclomatic 144) engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:286— TabletMaintainerMachine::on_event has cyclomatic complexity 144 (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.
MaintainerExecutor::execute (cyclomatic 107) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1576— MaintainerExecutor::execute has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LogShardExecutor::open_with_payload_retention (cyclomatic 79) engine/packages/depot-log/src/log_shard_machine/executor/recovery.rs:109— LogShardExecutor::open_with_payload_retention has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OperationIndex::apply (cyclomatic 65) engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.rs:279— OperationIndex::apply has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
native.buildNativeFactory::maybeHandleNativeInspectorRequest (cyclomatic 65) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4266— native.buildNativeFactory::maybeHandleNativeInspectorRequest has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (native.buildNativeFactory) 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.
WorkflowContextImpl.executeRace (cyclomatic 61) rivetkit-typescript/packages/workflow-engine/src/context.ts:2380— WorkflowContextImpl.executeRace has cyclomatic complexity 61 (threshold 15). Of this number, 44 points are the body's own statements and 17 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SingletonCoordinator::on_event (cyclomatic 58) engine/packages/singleton-coordinator/src/singleton_coordinator_machine/mod.rs:93— SingletonCoordinator::on_event has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ManifestExecutor::execute (cyclomatic 57) engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:495— ManifestExecutor::execute has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TopologyExecutor::execute (cyclomatic 53) engine/packages/topology/src/topology_machine/executor.rs:75— TopologyExecutor::execute has cyclomatic complexity 53 (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.
VfsContext::resolve_pages (cyclomatic 47) engine/packages/sqlite-embedded/src/vfs/transport.rs:1663— VfsContext::resolve_pages has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rivetkit_wasm::dispatch_event (cyclomatic 44) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:774— 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.
Client::command_with (cyclomatic 42) engine/packages/depot-client/src/command.rs:182— Client::command_with has cyclomatic complexity 42 (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.
TabletSupervisor::reconcile (cyclomatic 42) engine/packages/depot-worker/src/tablet_supervisor.rs:900— TabletSupervisor::reconcile has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Maintainer::start_with_alarms (cyclomatic 41) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:309— Maintainer::start_with_alarms has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.
TabletCoordinatorMachine::on_event (cyclomatic 40) engine/packages/depot-worker/src/tablet_coordinator_machine/mod.rs:65— TabletCoordinatorMachine::on_event 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.
Search::replacement (cyclomatic 40) engine/packages/depot-worker/src/tablet_coordinator_machine/placement.rs:563— Search::replacement has cyclomatic complexity 40 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MigratorStateMachine::on_event (cyclomatic 40) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:191— MigratorStateMachine::on_event 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.
Runner::process_attempt (cyclomatic 40) engine/packages/state-machine-durable/src/runner.rs:92— Runner::process_attempt has cyclomatic complexity 40 (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.
TopologyStateMachine::on_event (cyclomatic 38) engine/packages/topology/src/topology_machine/mod.rs:155— TopologyStateMachine::on_event 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:428— 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.
Pegboard::validate (cyclomatic 33) engine/packages/config/src/config/pegboard.rs:207— Pegboard::validate has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Acquire::run (cyclomatic 33) engine/packages/pegboard-gateway/src/acquire.rs:329— Acquire::run has cyclomatic complexity 33 (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.
LogShardMachine::on_event (cyclomatic 32) engine/packages/depot-log/src/log_shard_machine/mod.rs:141— LogShardMachine::on_event has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WorkflowContextImpl.executeLoop (cyclomatic 30) rivetkit-typescript/packages/workflow-engine/src/context.ts:1291— WorkflowContextImpl.executeLoop has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Collector::batch (cyclomatic 29) engine/packages/topology/src/heartbeat_gc.rs:378— Collector::batch 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.
native.buildNativeFactory (cyclomatic 29) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4159— native.buildNativeFactory has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (native.buildNativeFactory::maybeHandleNativeInspectorRequest) 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_api_peer::volumes::serve (cyclomatic 28) engine/packages/api-peer/src/volumes/mod.rs:260— rivet_api_peer::volumes::serve 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.
DepotConfig::validate (cyclomatic 28) engine/packages/config/src/config/depot.rs:303— DepotConfig::validate 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.
ClusterConfigStateMachine::on_event (cyclomatic 26) engine/packages/cluster-config/src/cluster_config_machine/mod.rs:80— ClusterConfigStateMachine::on_event 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.
ResponseBody::poll_frame (cyclomatic 26) engine/packages/guard-core/src/response_body.rs:132— 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.
rivet_singleton_coordinator::singleton_coordinator_machine::handle_read (cyclomatic 26) engine/packages/singleton-coordinator/src/singleton_coordinator_machine/mod.rs:1006— rivet_singleton_coordinator::singleton_coordinator_machine::handle_read 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.
ActorConnRaw.#handleOnClose (cyclomatic 26) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:979— ActorConnRaw.#handleOnClose 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.
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.
storage.flushSnapshot (cyclomatic 26) rivetkit-typescript/packages/workflow-engine/src/storage.ts:292— storage.flushSnapshot 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.
WorkflowContextImpl.executeStep (cyclomatic 26) rivetkit-typescript/packages/workflow-engine/src/context.ts:905— WorkflowContextImpl.executeStep 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.
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.
rivet_auth_jwt::key_ring_machine::transition (cyclomatic 25) engine/packages/auth-jwt/src/key_ring_machine/mod.rs:72— rivet_auth_jwt::key_ring_machine::transition 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.
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.executeJoin (cyclomatic 24) rivetkit-typescript/packages/workflow-engine/src/context.ts:2165— 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.
depot_client::volumes::owner::run (cyclomatic 23) engine/packages/depot-client/src/volumes/owner.rs:200— depot_client::volumes::owner::run 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_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner (cyclomatic 23) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:176— rivetkit_core::actor::migrate_kv_to_sqlite::import_core_state_if_needed_inner has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
lifecycle-errors.classifyActorError (cyclomatic 23) rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:57— lifecycle-errors.classifyActorError has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Registry.handler (cyclomatic 23) REDACTED:241— 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 items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Config::apply_dynamic (cyclomatic 21) engine/packages/config/src/lib.rs:218— Config::apply_dynamic 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.
ScanDetector::miss (cyclomatic 21) engine/packages/sqlite-prefetch/src/scan.rs:182— ScanDetector::miss 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.
ActorConfig::from_input (cyclomatic 21) rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:459— 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.
index.RegistryConfigSchema (cyclomatic 21) rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:312— index.RegistryConfigSchema 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.
Transaction::scan (cyclomatic 20) engine/packages/depot-client/src/filesystem/transaction.rs:776— Transaction::scan 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.
RequestExecutor::request (cyclomatic 20) engine/packages/depot-volume/src/volume_client_machine/executor/requests.rs:31— RequestExecutor::request 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.
rivet_engine_context::production::object_storage::build_object_store (cyclomatic 20) engine/packages/engine-context/src/production/object_storage.rs:129— rivet_engine_context::production::object_storage::build_object_store 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.
DatabaseSlot::run_one (cyclomatic 20) engine/packages/sqlite-embedded/src/worker.rs:875— DatabaseSlot::run_one has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
sqlite_embedded::worker::run_command_inner (cyclomatic 20) engine/packages/sqlite-embedded/src/worker.rs:1646— sqlite_embedded::worker::run_command_inner 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.
rivetkit::start::handle_actor_event (cyclomatic 20) rivetkit-rust/packages/rivetkit/src/start.rs:346— rivetkit::start::handle_actor_event has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SqliteDb::release_transaction (cyclomatic 20) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs:1069— SqliteDb::release_transaction 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.
ActorConnection.handleClose (cyclomatic 20) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:757— ActorConnection.handleClose 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.
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.
rivet_api_public_shim::routes::fork_actor_inner (cyclomatic 19) engine/packages/api-public-shim/src/routes.rs:1416— rivet_api_public_shim::routes::fork_actor_inner 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.
Slot::open_filesystem_timed (cyclomatic 19) engine/packages/depot-client/src/volumes/slot.rs:523— Slot::open_filesystem_timed 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.
VersionFilter::filter (cyclomatic 19) engine/packages/depot-worker/src/filesystem/filter.rs:391— VersionFilter::filter 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.
LoadedVolume::row (cyclomatic 19) engine/packages/depot-worker/src/tablet_maintainer_machine/state/mod.rs:187— LoadedVolume::row 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 is NOT this file's highest cyclomatic complexity: depot_worker::tablet_maintainer_machine::state::store_operation_name (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
epoxy::key_machine::accept (cyclomatic 19) engine/packages/epoxy/src/key_machine/mod.rs:222— epoxy::key_machine::accept 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.
sqlite_prefetch::driver::read (cyclomatic 19) engine/packages/sqlite-prefetch/src/driver.rs:58— sqlite_prefetch::driver::read 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.
SqliteProfilingMetrics::from (cyclomatic 19) rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:153— SqliteProfilingMetrics::from 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.
ActorHandleRaw.#sendActionAttempts (cyclomatic 19) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:357— 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.
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.
Address::parse (cyclomatic 18) engine/packages/api-peer/src/volumes/address.rs:20— Address::parse has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
RingExecutor::execute (cyclomatic 18) engine/packages/auth-jwt/src/key_ring_machine/executor.rs:41— RingExecutor::execute 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.
rivet_cli::util::build_resources (cyclomatic 18) engine/packages/cli/src/util.rs:53— 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.
VolumeHandle::read_committed (cyclomatic 18) engine/packages/depot-volume/src/volume_client_machine/runner.rs:313— VolumeHandle::read_committed 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.
rivet_service_manager::start (cyclomatic 18) engine/packages/service-manager/src/lib.rs:227— rivet_service_manager::start 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.
V3Tracker::record_and_plan (cyclomatic 18) engine/packages/sqlite-prefetch/src/harness/readahead.rs:431— V3Tracker::record_and_plan 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.
Server::get_pages (cyclomatic 18) engine/packages/sqlite-prefetch/src/harness/server.rs:202— Server::get_pages 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.
EngineProcessManager::start_resolved (cyclomatic 18) rivetkit-rust/packages/engine-process/src/lib.rs:160— EngineProcessManager::start_resolved 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.
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.
ActorHandleRaw.#fetchWithResolvedActor (cyclomatic 18) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:750— 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.
Opts::execute (cyclomatic 17) engine/packages/cli/src/commands/api.rs:76— Opts::execute 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.
AlarmManifestState::apply (cyclomatic 17) engine/packages/depot-worker/src/tablet_coordinator_machine/state/alarms.rs:44— AlarmManifestState::apply 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.
CoreRegistry::serve_with_config_and_handle_observer (cyclomatic 17) rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs:623— CoreRegistry::serve_with_config_and_handle_observer 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:1125— 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.
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.
Cache::ring (cyclomatic 16) engine/packages/auth-jwt/src/runtime.rs:121— Cache::ring 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.
LeafPayloads::miss (cyclomatic 16) engine/packages/sqlite-prefetch/src/payloads.rs:124— LeafPayloads::miss has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
utils.sendHttpRequest (cyclomatic 16) rivetkit-typescript/packages/rivetkit/src/client/utils.ts:110— utils.sendHttpRequest has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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.createClient (cyclomatic 16) rivetkit-typescript/packages/rivetkit/src/db/drizzle.ts:99— drizzle.db.createClient has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (warnForManualTransaction, createDrizzleClient::runSql, a function literal at line 199, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
HackComment rivetkit-typescript/packages/rivetkit/src/utils/router.ts:27— // HACK: Add Sec-WebSocket-Protocol header to fix KIT-339 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
ActorStateMachine::on_event (cognitive 174) engine/packages/pegboard/src/actor_machine/mod.rs:83— ActorStateMachine::on_event has cognitive complexity 174 (threshold 15). Drivers by points: if/else 39 (116 pts), match/switch 21 (51 pts), boolean chains 7 (nesting depth added 107). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaintainerExecutor::execute (cognitive 147) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1576— MaintainerExecutor::execute has cognitive complexity 147 (threshold 15). Drivers by points: if/else 68 (122 pts), match/switch 7 (13 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 65). 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.
VfsContext::resolve_pages (cognitive 113) engine/packages/sqlite-embedded/src/vfs/transport.rs:1663— VfsContext::resolve_pages has cognitive complexity 113 (threshold 15). Drivers by points: if/else 41 (90 pts), loops 6 (13 pts), match/switch 3 (7 pts), boolean chains 3 (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.
WorkflowContextImpl.executeRace (cognitive 93) rivetkit-typescript/packages/workflow-engine/src/context.ts:2380— WorkflowContextImpl.executeRace has cognitive complexity 93 (threshold 15). Drivers by points: if/else 35 (65 pts), boolean chains 13, loops 6 (10 pts), error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 37). Of this number, 72 points are the body's own statements and 21 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Maintainer::start_with_alarms (cognitive 92) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:309— Maintainer::start_with_alarms has cognitive complexity 92 (threshold 15). Drivers by points: if/else 34 (74 pts), boolean chains 7, loops 4 (6 pts), match/switch 2 (5 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestExecutor::execute (cognitive 81) engine/packages/depot-worker/src/tablet_coordinator_machine/runner.rs:495— ManifestExecutor::execute has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (54 pts), loops 5 (10 pts), boolean chains 9, match/switch 5 (8 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native.buildNativeFactory::maybeHandleNativeInspectorRequest (cognitive 80) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4266— native.buildNativeFactory::maybeHandleNativeInspectorRequest has cognitive complexity 80 (threshold 15). Drivers by points: if/else 25 (33 pts), boolean chains 23, ternaries 7 (13 pts), error handling 5 (9 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (native.buildNativeFactory) 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.
OperationIndex::apply (cognitive 78) engine/packages/depot-worker/src/tablet_maintainer_machine/state/operations.rs:279— OperationIndex::apply has cognitive complexity 78 (threshold 15). Drivers by points: if/else 31 (63 pts), loops 5 (9 pts), match/switch 4 (6 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SingletonCoordinator::on_event (cognitive 76) engine/packages/singleton-coordinator/src/singleton_coordinator_machine/mod.rs:93— SingletonCoordinator::on_event has cognitive complexity 76 (threshold 15). Drivers by points: if/else 34 (66 pts), boolean chains 8, match/switch 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Executor::execute (cognitive 69) engine/packages/pegboard/src/actor_machine/executor.rs:1411— Executor::execute has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (53 pts), match/switch 8 (14 pts), boolean chains 2 (nesting depth added 33). 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::process_attempt (cognitive 57) engine/packages/state-machine-durable/src/runner.rs:92— Runner::process_attempt has cognitive complexity 57 (threshold 15). Drivers by points: loops 12 (20 pts), match/switch 9 (20 pts), if/else 8 (13 pts), boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowContextImpl.executeLoop (cognitive 56) rivetkit-typescript/packages/workflow-engine/src/context.ts:1291— WorkflowContextImpl.executeLoop has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (47 pts), boolean chains 6, ternaries 1 (2 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.
TopologyExecutor::execute (cognitive 50) engine/packages/topology/src/topology_machine/executor.rs:75— TopologyExecutor::execute has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 10 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorConnRaw.#handleOnClose (cognitive 50) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:979— ActorConnRaw.#handleOnClose has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 7, ternaries 2 (6 pts), error handling 1 (4 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TabletMaintainerMachine::on_event (cognitive 49) engine/packages/depot-worker/src/tablet_maintainer_machine/mod.rs:286— TabletMaintainerMachine::on_event has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (44 pts), match/switch 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.
Acquire::run (cognitive 48) engine/packages/pegboard-gateway/src/acquire.rs:329— Acquire::run has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 11 (29 pts), if/else 6 (17 pts), boolean chains 1, loops 1 (nesting depth added 29). 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.
TabletCoordinatorMachine::on_event (cognitive 47) engine/packages/depot-worker/src/tablet_coordinator_machine/mod.rs:65— TabletCoordinatorMachine::on_event has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 2, 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.
Client::command_with (cognitive 43) engine/packages/depot-client/src/command.rs:182— Client::command_with has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 9, match/switch 4 (8 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
Search::replacement (cognitive 41) engine/packages/depot-worker/src/tablet_coordinator_machine/placement.rs:563— Search::replacement has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 25, if/else 16. 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.
MigratorStateMachine::on_event (cognitive 40) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:191— MigratorStateMachine::on_event has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowContextImpl.executeStep (cognitive 40) rivetkit-typescript/packages/workflow-engine/src/context.ts:905— WorkflowContextImpl.executeStep has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 4 (8 pts), boolean chains 3, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_service_manager::start (cognitive 38) engine/packages/service-manager/src/lib.rs:227— rivet_service_manager::start has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 5 (8 pts), match/switch 3 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
Transaction::scan (cognitive 37) engine/packages/depot-client/src/filesystem/transaction.rs:776— Transaction::scan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (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.
Config::apply_dynamic (cognitive 36) engine/packages/config/src/lib.rs:218— Config::apply_dynamic has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 4 (11 pts), loops 3 (7 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.
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.
Pegboard::validate (cognitive 34) engine/packages/config/src/config/pegboard.rs:207— Pegboard::validate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 3, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
rivet_engine_context::production::object_storage::build_object_store (cognitive 34) engine/packages/engine-context/src/production/object_storage.rs:129— rivet_engine_context::production::object_storage::build_object_store has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
storage.flushSnapshot (cognitive 34) rivetkit-typescript/packages/workflow-engine/src/storage.ts:292— storage.flushSnapshot has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 8 (12 pts), boolean chains 4, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
depot_client::volumes::owner::run (cognitive 33) engine/packages/depot-client/src/volumes/owner.rs:200— depot_client::volumes::owner::run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (6 pts), match/switch 2 (4 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.
ActorConnection.handleClose (cognitive 33) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:757— ActorConnection.handleClose has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivet_runtime::build_tokio_runtime_builder (cognitive 32) engine/packages/runtime/src/lib.rs:78— rivet_runtime::build_tokio_runtime_builder has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (12 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.
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.
ScanDetector::miss (cognitive 31) engine/packages/sqlite-prefetch/src/scan.rs:182— ScanDetector::miss has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ActorHandleRaw.#sendActionAttempts (cognitive 31) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:357— 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.
RequestExecutor::request (cognitive 28) engine/packages/depot-volume/src/volume_client_machine/executor/requests.rs:31— RequestExecutor::request has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 4 (5 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.
ActorHandleRaw.#fetchWithResolvedActor (cognitive 28) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:750— 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.
ActorConnRaw.#sendMessage (cognitive 28) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:1395— 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.
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.
DepotConfig::validate (cognitive 27) engine/packages/config/src/config/depot.rs:303— DepotConfig::validate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Root::validate_and_set_defaults (cognitive 27) engine/packages/config/src/config/mod.rs:192— Root::validate_and_set_defaults has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (8 pts), match/switch 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.
TopologyStateMachine::on_event (cognitive 27) engine/packages/topology/src/topology_machine/mod.rs:155— TopologyStateMachine::on_event has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, match/switch 3 (7 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.
ActorConnRaw.#handleOnMessage (cognitive 27) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:836— ActorConnRaw.#handleOnMessage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, ternaries 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_alloc_count::sites::report (cognitive 26) engine/packages/alloc-count/src/sites.rs:125— rivet_alloc_count::sites::report has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cache::ring (cognitive 26) engine/packages/auth-jwt/src/runtime.rs:121— Cache::ring has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqlite_embedded_filesystem::page_protocol::stage::execute (cognitive 26) engine/packages/sqlite-embedded-filesystem/src/page_protocol/stage.rs:23— sqlite_embedded_filesystem::page_protocol::stage::execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (5 pts), match/switch 2 (4 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
native.buildNativeFactory (cognitive 26) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4159— native.buildNativeFactory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 52 (69 pts), ternaries 40 (57 pts), boolean chains 34, error handling 8 (14 pts), loops 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (native.buildNativeFactory::maybeHandleNativeInspectorRequest) 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.
WorkflowContextImpl.executeJoin (cognitive 26) rivetkit-typescript/packages/workflow-engine/src/context.ts:2165— 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.
ActiveActorCountChanges::next (cognitive 25) rivetkit-rust/packages/rivetkit-core/src/registry/serving_envoy.rs:72— ActiveActorCountChanges::next has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.sendHttpRequest (cognitive 25) rivetkit-typescript/packages/rivetkit/src/client/utils.ts:110— utils.sendHttpRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (8 pts), error handling 3 (4 pts), boolean chains 1 (nesting depth added 10). Of this number, 19 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.
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). None of this is in the body itself: all 25 points belong 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.
NativeDatabase::drop (cognitive 24) engine/packages/sqlite-embedded/src/vfs/transport.rs:4050— NativeDatabase::drop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (9 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.
AlarmManifestState::apply (cognitive 23) engine/packages/depot-worker/src/tablet_coordinator_machine/state/alarms.rs:44— AlarmManifestState::apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 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.
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.
ActorHandleRaw.#sendQueueMessage (cognitive 23) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:161— ActorHandleRaw.#sendQueueMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 12). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 166). 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.
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.
ClusterConfigStateMachine::on_event (cognitive 22) engine/packages/cluster-config/src/cluster_config_machine/mod.rs:80— ClusterConfigStateMachine::on_event has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 5 (10 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VolumeHandle::read_committed (cognitive 22) engine/packages/depot-volume/src/volume_client_machine/runner.rs:313— VolumeHandle::read_committed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, 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.
VersionFilter::filter (cognitive 22) engine/packages/depot-worker/src/filesystem/filter.rs:391— VersionFilter::filter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
epoxy::key_machine::accept (cognitive 22) engine/packages/epoxy/src/key_machine/mod.rs:222— epoxy::key_machine::accept has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
V3Tracker::record_and_plan (cognitive 22) engine/packages/sqlite-prefetch/src/harness/readahead.rs:431— V3Tracker::record_and_plan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
RowCache::install (cognitive 21) engine/packages/depot-client/src/filesystem/cache.rs:855— RowCache::install has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WaitGuard::notified (cognitive 21) engine/packages/pegboard-gateway/src/start_waits.rs:303— WaitGuard::notified has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 2 (6 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PoolShared::next_task (cognitive 21) engine/packages/sqlite-embedded/src/worker.rs:683— PoolShared::next_task has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegacyPrefixScan::next_page (cognitive 21) rivetkit-rust/packages/rivetkit-core/src/actor/migrate_kv_to_sqlite/mod.rs:543— 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.
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.
RingExecutor::execute (cognitive 20) engine/packages/auth-jwt/src/key_ring_machine/executor.rs:41— RingExecutor::execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Postimages::scan (cognitive 20) engine/packages/depot-client/src/filesystem/file_batch.rs:52— Postimages::scan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EngineProcessManager::start_resolved (cognitive 20) rivetkit-rust/packages/engine-process/src/lib.rs:160— EngineProcessManager::start_resolved has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 3 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ActorConfig::from_input (cognitive 20) rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:459— 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.
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:90— 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.
Opts::deploy_project (cognitive 19) engine/packages/cli/src/commands/deploy.rs:193— Opts::deploy_project has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoadedVolumeReplica::append_entries (cognitive 19) engine/packages/depot-log/src/log_shard_machine/state/loaded_volume_replica.rs:681— LoadedVolumeReplica::append_entries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 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, 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.
GroupRecordCache::apply (cognitive 19) engine/packages/depot-worker/src/group_events/records.rs:187— GroupRecordCache::apply has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3 (7 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.
ActorHandle::handle_inbound (cognitive 19) engine/packages/pegboard-envoy/src/connection.rs:2336— ActorHandle::handle_inbound has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, 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.
PubSub::drive_channel (cognitive 19) engine/packages/universalpubsub/src/pubsub/channel/client.rs:500— PubSub::drive_channel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rivetkit_shared_types::actor_key::slash::deserialize (cognitive 19) rivetkit-rust/packages/shared-types/src/actor_key/slash.rs:47— rivetkit_shared_types::actor_key::slash::deserialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lifecycle-errors.classifyActorError (cognitive 19) rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:57— lifecycle-errors.classifyActorError has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
actor-websocket-client.buildActorQueryGatewayUrl (cognitive 19) rivetkit-typescript/packages/rivetkit/src/engine-client/actor-websocket-client.ts:229— 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.
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_config::add_source (cognitive 18) engine/packages/config/src/lib.rs:363— 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.
rivet_env::backends::production::slatedb::remove_files_under (cognitive 18) engine/packages/env/src/backends/production/slatedb.rs:282— rivet_env::backends::production::slatedb::remove_files_under has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Chain::from_pages (cognitive 18) engine/packages/sqlite-prefetch/src/overflow/chain.rs:55— Chain::from_pages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, match/switch 1 (3 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.
universalpubsub::pubsub::channel::frame::batched (cognitive 18) engine/packages/universalpubsub/src/pubsub/channel/frame.rs:80— universalpubsub::pubsub::channel::frame::batched has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqliteProfilingMetrics::from (cognitive 18) rivetkit-rust/packages/rivetkit-core/src/actor/config.rs:153— SqliteProfilingMetrics::from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
index.RegistryConfigSchema (cognitive 18) rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:312— index.RegistryConfigSchema has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, 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.
ActorConnRaw.#setConnStatus (cognitive 18) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:434— 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.
Registry.handler (cognitive 18) REDACTED:241— 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 items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowContextImpl.executeTry (cognitive 18) rivetkit-typescript/packages/workflow-engine/src/context.ts:830— 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:1766— 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.
ClaimSnapshot::chunks (cognitive 17) engine/packages/depot-client/src/filesystem/remote.rs:609— ClaimSnapshot::chunks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResponseBody::poll_frame (cognitive 17) engine/packages/guard-core/src/response_body.rs:132— ResponseBody::poll_frame has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
V2Predictor::predict (cognitive 17) engine/packages/sqlite-prefetch/src/harness/readahead.rs:218— V2Predictor::predict has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorConnection.connectLoop (cognitive 17) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:423— ActorConnection.connectLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActionDispatcher.make (cognitive 17) rivetkit-typescript/packages/effect/src/internal/ActionDispatcher.ts:34— ActionDispatcher.make has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (6 pts), boolean chains 2 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 61, 85). 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.
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). None of this is in the body itself: all 17 points belong to 4 function items inside it that branch (run, a function literal at line 214, getWorkflowInspector, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Balancing::status (cognitive 16) engine/packages/depot-worker/src/tablet_coordinator_machine/state/balancing.rs:159— Balancing::status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
TooManyFunctions: sqlite_prefetch::harness::workloads REDACTED:25— TooManyFunctions — 32 free functions. The bar is 30 free functions; 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.
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 (4 members, 27 shared lines) · ×1
Near-duplicate member family (4 members, 27 shared lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:626— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:626-668 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:684-737 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:753-801 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:817-860 — These 4 members are variants of one another: a block of 27 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.
Near-duplicate member pair (90 shared lines) engine/packages/sqlite-embedded/src/vfs/transport.rs:2063— engine/packages/sqlite-embedded/src/vfs/transport.rs:2063-2201 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2215-2356 — These two members are variants of one another: 90 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 (71 shared lines) rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:197— rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:197-312 | rivetkit-rust/packages/rivetkit-core/src/registry/http.rs:319-456 — These two members are variants of one another: 71 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:905— engine/sdks/rust/envoy-client/src/handle.rs:905-939 | engine/sdks/rust/envoy-client/src/handle.rs:945-979 — 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· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) rivetkit-rust/packages/actor-persist/src/versioned.rs:71— rivetkit-rust/packages/actor-persist/src/versioned.rs:71-91 | rivetkit-rust/packages/actor-persist/src/versioned.rs:437-449 | rivetkit-rust/packages/client-protocol/src/versioned.rs:47-67 | rivetkit-rust/packages/client-protocol/src/versioned.rs:454-474 | rivetkit-rust/packages/client-protocol/src/versioned.rs:570-582 | rivetkit-rust/packages/client-protocol/src/versioned.rs:681-701 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:57-85 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:366-394 — These 8 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 8 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 8 times.
D4 · Code Duplication· Edited copy of a member (225 corresponding lines) · ×1
Edited copy of a member (225 corresponding lines) engine/packages/error-macros/src/lib.rs:17— engine/packages/error-macros/src/lib.rs:17-241 | engine/packages/error-macros/src/lib.rs:243-503 — These two members are one piece of code written twice and then edited apart: 225 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 55+ corresponding lines) · ×1
Edited copies of one member (4 members, 55+ corresponding lines) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:500— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:500-556 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:558-612 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:614-673 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:675-729 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 55 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (74 corresponding lines) · ×1
Edited copy of a member (74 corresponding lines) engine/packages/auth-jwt/src/persistence.rs:98— engine/packages/auth-jwt/src/persistence.rs:98-171 | engine/packages/auth-jwt/src/persistence.rs:177-260 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3335— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3335-3395 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3399-3458 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) engine/packages/auth-jwt/src/rotation.rs:147— engine/packages/auth-jwt/src/rotation.rs:147-211 | engine/packages/pegboard-v2-migrator/src/requests.rs:174-225 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) rivetkit-python/client/src/simple/async/handle.rs:120— rivetkit-python/client/src/simple/async/handle.rs:120-174 | rivetkit-python/client/src/simple/sync/handle.rs:110-160 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) engine/packages/engine/src/epoxy_services.rs:39— engine/packages/engine/src/epoxy_services.rs:39-87 | engine/packages/pegboard-v2-migrator/src/services/migrator.rs:51-91 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) engine/sdks/rust/envoy-client/src/stringify.rs:28— engine/sdks/rust/envoy-client/src/stringify.rs:28-93 | engine/sdks/rust/envoy-client/src/stringify.rs:95-158 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) rivetkit-rust/packages/inspector-protocol/src/versioned.rs:135— rivetkit-rust/packages/inspector-protocol/src/versioned.rs:135-166 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:266-295 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) rivetkit-rust/packages/actor-persist/src/versioned.rs:147— rivetkit-rust/packages/actor-persist/src/versioned.rs:147-195 | rivetkit-rust/packages/actor-persist/src/versioned.rs:295-341 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:306— rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:306-345 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:354-395 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 37+ corresponding lines) · ×1
Edited copies of one member (3 members, 37+ corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:376— rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:376-412 | rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:418-465 | rivetkit-rust/packages/rivetkit-core/src/actor/queue.rs:471-516 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) engine/packages/engine/src/depot_peer.rs:16— engine/packages/engine/src/depot_peer.rs:16-61 | engine/packages/engine/src/depot_peer.rs:80-123 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 31+ corresponding lines) · ×1
Edited copies of one member (4 members, 31+ corresponding lines) rivetkit-rust/packages/client-protocol/src/versioned.rs:76— rivetkit-rust/packages/client-protocol/src/versioned.rs:76-106 | rivetkit-rust/packages/client-protocol/src/versioned.rs:115-146 | rivetkit-rust/packages/client-protocol/src/versioned.rs:148-178 | rivetkit-rust/packages/client-protocol/src/versioned.rs:187-218 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) engine/packages/state-machine-durable/src/runner.rs:523— engine/packages/state-machine-durable/src/runner.rs:523-549 | engine/packages/state-machine-durable/src/runner.rs:560-586 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) engine/sdks/rust/envoy-client/src/connection/wasm.rs:344— engine/sdks/rust/envoy-client/src/connection/wasm.rs:344-360 | engine/sdks/rust/envoy-client/src/utils.rs:114-130 | rivetkit-rust/packages/rivetkit-core/src/lib.rs:66-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:1483— engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:1483-1515 | engine/packages/pegboard-v2-migrator/src/migrator_machine/mod.rs:1517-1561 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) engine/packages/api-public/src/actors/delete.rs:45— engine/packages/api-public/src/actors/delete.rs:45-69 | engine/packages/api-public/src/actors/kv_get.rs:41-69 | engine/packages/api-public/src/actors/reschedule.rs:47-72 | engine/packages/api-public/src/actors/sleep.rs:47-71 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:58— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:58-79 | rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:333-361 | rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:516-537 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) rivetkit-rust/packages/rivetkit-core/src/registry/envoy_callbacks.rs:260— rivetkit-rust/packages/rivetkit-core/src/registry/envoy_callbacks.rs:260-286 | rivetkit-typescript/packages/rivetkit-napi/src/registry.rs:906-936 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:145-171 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 22+ corresponding lines) · ×1
Edited copies of one member (4 members, 22+ corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1329— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1329-1350 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1356-1379 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1385-1407 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1448-1472 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 21+ corresponding lines) · ×1
Edited copies of one member (7 members, 21+ corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:264— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:264-284 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:299-321 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:301-323 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:305-327 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:324-346 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:328-350 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:328-350 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 17+ corresponding lines) · ×1
Edited copies of one member (6 members, 17+ corresponding lines) rivetkit-python/client/src/events/async/client.rs:42— rivetkit-python/client/src/events/async/client.rs:42-60 | rivetkit-python/client/src/events/async/client.rs:63-81 | rivetkit-python/client/src/events/async/client.rs:84-102 | rivetkit-python/client/src/simple/async/client.rs:42-58 | rivetkit-python/client/src/simple/async/client.rs:61-77 | rivetkit-python/client/src/simple/async/client.rs:80-96 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 15+ corresponding lines) · ×1
Edited copies of one member (8 members, 15+ corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:731— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:731-745 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:767-781 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:873-887 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:872-886 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:895-909 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:933-947 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:922-936 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:922-936 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:876— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:876-885 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:919-928 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:944-952 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:957-965 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×1
Edited copies of one member (5 members, 13+ corresponding lines) engine/packages/pegboard-envoy/src/sqlite/lane_transport.rs:105— engine/packages/pegboard-envoy/src/sqlite/lane_transport.rs:105-117 | engine/packages/pegboard-envoy/src/sqlite/lane_transport.rs:119-131 | engine/packages/pegboard-envoy/src/sqlite/lane_transport.rs:136-150 | engine/packages/pegboard-envoy/src/sqlite/lane_transport.rs:155-169 | engine/packages/pegboard-envoy/src/sqlite/lane_transport.rs:174-187 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) engine/packages/cli/src/cluster_env.rs:36— engine/packages/cli/src/cluster_env.rs:36-50 | engine/packages/pegboard/src/validation.rs:204-219 | engine/packages/pegboard/src/validation.rs:221-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:117— rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:117-124 | rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:132-139 | rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:152-159 | rivetkit-swift/Sources/RivetKitSwiftUI/ViewModifiers.swift:173-180 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 13+ corresponding lines) · ×1
Edited copies of one member (6 members, 13+ corresponding lines) rivetkit-python/client/src/events/sync/client.rs:39— rivetkit-python/client/src/events/sync/client.rs:39-51 | rivetkit-python/client/src/events/sync/client.rs:54-66 | rivetkit-python/client/src/events/sync/client.rs:69-81 | rivetkit-python/client/src/simple/sync/client.rs:39-52 | rivetkit-python/client/src/simple/sync/client.rs:55-67 | rivetkit-python/client/src/simple/sync/client.rs:70-82 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:465— engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:465-480 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:484-496 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1930-1945 | engine/sdks/rust/envoy-protocol/src/versioned/v8_v9.rs:1949-1961 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 10+ corresponding lines) · ×1
Edited copies of one member (6 members, 10+ corresponding lines) rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:578— rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:578-587 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:596-605 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:615-625 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:635-645 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:652-661 | rivetkit-typescript/packages/rivetkit-napi/src/actor_factory.rs:668-677 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1648— rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1648-1658 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1671-1682 | rivetkit-typescript/packages/rivetkit-wasm/src/lib.rs:1685-1695 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 13+ corresponding lines) · ×1
Edited copies of one member (8 members, 13+ corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:578— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:578-590 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:608-620 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:710-722 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:709-721 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:731-743 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:761-773 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:757-769 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:757-769 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1401— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1401-1407 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1523-1529 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1541-1550 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1552-1558 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:867— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:867-877 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:901-910 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1008-1018 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1058-1068 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:255— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:255-262 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:279-286 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:285-292 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:304-311 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:308-315 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:308-315 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 5+ corresponding lines) · ×1
Edited copies of one member (5 members, 5+ corresponding lines) rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1449— rivetkit-rust/packages/rivetkit-core/src/actor/internal_storage/mod.rs:1449-1454 | rivetkit-rust/packages/rivetkit-core/src/actor/schedule.rs:1459-1464 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:1972-1976 | rivetkit-rust/packages/rivetkit-core/src/registry/inspector.rs:710-714 | rivetkit-rust/packages/rivetkit/src/action.rs:46-51 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Duplicated block (40–43 lines × 2) engine/packages/sqlite-embedded/src/vfs/transport.rs:2104— engine/packages/sqlite-embedded/src/vfs/transport.rs:2104-2146 | engine/packages/sqlite-embedded/src/vfs/transport.rs:2260-2299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/vfs/transport.rs:2104` 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 (25–32 lines × 5) engine/packages/pegboard/src/actor_machine/mod.rs:161— engine/packages/pegboard/src/actor_machine/mod.rs:161-185 | engine/packages/pegboard/src/actor_machine/mod.rs:377-401 | engine/packages/pegboard/src/actor_machine/mod.rs:575-606 | engine/packages/pegboard/src/actor_machine/mod.rs:724-748 | engine/packages/pegboard/src/actor_machine/mod.rs:900-928 — 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 `engine/packages/pegboard/src/actor_machine/mod.rs:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/pegboard/src/actor_machine/mod.rs:929` calls `is_some`, `legacy_moving` and `engine/packages/pegboard/src/actor_machine/mod.rs:186` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (32 lines × 3) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3298— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3298-3329 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3361-3392 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3424-3455 — 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 (23–25 lines × 2) engine/packages/pegboard-v2-migrator/src/commands.rs:135— engine/packages/pegboard-v2-migrator/src/commands.rs:135-159 | engine/packages/pegboard-v2-migrator/src/commands.rs:183-205 — both copies are in the same file, so extract the block into 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–24 lines × 6) engine/packages/pegboard/src/actor_machine/mod.rs:322— engine/packages/pegboard/src/actor_machine/mod.rs:322-344 | engine/packages/pegboard/src/actor_machine/mod.rs:544-566 | engine/packages/pegboard/src/actor_machine/mod.rs:690-712 | engine/packages/pegboard/src/actor_machine/mod.rs:869-891 | engine/packages/pegboard/src/actor_machine/mod.rs:989-1011 | engine/packages/pegboard/src/actor_machine/mod.rs:1139-1162 — 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 `engine/packages/pegboard/src/actor_machine/mod.rs:322` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–24 lines × 2) engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:375— engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:375-396 | engine/packages/depot-volume/src/volume_client_machine/pipeline.rs:270-293 — before extracting anything, compare `engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs` and `engine/packages/depot-volume/src/volume_client_machine/pipeline.rs` as WHOLE FILES: this scan already matched 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-volume/src/volume_client_machine/lifecycle.rs:375` 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 (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 — before extracting anything, compare `engine/packages/api-public/src/actors/create.rs` and `engine/packages/api-public/src/actors/get_or_create.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `body` to `CreateRequest` in one and `GetOrCreateRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-python/client/src/simple/sync/handle.rs:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1649— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1649-1670 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1743-1765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1649` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–22 lines × 2) engine/packages/pegboard/src/legacy_backfill.rs:1515— engine/packages/pegboard/src/legacy_backfill.rs:1515-1536 | engine/packages/pegboard/src/legacy_backfill.rs:2835-2851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/legacy_backfill.rs:1515` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–22 lines × 2) engine/sdks/rust/envoy-client/src/actor/http.rs:871— engine/sdks/rust/envoy-client/src/actor/http.rs:871-892 | engine/sdks/rust/envoy-client/src/actor/http.rs:898-917 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/actor/http.rs:871` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) engine/packages/depot-worker/src/filesystem/session.rs:1666— engine/packages/depot-worker/src/filesystem/session.rs:1666-1686 | engine/packages/depot-worker/src/filesystem/session.rs:1750-1768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-worker/src/filesystem/session.rs:1665` calls `root_position`, `ok_or` and `engine/packages/depot-worker/src/filesystem/session.rs:1749` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20–21 lines × 2) rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:590— rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:590-610 | rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:667-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/state.rs:590` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–19 lines × 4) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1651— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1651-1666 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1690-1708 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1719-1736 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1755-1772 — 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-rust/packages/rivetkit-core/src/actor/metrics.rs:1690` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1737` calls `clone` and `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1666` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 6) rivetkit-rust/packages/actor-persist/src/versioned.rs:72— rivetkit-rust/packages/actor-persist/src/versioned.rs:72-88 | rivetkit-rust/packages/client-protocol/src/versioned.rs:48-64 | rivetkit-rust/packages/client-protocol/src/versioned.rs:455-471 | rivetkit-rust/packages/client-protocol/src/versioned.rs:682-698 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:58-74 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:367-383 — before extracting anything, compare `rivetkit-rust/packages/actor-persist/src/versioned.rs` and `rivetkit-rust/packages/client-protocol/src/versioned.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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/actor-persist/src/versioned.rs:72` 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 (17 lines × 4) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:647— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:647-663 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:716-732 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:780-796 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:839-855 — 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-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:647` 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 (17 lines × 3) engine/packages/pegboard/src/actor_machine/executor.rs:1416— engine/packages/pegboard/src/actor_machine/executor.rs:1416-1432 | engine/packages/pegboard/src/actor_machine/executor.rs:1482-1498 | engine/packages/pegboard/src/actor_machine/executor.rs:1901-1917 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/actor_machine/executor.rs:1416` 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–17 lines × 2) engine/packages/depot-worker/src/tablet_coordinator_machine/state/balancing.rs:519— engine/packages/depot-worker/src/tablet_coordinator_machine/state/balancing.rs:519-534 | engine/packages/depot-worker/src/tablet_coordinator_machine/state/stop.rs:66-82 — 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–17 lines × 2) engine/packages/sqlite-embedded/src/worker.rs:1662— engine/packages/sqlite-embedded/src/worker.rs:1662-1678 | engine/packages/sqlite-embedded/src/worker.rs:1733-1746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/worker.rs:1662` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15–16 lines × 3) engine/packages/depot-fs-core/src/txn.rs:374— engine/packages/depot-fs-core/src/txn.rs:374-388 | engine/packages/depot-fs-core/src/txn.rs:401-416 | engine/packages/depot-worker/src/filesystem/apply.rs:548-563 — 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 (15–16 lines × 2) rivetkit-rust/packages/engine-process/src/lib.rs:859— rivetkit-rust/packages/engine-process/src/lib.rs:859-873 | rivetkit-rust/packages/engine-process/src/lib.rs:884-899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–16 lines × 2) rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:194— rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:194-207 | rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:258-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/serverless_http.rs:194` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2393— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2393-2406 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2432-2445 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2472-2485 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2393` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–14 lines × 3) engine/packages/pegboard/src/actor_machine/mod.rs:513— engine/packages/pegboard/src/actor_machine/mod.rs:513-523 | engine/packages/pegboard/src/actor_machine/mod.rs:661-671 | engine/packages/pegboard/src/actor_machine/mod.rs:841-854 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/pegboard/src/actor_machine/mod.rs:513` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/packages/pegboard/src/actor_machine/mod.rs:676` calls `clone`, `stop_actor` and `engine/packages/pegboard/src/actor_machine/mod.rs:855` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–14 lines × 2) engine/packages/sqlite-embedded/src/worker.rs:1684— engine/packages/sqlite-embedded/src/worker.rs:1684-1697 | engine/packages/sqlite-embedded/src/worker.rs:1748-1758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/sqlite-embedded/src/worker.rs:1684` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 4) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1650— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1650-1662 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1718-1730 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1739-1751 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1754-1766 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1752` calls `register_metric`, `clone` and `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1663` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 3) engine/packages/topology/src/topology_machine/lease.rs:516— engine/packages/topology/src/topology_machine/lease.rs:516-527 | engine/packages/topology/src/topology_machine/lease.rs:634-645 | engine/packages/topology/src/topology_machine/publication.rs:169-181 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (34 lines × 2) engine/packages/error-macros/src/lib.rs:346— engine/packages/error-macros/src/lib.rs:346-379 | engine/packages/error-macros/src/lib.rs:436-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/error-macros/src/lib.rs:346` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) engine/sdks/rust/envoy-client/src/tunnel.rs:368— engine/sdks/rust/envoy-client/src/tunnel.rs:368-378 | engine/sdks/rust/envoy-client/src/tunnel.rs:398-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/tunnel.rs:368` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (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_pools/refresh_metadata.rs:75-86 — before extracting anything, compare `engine/packages/api-public/src/actors/create.rs` and `engine/packages/api-public/src/actors/get_or_create.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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/api-public/src/actors/create.rs:61` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `query` to `CreateQuery` in one and `GetOrCreateQuery` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10–12 lines × 2) engine/packages/depot-volume/src/ups/metrics.rs:61— engine/packages/depot-volume/src/ups/metrics.rs:61-72 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:3489-3498 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–12 lines × 2) engine/packages/depot-worker/src/filesystem/fork_references.rs:371— engine/packages/depot-worker/src/filesystem/fork_references.rs:371-382 | engine/packages/depot-worker/src/filesystem/fork_references.rs:647-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-worker/src/filesystem/fork_references.rs:371` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) engine/packages/pegboard/src/actor_machine/mod.rs:3553— engine/packages/pegboard/src/actor_machine/mod.rs:3553-3564 | engine/packages/pegboard/src/namespace_machine/mod.rs:755-765 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 6) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:919— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:919-929 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:918-928 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:941-951 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:979-989 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:968-978 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:968-978 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:919` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::EnvoyData` in one and `pegboard_actor_v3::EnvoyData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 5) rivetkit-rust/packages/actor-persist/src/versioned.rs:81— rivetkit-rust/packages/actor-persist/src/versioned.rs:81-91 | rivetkit-rust/packages/actor-persist/src/versioned.rs:439-449 | rivetkit-rust/packages/client-protocol/src/versioned.rs:57-67 | rivetkit-rust/packages/client-protocol/src/versioned.rs:464-474 | rivetkit-rust/packages/client-protocol/src/versioned.rs:572-582 — before extracting anything, compare `rivetkit-rust/packages/actor-persist/src/versioned.rs` and `rivetkit-rust/packages/client-protocol/src/versioned.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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/actor-persist/src/versioned.rs:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) engine/sdks/rust/envoy-client/src/tunnel.rs:366— engine/sdks/rust/envoy-client/src/tunnel.rs:366-376 | engine/sdks/rust/envoy-client/src/tunnel.rs:396-406 | engine/sdks/rust/envoy-client/src/tunnel.rs:678-687 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–10 lines × 4) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1168— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1168-1174 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1178-1184 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1669-1675 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1747-1756 — 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-rust/packages/rivetkit-core/src/actor/metrics.rs:1747` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1667` calls `register_metric`, `clone` and `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1747` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/error-macros/src/lib.rs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–10 lines × 3) rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1175— rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1175-1181 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1648-1656 | rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1751-1760 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/rivetkit-core/src/actor/metrics.rs:1648` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) engine/sdks/rust/envoy-client/src/connection/wasm.rs:352— engine/sdks/rust/envoy-client/src/connection/wasm.rs:352-360 | engine/sdks/rust/envoy-client/src/utils.rs:122-130 | rivetkit-rust/packages/rivetkit-core/src/lib.rs:74-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/connection/wasm.rs:352` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 7) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1714— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1714-1721 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1760-1767 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1846-1853 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1879-1886 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1915-1922 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1948-1955 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:2024-2031 — 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 `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1714` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1712` calls `clone` and `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1758` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 3) engine/packages/depot-client/src/filesystem/client.rs:1766— engine/packages/depot-client/src/filesystem/client.rs:1766-1773 | engine/packages/depot-client/src/filesystem/transaction.rs:433-439 | engine/packages/depot-client/src/filesystem/txn.rs:95-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/packages/depot-client/src/filesystem/client.rs:1766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:536— engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:536-543 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs:747-754 | engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs:586-593 — before extracting anything, compare `engine/packages/depot-worker/src/tablet_maintainer_machine/state/footprint.rs` and `engine/packages/depot-worker/src/tablet_maintainer_machine/state/store.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 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–8 lines × 2) engine/sdks/rust/envoy-client/src/tunnel.rs:819— engine/sdks/rust/envoy-client/src/tunnel.rs:819-826 | engine/sdks/rust/envoy-client/src/tunnel.rs:842-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/tunnel.rs:819` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) engine/packages/pegboard/src/commands.rs:519— engine/packages/pegboard/src/commands.rs:519-524 | engine/packages/pegboard/src/commands.rs:541-547 — both copies are in the same file, so extract the block into 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–12 lines × 4) rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:628— rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:628-637 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:685-696 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:754-765 | rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:818-829 — 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-rust/packages/rivetkit-core/src/actor/sqlite/mod.rs:628` 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 (30 lines × 3) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:210— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:210-239 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:212-241 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:216-245 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::ActorPhase` in one and `pegboard_actor_v3::ActorPhase` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (53 lines × 6) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:594— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:594-646 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:593-645 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:615-667 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:639-691 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:638-690 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:638-690 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:594` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::ActorEvent` in one and `pegboard_actor_v3::ActorEvent` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (45 lines × 4) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:394— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:394-438 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:413-457 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:417-461 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:417-461 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v3::ActorTimer` in one and `pegboard_actor_v4::ActorTimer` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (33 lines × 2) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:236— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:236-268 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:236-268 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v4::ActorPhase` in one and `pegboard_actor_v5::ActorPhase` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 24) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:54— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:54-60 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:161-167 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:243-249 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:54-60 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:161-167 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:245-251 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:54-60 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:169-175 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:269-275 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:56-62 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:171-177 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:271-277 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:56-62 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:171-177 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:275-281 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:62-68 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:177-183 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:294-300 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:56-62 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:171-177 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:298-304 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:56-62 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:171-177 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:298-304 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::ReserveEpoxyState` in one and `pegboard_actor_v1::DestroyState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 10) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:64— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:64-71 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:253-260 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:64-71 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:64-71 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:66-73 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:281-288 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:66-73 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:72-79 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:66-73 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:66-73 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::ReserveEpoxyEffectData` in one and `pegboard_actor_v1::WriteIndexEffectData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:107— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:107-117 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:107-117 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:107-117 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:109-119 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:109-119 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:115-125 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:109-119 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:109-119 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::Initializing` in one and `pegboard_actor_v2::Initializing` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 9) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:145— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:145-157 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:227-239 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:145-157 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:153-165 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:155-167 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:155-167 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:161-173 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:155-167 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:155-167 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::DestroyPhase` in one and `pegboard_actor_v1::WriteIndexPhase` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 8) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:372— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:372-379 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:393-400 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:434-441 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:433-440 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:454-461 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:473-480 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:477-484 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:477-484 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:372` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::TryStart` in one and `pegboard_actor_v2::TryStart` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 32) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:922— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:922-931 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:941-950 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1016-1025 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:1160-1169 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:954-963 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:973-982 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:1048-1057 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs:1192-1201 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1064-1073 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1083-1092 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1158-1167 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:1302-1311 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1063-1072 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1082-1091 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1157-1166 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:1301-1310 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1086-1095 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1105-1114 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1180-1189 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:1324-1333 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1124-1133 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1143-1152 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1218-1227 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:1362-1371 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1113-1122 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1132-1141 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1207-1216 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:1351-1360 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1113-1122 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1132-1141 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1207-1216 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:1351-1360 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v1_to_pegboard_actor_v2.rs:922` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v1::IndexListActiveEnvoysResponse` in one and `pegboard_actor_v1::IndexListActiveEnvoyStatesResponse` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 6) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:197— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:197-206 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:199-208 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:203-212 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:216-225 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:223-232 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:223-232 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::MigratingFromV2` in one and `pegboard_actor_v3::MigratingFromV2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 6) engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:290— engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:290-295 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs:292-297 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v4.rs:296-301 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v3.rs:315-320 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v4_to_pegboard_actor_v5.rs:319-324 | engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v5_to_pegboard_actor_v4.rs:319-324 — before extracting anything, compare `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs` and `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v3_to_pegboard_actor_v2.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/data/src/versioned/pegboard_actor/pegboard_actor_v2_to_pegboard_actor_v3.rs:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `pegboard_actor_v2::StorageOrigin` in one and `pegboard_actor_v3::StorageOrigin` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 3) engine/sdks/rust/envoy-client/src/actor.rs:1053— engine/sdks/rust/envoy-client/src/actor.rs:1053-1067 | engine/sdks/rust/envoy-client/src/actor.rs:1251-1265 | engine/sdks/rust/envoy-client/src/actor.rs:1275-1289 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/sdks/rust/envoy-client/src/actor.rs:1053` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/sdks/rust/envoy-client/src/actor.rs:1268` calls `remove` and `engine/sdks/rust/envoy-client/src/actor.rs:1290` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1855— engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1855-1863 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1888-1896 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1924-1932 | engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1957-1965 — 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 `engine/packages/depot-worker/src/tablet_maintainer_machine/runner.rs:1855` 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 (4–7 lines × 6) rivetkit-rust/packages/actor-persist/src/versioned.rs:53— rivetkit-rust/packages/actor-persist/src/versioned.rs:53-56 | rivetkit-rust/packages/client-protocol/src/versioned.rs:35-41 | rivetkit-rust/packages/client-protocol/src/versioned.rs:438-441 | rivetkit-rust/packages/client-protocol/src/versioned.rs:669-675 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:40-43 | rivetkit-rust/packages/inspector-protocol/src/versioned.rs:349-352 — before extracting anything, compare `rivetkit-rust/packages/actor-persist/src/versioned.rs` and `rivetkit-rust/packages/client-protocol/src/versioned.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. Read the line range as the matched WINDOW rather than a finished unit: at `rivetkit-rust/packages/actor-persist/src/versioned.rs:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rivetkit-rust/packages/client-protocol/src/versioned.rs:33` calls `Ok`, `V1`, `decode` and `rivetkit-rust/packages/actor-persist/src/versioned.rs:53` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) engine/packages/depot-client/src/filesystem/client.rs:1017— engine/packages/depot-client/src/filesystem/client.rs:1017-1021 | engine/packages/depot-client/src/filesystem/client.rs:1044-1048 | engine/packages/depot-client/src/filesystem/txn.rs:249-253 — 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 (16 lines × 5) rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:134— rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:134-149 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:183-198 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:209-224 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:240-255 | rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift:272-287 — 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:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (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.
End-of-life runtime: Node.js 20 rivetkit-typescript/packages/rivetkit-napi/package.json:15— rivetkit-typescript/packages/rivetkit-napi/package.json declares Node.js 20 as this project's engines.node, and Node.js 20, support ended 2026-04-30. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-04-30 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
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.
Sync-over-async blocking rivetkit-typescript/packages/sql-loader/src/hook.ts:10— `readFileSync` in `LoadHook` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Duplication concentrated across 10 sibling directories (14 clone groups) REDACTED:18— 14 duplicated blocks under rivetkit-typescript/packages/rivetkit/src/ have copies in at least two of the sibling directories actor, client, common, db, engine-api, engine-client (+4 more sibling(s) not listed) — 7 of them are reported below, and 7 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 6 sibling directories (12 clone groups) rivetkit-typescript/packages/traces/scripts/compile-bare.ts:12— 12 duplicated blocks under rivetkit-typescript/packages/ have copies in at least two of the sibling directories cli, effect, engine-cli, rivetkit, traces, workflow-engine — 8 of them are reported below, and 4 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.
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.
R10 · Code Duplication· Duplicated block with local edits (110 matched lines × 2 locations) · ×1
Duplicated block with local edits (110 matched lines × 2 locations) rivetkit-typescript/packages/workflow-engine/src/context.ts:2153— rivetkit-typescript/packages/workflow-engine/src/context.ts:2153 · rivetkit-typescript/packages/workflow-engine/src/context.ts:2368 — the two spans are one implementation copied and then locally edited — 541 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 (108 matched lines × 2 locations) · ×1
Duplicated block with local edits (108 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:484— rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:484 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:381 — the two spans are one implementation copied and then locally edited — 412 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (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.
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 (67 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2080— rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2080 · rivetkit-typescript/packages/rivetkit/src/actor/config.ts:2180 — 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 (54 matched lines × 2 locations) · ×1
Duplicated block with local edits (54 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:5724— rivetkit-typescript/packages/rivetkit/src/registry/native.ts:5724 · rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:898 — the two spans are one implementation copied and then locally edited — 245 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 (53 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:239— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:239 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
R10 · Code Duplication· Duplicated block with local edits (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:1001— rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:1001 · rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:960 — the two spans are one implementation copied and then locally edited — 281 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 (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:216— rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:216 · rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:97 — the two spans are one implementation copied and then locally edited — 236 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:260— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:260 · 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 (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 (34 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:145— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:145 · rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:180 — 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 (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 (28 lines × 24 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 · +20 more site(s) not listed — all 24 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:976— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:976 · rivetkit-typescript/packages/rivetkit/src/client/utils.ts:196 — 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.
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 (24 lines × 3 locations) integrations/workflow-world/src/actors/workflow-run.ts:896— integrations/workflow-world/src/actors/workflow-run.ts:896 · integrations/workflow-world/src/actors/workflow-run.ts:929 · integrations/workflow-world/src/actors/workflow-run.ts:962 — 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 (24 lines × 2 locations) rivetkit-typescript/packages/rivetkit/src/utils.ts:230— rivetkit-typescript/packages/rivetkit/src/utils.ts:230 · rivetkit-typescript/packages/workflow-engine/src/utils.ts:16 — 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 (23 lines × 2 locations) rivetkit-typescript/packages/effect/src/State.ts:291— rivetkit-typescript/packages/effect/src/State.ts:291 · rivetkit-typescript/packages/effect/src/State.ts:395 — 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 (22 lines × 4 locations) rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:209— rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:209 · rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:251 · rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:361 · rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:415 — 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.
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:4274— (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 executeRace (cyclomatic 45, cognitive 73) rivetkit-typescript/packages/workflow-engine/src/context.ts:2380— executeRace has cyclomatic complexity 45 and cognitive complexity 73; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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 bumpPackageJsons (cyclomatic 36, cognitive 83) scripts/publish/src/lib/version.ts:197— bumpPackageJsons has cyclomatic complexity 36 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 35, cognitive 58) rivetkit-typescript/packages/workflow-engine/src/context.ts:1291— executeLoop has cyclomatic complexity 35 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeStep (cyclomatic 34, cognitive 50) rivetkit-typescript/packages/workflow-engine/src/context.ts:905— executeStep has cyclomatic complexity 34 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 (anonymous) (cyclomatic 31, cognitive 28) rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:312— (anonymous) has cyclomatic complexity 31 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildNativeFactory (cyclomatic 30, cognitive 27) rivetkit-typescript/packages/rivetkit/src/registry/native.ts:4159— buildNativeFactory has cyclomatic complexity 30 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 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 #handleOnClose (cyclomatic 26, cognitive 54) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:979— #handleOnClose has cyclomatic complexity 26 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 flushSnapshot (cyclomatic 26, cognitive 34) rivetkit-typescript/packages/workflow-engine/src/storage.ts:292— flushSnapshot has cyclomatic complexity 26 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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) REDACTED: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 classifyActorError (cyclomatic 23, cognitive 19) rivetkit-typescript/packages/rivetkit/src/client/lifecycle-errors.ts:57— classifyActorError has cyclomatic complexity 23 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function publishAll (cyclomatic 21, cognitive 19) scripts/publish/src/lib/npm.ts:321— publishAll has cyclomatic complexity 21 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 20, cognitive 25) · ×1
Complex function main (cyclomatic 20, cognitive 25) scripts/publish/src/local/cut-release.ts:75— main has cyclomatic complexity 20 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function #sendActionAttempts (cyclomatic 19, cognitive 33) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:357— #sendActionAttempts has cyclomatic complexity 19 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 reviveJsonCompatValue (cyclomatic 19, cognitive 33) rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:377— reviveJsonCompatValue has cyclomatic complexity 19 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 #fetchWithResolvedActor (cyclomatic 19, cognitive 31) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:750— #fetchWithResolvedActor has cyclomatic complexity 19 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function resolveContext (cyclomatic 19, cognitive 22) scripts/publish/src/lib/context.ts:190— resolveContext has cyclomatic complexity 19 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (top-level) (cyclomatic 19, cognitive 18) rivetkit-typescript/packages/rivetkit/src/actor/contexts/index.ts:1— (top-level) has cyclomatic complexity 19 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.
Complex function bumpExampleLockfile (cyclomatic 17, cognitive 37) scripts/publish/src/lib/version.ts:472— bumpExampleLockfile has cyclomatic complexity 17 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 #dispatch (cyclomatic 17, cognitive 28) shared/typescript/virtual-websocket/src/virtual-websocket.ts:250— #dispatch has cyclomatic complexity 17 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeQueueNextBatch (cyclomatic 17, cognitive 20) rivetkit-typescript/packages/workflow-engine/src/context.ts:1766— executeQueueNextBatch has cyclomatic complexity 17 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 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 executeLiveWorkflow (cyclomatic 16, cognitive 41) rivetkit-typescript/packages/workflow-engine/src/index.ts:511— executeLiveWorkflow has cyclomatic complexity 16 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function anyValueFromJs (cyclomatic 16, cognitive 20) rivetkit-typescript/packages/traces/src/otlp.ts:122— anyValueFromJs has cyclomatic complexity 16 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 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 executeRollback (cyclomatic 15, cognitive 29) rivetkit-typescript/packages/workflow-engine/src/index.ts:289— executeRollback has cyclomatic complexity 15 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 #handleOnMessage (cyclomatic 15, cognitive 27) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:836— #handleOnMessage has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function sendHttpRequest (cyclomatic 15, cognitive 22) rivetkit-typescript/packages/rivetkit/src/client/utils.ts:110— sendHttpRequest has cyclomatic complexity 15 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function discoverPackages (cyclomatic 15, cognitive 21) scripts/publish/src/lib/packages.ts:124— discoverPackages has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 reconcileSubmissions (cyclomatic 15, cognitive 20) integrations/flue-runtime/src/agent-coordinator.ts:238— reconcileSubmissions has cyclomatic complexity 15 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 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 buildActorQueryGatewayUrl (cyclomatic 15, cognitive 20) rivetkit-typescript/packages/rivetkit/src/engine-client/actor-websocket-client.ts:229— buildActorQueryGatewayUrl has cyclomatic complexity 15 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 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 15, cognitive 17) rivetkit-typescript/packages/workflow-engine/src/context.ts:2570— (anonymous) has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 rawHttpFetch (cyclomatic 15, cognitive 16) rivetkit-typescript/packages/rivetkit/src/client/raw-utils.ts:34— rawHttpFetch has cyclomatic complexity 15 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function #shouldRetryConnectionOpenError (cyclomatic 15, cognitive 12) rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:626— #shouldRetryConnectionOpenError has cyclomatic complexity 15 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 (anonymous) (cyclomatic 14, cognitive 25) rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:166— (anonymous) has cyclomatic complexity 14 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function deserializeActorKey (cyclomatic 14, cognitive 21) rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:90— deserializeActorKey has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 configureServerlessPool (cyclomatic 14, cognitive 18) rivetkit-typescript/packages/rivetkit/src/serverless/configure.ts:32— configureServerlessPool has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/registry/native.ts · ×1
rivetkit-typescript/packages/rivetkit/src/registry/native.ts: 5487 lines of code rivetkit-typescript/packages/rivetkit/src/registry/native.ts:1— rivetkit-typescript/packages/rivetkit/src/registry/native.ts has 5487 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/workflow-engine/src/context.ts · ×1
rivetkit-typescript/packages/workflow-engine/src/context.ts: 2624 lines of code rivetkit-typescript/packages/workflow-engine/src/context.ts:1— rivetkit-typescript/packages/workflow-engine/src/context.ts has 2624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/actor/config.ts · ×1
rivetkit-typescript/packages/rivetkit/src/actor/config.ts: 2438 lines of code rivetkit-typescript/packages/rivetkit/src/actor/config.ts:1— rivetkit-typescript/packages/rivetkit/src/actor/config.ts has 2438 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts · ×1
rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts: 1589 lines of code rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:1— rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts has 1589 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· integrations/workflow-world/src/actors/workflow-run.ts · ×1
integrations/workflow-world/src/actors/workflow-run.ts: 1433 lines of code integrations/workflow-world/src/actors/workflow-run.ts:1— integrations/workflow-world/src/actors/workflow-run.ts has 1433 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts · ×1
rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts: 1169 lines of code rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts:1— rivetkit-typescript/packages/rivetkit/src/registry/napi-runtime.ts has 1169 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts · ×1
rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts: 1168 lines of code rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts:1— rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts has 1168 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1159 lines of code REDACTED:1— REDACTED has 1159 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/effect/src/RivetError.ts · ×1
rivetkit-typescript/packages/effect/src/RivetError.ts: 1152 lines of code rivetkit-typescript/packages/effect/src/RivetError.ts:1— rivetkit-typescript/packages/effect/src/RivetError.ts has 1152 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/traces/src/traces.ts · ×1
rivetkit-typescript/packages/traces/src/traces.ts: 1137 lines of code rivetkit-typescript/packages/traces/src/traces.ts:1— rivetkit-typescript/packages/traces/src/traces.ts has 1137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/workflow/context.ts · ×1
rivetkit-typescript/packages/rivetkit/src/workflow/context.ts: 1089 lines of code rivetkit-typescript/packages/rivetkit/src/workflow/context.ts:1— rivetkit-typescript/packages/rivetkit/src/workflow/context.ts has 1089 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts · ×1
rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts: 1061 lines of code rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts:1— rivetkit-typescript/packages/rivetkit/src/client/actor-handle.ts has 1061 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/workflow-engine/src/index.ts · ×1
rivetkit-typescript/packages/workflow-engine/src/index.ts: 1057 lines of code rivetkit-typescript/packages/workflow-engine/src/index.ts:1— rivetkit-typescript/packages/workflow-engine/src/index.ts has 1057 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts · ×1
rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts: 895 lines of code rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts:1— rivetkit-typescript/packages/rivetkit/src/registry/runtime.ts has 895 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts · ×1
rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts: 764 lines of code rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts:1— rivetkit-typescript/packages/rivetkit/src/common/bare/transport/v1.ts has 764 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· integrations/workflow-world/src/actors/dispatcher.ts · ×1
integrations/workflow-world/src/actors/dispatcher.ts: 756 lines of code integrations/workflow-world/src/actors/dispatcher.ts:1— integrations/workflow-world/src/actors/dispatcher.ts has 756 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 735 lines of code REDACTED:1— REDACTED has 735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/client/client.ts · ×1
rivetkit-typescript/packages/rivetkit/src/client/client.ts: 688 lines of code rivetkit-typescript/packages/rivetkit/src/client/client.ts:1— rivetkit-typescript/packages/rivetkit/src/client/client.ts has 688 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts · ×1
rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts: 628 lines of code rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts:1— rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts has 628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/engine-client/mod.ts · ×1
rivetkit-typescript/packages/rivetkit/src/engine-client/mod.ts: 623 lines of code rivetkit-typescript/packages/rivetkit/src/engine-client/mod.ts:1— rivetkit-typescript/packages/rivetkit/src/engine-client/mod.ts has 623 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· scripts/publish/src/lib/version.ts · ×1
scripts/publish/src/lib/version.ts: 593 lines of code scripts/publish/src/lib/version.ts:1— scripts/publish/src/lib/version.ts has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/workflow-engine/schemas/serde.ts · ×1
rivetkit-typescript/packages/workflow-engine/schemas/serde.ts: 574 lines of code rivetkit-typescript/packages/workflow-engine/schemas/serde.ts:1— rivetkit-typescript/packages/workflow-engine/schemas/serde.ts has 574 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/workflow-engine/src/types.ts · ×1
rivetkit-typescript/packages/workflow-engine/src/types.ts: 563 lines of code rivetkit-typescript/packages/workflow-engine/src/types.ts:1— rivetkit-typescript/packages/workflow-engine/src/types.ts has 563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/effect/src/Actor.ts · ×1
rivetkit-typescript/packages/effect/src/Actor.ts: 560 lines of code rivetkit-typescript/packages/effect/src/Actor.ts:1— rivetkit-typescript/packages/effect/src/Actor.ts has 560 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 547 lines of code REDACTED:1— REDACTED has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/workflow-engine/src/storage.ts · ×1
rivetkit-typescript/packages/workflow-engine/src/storage.ts: 531 lines of code rivetkit-typescript/packages/workflow-engine/src/storage.ts:1— rivetkit-typescript/packages/workflow-engine/src/storage.ts has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· scripts/publish/src/ci/bin.ts · ×1
scripts/publish/src/ci/bin.ts: 504 lines of code scripts/publish/src/ci/bin.ts:1— scripts/publish/src/ci/bin.ts has 504 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/common/encoding.ts · ×1
rivetkit-typescript/packages/rivetkit/src/common/encoding.ts: 464 lines of code rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:1— rivetkit-typescript/packages/rivetkit/src/common/encoding.ts has 464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/framework-base/src/mod.ts · ×1
rivetkit-typescript/packages/framework-base/src/mod.ts: 457 lines of code rivetkit-typescript/packages/framework-base/src/mod.ts:1— rivetkit-typescript/packages/framework-base/src/mod.ts has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/traces/src/read-range.ts · ×1
rivetkit-typescript/packages/traces/src/read-range.ts: 453 lines of code rivetkit-typescript/packages/traces/src/read-range.ts:1— rivetkit-typescript/packages/traces/src/read-range.ts has 453 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts · ×1
rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts: 439 lines of code rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts:1— rivetkit-typescript/packages/rivetkit/src/workflow/driver.ts has 439 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/actor/errors.ts · ×1
rivetkit-typescript/packages/rivetkit/src/actor/errors.ts: 427 lines of code rivetkit-typescript/packages/rivetkit/src/actor/errors.ts:1— rivetkit-typescript/packages/rivetkit/src/actor/errors.ts has 427 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts · ×1
rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts: 416 lines of code rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts:1— rivetkit-typescript/packages/rivetkit/src/common/client-protocol-versioned.ts has 416 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· integrations/flue-runtime/src/agent-coordinator.ts · ×1
integrations/flue-runtime/src/agent-coordinator.ts: 402 lines of code integrations/flue-runtime/src/agent-coordinator.ts:1— integrations/flue-runtime/src/agent-coordinator.ts has 402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~407 LoC) rivetkit-typescript/packages/rivetkit/src/common/bare/actor-persist/v4.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (~164 LoC) rivetkit-typescript/packages/rivetkit/runtime/index.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (~158 LoC) rivetkit-typescript/packages/rivetkit/src/actor/utils.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (~117 LoC) rivetkit-typescript/packages/rivetkit/src/common/hibernatable-websocket-ack-state.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (~47 LoC) rivetkit-typescript/packages/rivetkit/scripts/drizzle-compat-smoke.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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) rivetkit-typescript/packages/rivetkit/scripts/pack-devtools.ts— no import path from any entry point (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 (64 application, 25 tooling, 2 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 '@iarna/toml' REDACTED:37— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@sentry/vite-plugin' REDACTED:38— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'fast-glob' REDACTED:39— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'handlebars' REDACTED:40— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'lefthook' REDACTED:27— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'zx' REDACTED:33— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'motion' rivetkit-typescript/packages/devtools/package.json:48— Declared in rivetkit-typescript/packages/devtools/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 '@arethetypeswrong/cli' rivetkit-typescript/packages/effect/package.json:37— Declared in rivetkit-typescript/packages/effect/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.
Weak hash algorithm engine/packages/cli/src/commands/deploy/cluster.rs:203— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X25 · Inert configuration knob· Configuration option is only ever logged · ×1
Configuration option is only ever logged rivetkit-rust/packages/rivetkit-core/src/services_process.rs:48— `ServicesVersionOutput.rivetkit_version` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Duplicated predicate rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:289— `!isDynamicActorQuery(this.#actorResolutionState) || !isStaleResolvedActorError(group, code)` 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 engine/sdks/typescript/api-full/src/core/fetcher/getFetchFn.ts:8— `RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18` appears character-identically in 2 files — engine/sdks/typescript/api-full/src/core/fetcher/getFetchFn.ts, engine/sdks/typescript/api-full/src/core/fetcher/stream-wrappers/chooseStreamWrapper.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/inspector-tab/mod.ts:235— `body.args !== undefined && body.properties !== undefined` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit/src/inspector-tab/mod.ts, rivetkit-typescript/packages/rivetkit/src/registry/native.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 integrations/workflow-world/src/actors/dispatcher.ts:571— `c.vars.wakeArmedAt != null && c.vars.wakeArmedAt <= target` appears character-identically in 2 files — integrations/workflow-world/src/actors/dispatcher.ts, integrations/workflow-world/src/actors/workflow-run.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/scripts/check-annotated-skips.ts:16— `entry.isFile() && /\.(ts|tsx|mts|cts)$/.test(entry.name)` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit/scripts/check-annotated-skips.ts, rivetkit-typescript/packages/rivetkit/scripts/check-wait-for-comments.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:38— `process.platform === "win32" && process.arch === "x64"` 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 rivetkit-typescript/packages/rivetkit/src/common/encoding.ts:277— `proto === Object.prototype || proto === null` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit/src/common/encoding.ts, rivetkit-typescript/packages/rivetkit/src/registry/write-through-proxy.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:150— `prototype === Object.prototype || prototype === null` 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/rivetkit/src/registry/native.ts:904— `typeof error === "object" && error !== null && "reason" in error && typeof error.reason === "string"` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit/src/registry/native.ts, rivetkit-typescript/packages/rivetkit/src/registry/wasm-runtime.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:364— `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 engine/sdks/typescript/api-full/src/core/schemas/utils/isPlainObject.ts:3— `typeof value !== "object" || value === null` appears character-identically in 2 files — engine/sdks/typescript/api-full/src/core/schemas/utils/isPlainObject.ts, rivetkit-typescript/packages/workflow-engine/schemas/serde.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/traces/src/read-range.ts:459— `value === undefined || typeof value === "function"` appears character-identically in 2 files — rivetkit-typescript/packages/traces/src/read-range.ts, rivetkit-typescript/packages/traces/src/traces.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 engine/packages/auth-jwt/src/rotation.rs:158— `!authority.permits() || message.is_request_expired()` appears character-identically in 2 files — engine/packages/auth-jwt/src/rotation.rs, engine/packages/pegboard-v2-migrator/src/requests.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.
Duplicated predicate engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs:581— `!proving && fx.now_boot_ms() < pending.deadline_boot_ms` appears character-identically in 2 files — engine/packages/depot-worker/src/tablet_maintainer_machine/state/checkpoints.rs, engine/packages/depot-worker/src/tablet_maintainer_machine/state/fork_references.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.
Duplicated predicate rivetkit-typescript/packages/rivetkit-napi/src/database.rs:296— `!timeout_ms.is_finite() || timeout_ms <= 0.0` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit-napi/src/database.rs, rivetkit-typescript/packages/rivetkit-wasm/src/lib.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.
Duplicated predicate engine/packages/auth-jwt/src/rotation.rs:187— `authority.permits() && !message.is_request_expired()` appears character-identically in 2 files — engine/packages/auth-jwt/src/rotation.rs, engine/packages/pegboard-v2-migrator/src/requests.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.
Duplicated predicate engine/packages/auth-jwt/src/rotation.rs:149— `authority.tenure().owner.worker_id == *pubsub.worker_id() && authority.tenure().owner.instance_id.as_bytes() == pubsub.instance_id().as_byte…` appears character-identically in 2 files — engine/packages/auth-jwt/src/rotation.rs, engine/packages/pegboard-v2-migrator/src/requests.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.
Duplicated predicate engine/packages/depot-client/src/volume_requests.rs:92— `capacities.incoming > 0 && capacities.outgoing > 0` appears character-identically in 3 files — engine/packages/depot-client/src/volume_requests.rs, engine/packages/depot-volume/src/ups.rs, engine/packages/depot-worker/src/coordinator_requests.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.
Duplicated predicate rivetkit-typescript/packages/rivetkit-napi/src/lib.rs:85— `context.public_ != Some(true) || context.status_code.is_none() || context.status_code == Some(500)` appears character-identically in 2 files — rivetkit-typescript/packages/rivetkit-napi/src/lib.rs, rivetkit-typescript/packages/rivetkit-wasm/src/lib.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.
Duplicated predicate engine/packages/depot-client/src/client_protocol.rs:164— `error.group() != "depot" || error.code() != "overloaded"` appears character-identically in 2 files — engine/packages/depot-client/src/client_protocol.rs, engine/packages/depot-client/src/command.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.
Duplicated predicate engine/packages/depot-client/src/filesystem/cache.rs:1494— `inode.kind == FsKind::File && inode.inline.is_none()` appears character-identically in 2 files — engine/packages/depot-client/src/filesystem/cache.rs, engine/packages/depot-fs-core/src/forks.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.
Duplicated predicate engine/packages/depot-worker/src/filesystem/base.rs:110— `max_bytes > 0 && max_bytes <= CHUNK_BYTES` appears character-identically in 2 files — engine/packages/depot-worker/src/filesystem/base.rs, engine/packages/depot-worker/src/tablet_maintainer_machine/state/materialize.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.
Duplicated predicate engine/packages/pegboard-gateway/src/http_tunnel.rs:229— `message.message_id.gateway_id == identity.gateway_id && message.message_id.request_id == identity.request_id` appears character-identically in 2 files — engine/packages/pegboard-gateway/src/http_tunnel.rs, engine/packages/pegboard-gateway/src/websocket_tunnel.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.
Duplicated predicate engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs:860— `previous.volume_seq.checked_add(1) != Some(entry.volume_seq) || entry.client_epoch < previous.client_epoch` appears character-identically in 2 files — engine/packages/depot-worker/src/tablet_maintainer_machine/state/catch_up/mod.rs, engine/packages/depot-worker/src/tablet_maintainer_machine/state/maintainer_log/mod.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.
Interpolated log message defeats structured logging rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:2978— `warn!` at line 2978 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/rivetkit-core/src/actor/task.rs:3027— `error!` at line 3027 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/connection.rs:232— `debug!` at line 232 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/connection.rs:274— `debug!` at line 274 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/connection.rs:316— `debug!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/connection.rs:345— `debug!` at line 345 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/connection.rs:352— `debug!` at line 352 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/connection.rs:766— `debug!` at line 766 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/drivers/ws.rs:72— `debug!` at line 72 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/drivers/ws.rs:78— `debug!` at line 78 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/drivers/ws.rs:93— `debug!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/drivers/ws.rs:98— `debug!` at line 98 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging rivetkit-rust/packages/client/src/drivers/ws.rs:114— `debug!` at line 114 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging engine/packages/guard/src/lib.rs:86— `info!` at line 86 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging engine/packages/guard/src/lib.rs:197— `warn!` at line 197 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging engine/packages/guard/src/lib.rs:202— `debug!` at line 202 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit/README.md:1— `rivetkit` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit-napi/npm/darwin-arm64/README.md:1— `darwin-arm64` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit-napi/npm/darwin-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit-napi/npm/darwin-x64/README.md:1— `darwin-x64` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit-napi/npm/darwin-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit-napi/npm/linux-arm64-gnu/README.md:1— `linux-arm64-gnu` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit-napi/npm/linux-arm64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit-napi/npm/linux-arm64-musl/README.md:1— `linux-arm64-musl` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit-napi/npm/linux-arm64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit-napi/npm/linux-x64-gnu/README.md:1— `linux-x64-gnu` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit-napi/npm/linux-x64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/rivetkit-napi/npm/linux-x64-musl/README.md:1— `linux-x64-musl` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/rivetkit-napi/npm/linux-x64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example rivetkit-typescript/packages/sql-loader/README.md:1— `sql-loader` is a published package (`REDACTED` without `"private": true`) and neither `rivetkit-typescript/packages/sql-loader/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
redundant comment rivetkit-typescript/packages/framework-base/src/mod.ts:334— "Increment ref count" repeats the code it sits on: 3 of its 3 words (increment, ref, count) are already in `cached.refCount++;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts:1048— "Check if this is a scheduling error" repeats the code it sits on: 3 of its 3 words (check, scheduling, error) are already in `if (errors.isSchedulingError(group, code) && this.#actorId)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment rivetkit-typescript/packages/rivetkit/src/client/raw-utils.ts:193— "Open WebSocket" repeats the code it sits on: 3 of its 3 words (open, web, socket) are already in `const ws = await driver.openWebSocket(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment rivetkit-typescript/packages/rivetkit/src/common/inline-websocket-adapter.ts:55— "Create WSContext with actorWs as raw" repeats the code it sits on: 5 of its 5 words (create, ws, context, actor, raw) are already in `this.#wsContext = new WSContext({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment rivetkit-typescript/packages/rivetkit/src/engine-client/ws-proxy.ts:38— "Create WebSocket" repeats the code it sits on: 3 of its 3 words (create, web, socket) are already in `const targetWs = new WebSocket(targetUrl, protocols);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×5
Projects may be oversized for their cohesion engine/packages/depot-worker/Cargo.toml:1— `engine/packages/depot-worker` (83751 LoC, 292 module-visible types across 16 directories) overshoots its size bounds. 5 of 90 build unit(s) (Cargo, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.9/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion rivetkit-typescript/packages/rivetkit/package.json:1— `rivetkit-typescript/packages/rivetkit` (33954 LoC, 422 module-visible types across 23 directories) overshoots its size bounds. 5 of 90 build unit(s) (Cargo, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.9/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion rivetkit-rust/packages/rivetkit-core/Cargo.toml:1— `rivetkit-rust/packages/rivetkit-core` (33930 LoC, 177 module-visible types across 10 directories) overshoots its size bounds. 5 of 90 build unit(s) (Cargo, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.9/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion engine/packages/pegboard/Cargo.toml:1— `engine/packages/pegboard` (19789 LoC, 178 module-visible types across 5 directories) overshoots its size bounds. 5 of 90 build unit(s) (Cargo, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.9/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion engine/sdks/rust/data/Cargo.toml:1— `engine/sdks/rust/data` (16661 LoC, 225 module-visible types across 5 directories) overshoots its size bounds. 5 of 90 build unit(s) (Cargo, SwiftPM, npm) overshoot their size bounds, lowering Project Cohesion to 8.9/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Silent fallback default on Err engine/packages/depot-worker/src/tablet_supervisor.rs:131— `changed` turns every `Err` into `false` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err engine/packages/metrics-server/src/providers.rs:83— `otel_grpc_endpoint` turns every `Err` into `"http://localhost:4317".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err engine/packages/pegboard/src/namespace_machine/executor.rs:908— `legacy_actor_id_label` turns every `Err` into `"invalid".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err engine/sdks/rust/envoy-client/src/connection/mod.rs:389— `send_initial_metadata` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err rivetkit-rust/packages/engine-process/src/lib.rs:465— `admin_token` turns every `Err` into `"default".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 57 significant file(s) lose their only recent owner: rivetkit-rust/packages/rivetkit-core/src/actor/context.rs, rivetkit-rust/packages/rivetkit-core/src/actor/sqlite/tx.rs, rivetkit-typescript/packages/rivetkit/src/client/actor-conn.ts, rivetkit-rust/packages/rivetkit-core/src/actor/schedule.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/telemetry.rs (+49 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 6 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. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: rivetkit-rust/packages/client/src/protocol/codec.rs, engine/packages/cli/src/commands/deploy.rs, engine/packages/cli/src/util.rs, engine/packages/cli/src/commands/pool.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: rivetkit-typescript/packages/rivetkit/src/inspector-tab/mod.ts, rivetkit-rust/packages/rivetkit-core/src/inspector_bundle/mod.rs, rivetkit-typescript/packages/rivetkit/src/engine-client/ws-proxy.ts. Pair on, review, or document these before any departure.
P2 · Observability· Console output used as the logging channel · ×3
Console output used as the logging channel rivetkit-typescript/packages/rivetkit/src/utils/node.ts:85— `rivetkit-typescript/packages/rivetkit/src/utils/node.ts` reports through `console.*` at line 85 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rivetkit-typescript/packages/rivetkit/src/common/inline-websocket-adapter.ts:165— `rivetkit-typescript/packages/rivetkit/src/common/inline-websocket-adapter.ts` reports through `console.*` at line 165 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rivetkit-typescript/packages/workflow-engine/src/context.ts:2773— `rivetkit-typescript/packages/workflow-engine/src/context.ts` reports through `console.*` at line 2773 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
D21 · Naming Consistency· `toolUseID` spells `ID` where 496 names in the project spell it `Id` · ×2
`toolUseID` spells `ID` where 496 names in the project spell it `Id` examples/kitchen-sink/src/actors/testing/load-test-agent-2.ts:2733— 496 of 498 names in project @rivetkit/engine-workspace spell the token `Id` (496 of 498; unit: names in project @rivetkit/engine-workspace containing `Id`). Peers: RivetClient.actorsGet(actorId) (engine/sdks/typescript/api-full/src/Client.ts:470); RivetClient.actorsDelete(actorId) (engine/sdks/typescript/api-full/src/Client.ts:530); RivetClient.actorsReschedule(actorId) (engine/sdks/typescript/api-full/src/Client.ts:601); RivetClient.actorsSleep(actorId) (engine/sdks/typescript/api-full/src/Client.ts:672); RivetClient.actorsFork(actorId) (engine/sdks/typescript/api-full/src/Client.ts:746). Rename to `toolUseId`. [rule N6]
`toolUseID` spells `ID` where 496 names in the project spell it `Id` examples/kitchen-sink/src/actors/testing/slow-reconnect-actor.ts:1144— 496 of 498 names in project @rivetkit/engine-workspace spell the token `Id` (496 of 498; unit: names in project @rivetkit/engine-workspace containing `Id`). Peers: RivetClient.actorsGet(actorId) (engine/sdks/typescript/api-full/src/Client.ts:470); RivetClient.actorsDelete(actorId) (engine/sdks/typescript/api-full/src/Client.ts:530); RivetClient.actorsReschedule(actorId) (engine/sdks/typescript/api-full/src/Client.ts:601); RivetClient.actorsSleep(actorId) (engine/sdks/typescript/api-full/src/Client.ts:672); RivetClient.actorsFork(actorId) (engine/sdks/typescript/api-full/src/Client.ts:746). Rename to `toolUseId`. [rule N6]
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×2
Diagnostic log message is built whether or not it is wanted rivetkit-typescript/packages/rivetkit/src/common/router.ts:43— `debug` at line 43 is called with an argument built by `JSON.stringify(c.req.header())` (line 53), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted engine/packages/sqlite-prefetch/src/driver.rs:213— `tracing::trace!` at line 213 is called with an argument built by `reply.pages.iter().filter_map(|(_,bytes)|bytes.as_ref()).map(Bytes::len).sum::<usize>()` (line 225), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::trace! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls.
Silent fallback default in catch REDACTED:139— `decodeStreamCursor` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch scripts/publish/src/lib/version.ts:76— `loadDefaultCatalog` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
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 (73 single-owned of 865 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 865 of the 1304 production source files in this repository met that bar). They are anonymized user #5 (3 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: engine/packages/outbound-guard/src/policy.rs, rivetkit-rust/packages/rivetkit-core/src/serde_metrics.rs, engine/packages/config/src/config/outbound.rs.
D21 · Naming Consistency· `SlateDBError` spells `DB` where 15 names in the project spell it `Db` · ×1
`SlateDBError` spells `DB` where 15 names in the project spell it `Db` vendor/slatedb/out/src/error.rs:18— 15 of 16 names in project slatedb spell the token `Db` (15 of 16; unit: names in project slatedb containing `Db`). Peers: slatedb.db_cache.UnownedDbCache (vendor/slatedb/out/src/db_cache/mod.rs:1000); slatedb.db_state.COWDbState (vendor/slatedb/out/src/db_state.rs:756); slatedb.manifest.ExternalDb (vendor/slatedb/out/src/manifest/mod.rs:1596); slatedb.wal.slatedb.admin.SlateDbWalAdmin (vendor/slatedb/out/src/wal/slatedb/admin.rs:19); slatedb.wal.slatedb.gc.SlateDbWalGc (vendor/slatedb/out/src/wal/slatedb/gc.rs:41). Rename to `SlateDbError`. [rule N6]
D21 · Naming Consistency· `sendJSON` spells `JSON` where 26 names in the project spell it `Json` · ×1
`sendJSON` spells `JSON` where 26 names in the project spell it `Json` examples/kitchen-sink/src/actors/testing/slow-reconnect-actor.ts:363— 26 of 27 names in project @rivetkit/engine-workspace spell the token `Json` (26 of 27; unit: names in project @rivetkit/engine-workspace containing `Json`). Peers: engine.sdks.typescript.api-full.src.core.fetcher.Fetcher.NonJsonError (engine/sdks/typescript/api-full/src/core/fetcher/Fetcher.ts:37); json.toJson (engine/sdks/typescript/api-full/src/core/json.ts:8); json.fromJson (engine/sdks/typescript/api-full/src/core/json.ts:22); index.readJson (engine/sdks/typescript/envoy-protocol/src/index.ts:24); index.writeJson (engine/sdks/typescript/envoy-protocol/src/index.ts:28). Rename to `sendJson`. [rule N6]
D28 · Secrets (history)· Rotate the exposed credentials · ×1
README/code drift docs/durable-streams/content/docs/index.mdx:30— docs/durable-streams/content/docs/index.mdx names RivetKit 2, but the manifest declares `rivetkit` ^3.1.1. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Logging is not universal — Only 46/48 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`.
No dependency-update automation REDACTED:23— `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
Changelog looks stale/thin — The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
Unused export 'queryOne' integrations/flue-runtime/src/stores/async-db.ts:12— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isStaticActorInstance' · ×1
Unused export 'isStaticActorInstance' rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:174— Nothing ultimately consumes this binding: its only referrer is the re-export in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'isStaticActorDefinition' · ×1
Unused export 'isStaticActorDefinition' rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:252— Nothing ultimately consumes this binding: its only referrer is the re-export in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'lookupInRegistry' · ×1
Unused export 'lookupInRegistry' rivetkit-typescript/packages/rivetkit/src/actor/definition.ts:258— Nothing ultimately consumes this binding: its only referrer is the re-export in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'actorKeyFromGatewayQuery' · ×1
Unused export 'actorKeyFromGatewayQuery' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:225— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'makeTracesKey' · ×1
Unused export 'makeTracesKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:249— 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:257— 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:261— 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:265— 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:269— Nothing imports this binding — it is safe to review for removal.
Unused export 'makeConnKey' rivetkit-typescript/packages/rivetkit/src/actor/keys.ts:273— 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:282— 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:290— Nothing imports this binding — it is safe to review for removal.
Unused export 'event' rivetkit-typescript/packages/rivetkit/src/actor/schema.ts:38— Nothing ultimately consumes this binding: its only referrer is the re-export in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'queue' rivetkit-typescript/packages/rivetkit/src/actor/schema.ts:45— Nothing ultimately consumes this binding: its only referrer is the re-export in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in rivetkit-typescript/packages/rivetkit/src/actor/mod.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'SchemaConfig' rivetkit-typescript/packages/rivetkit/src/actor/schema.ts:82— Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene· Type-only dependency '@rivetkit/engine-api-full' in production deps · ×1
Type-only dependency '@rivetkit/engine-api-full' in production deps rivetkit-typescript/packages/rivetkit/src/client/auth.ts:1— Every import is type-only — move it to devDependencies.
No security response headers detected examples/native-websockets/vercel.json:1— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
doc comments repeat the names shared/typescript/virtual-websocket/src/virtual-websocket.ts:9— 0 of 0 documented parameters and 1 of 7 summaries in `@rivetkit/virtual-websocket` only repeat the member or parameter name (e.g. "Get the current ready state" for `getReadyState`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names rivetkit-typescript/packages/workflow-engine/src/keys.ts:181— 0 of 2 documented parameters and 6 of 221 summaries in `@rivetkit/workflow-engine` only repeat the member or parameter name (e.g. "Build a key for workflow state. Key: [3, 1]" for `buildWorkflowStateKey`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names scripts/publish/src/lib/r2.ts:141— 0 of 0 documented parameters and 1 of 72 summaries in `publish` only repeat the member or parameter name (e.g. "Delete every object under an R2 prefix." for `deletePrefix`). Delete the restating tags, or add what the name does not say.
doc comments repeat the names rivetkit-typescript/packages/rivetkit/src/client/client.ts:75— 2 of 63 documented parameters and 1 of 440 summaries in `rivetkit` only repeat the member or parameter name (e.g. "The ID of the actor." for `actorId`). Delete the restating tags, or add what the name does not say.
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.
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.
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 22 file(s) — `integrations/workflow-world/src/actors/coordinator.ts`, `rivetkit-swift/Sources/RivetKitClient/ActorConnection.swift`, `rivetkit-swift/Sources/RivetKitClient/ActorHandle.swift`, `rivetkit-swift/Sources/RivetKitSwiftUI/ActorObservable.swift`, `rivetkit-typescript/packages/effect/src/Action.ts`, … (+17 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 — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e78d-1c65-7e4e-9de2-7c8173f4af20 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 188 · Warnings: 2299 · Recommendations: 134 · Info: 5 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 03:29 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.