Public report of smol-machines/smolvm, published 14 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, 14 November 2026, 18:33 UTC · Survey ID cd_ebf9ac4cb6fe4704ad15dbc33276cdd6
smol-machines/smolvm
Measured 14 November 2026, 18:27 UTC, at code version 93d46b4
Code coverage is not measured: Rust suite (CouldNotMeasureRanButNoData).
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 3 since the last survey
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: 299,527 lines of product code in 18 projects, tests not counted · Estimated rebuild effort: about 2.2 person-years · Weakest lens: Production Readiness, 53
Findings by how serious they are
108 critical1400 serious126 minor
12 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
14 November 2026, 18:27 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
59of 59 dimensions measured by tools.
1586of 1634 findings point to an exact file and line, so you can open each one in the code. The other 48 concern the repository as a whole, such as missing documentation.
59dimensions across 8 lenses, read from 299,527 lines of product code in 18 projects.
smol-machines/smolvm falls short of our standard for production, held back most by its Production Readiness lens, the way the code is tested, built, released and run. It scores 58 out of 100 and is rated Adequate, and 101 of its 108 critical findings are security problems.
Production Readiness, at 53, is the weakest lens, level with Accessibility, and counts most in the score. The best first step is adding text alternatives, worth about 4 points. Structuring the pages comes next, worth about 3 points. Raising Production Readiness to 70 would lift the score to about 61.
Ninety-two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline, and six sets of files in separate parts keep changing together, which points to hidden dependencies. Pinning each tool to an exact version, passing outside input through environment variables and making the hidden dependencies explicit would close these risks. Correcting the flagged pipeline settings would fix the three weaknesses in the build pipeline's configuration, and the two unsafe settings in infrastructure or container files need changing to safe values. Moving the write out of the read operation would take care of the read operation that also writes data.
The product code is 299,527 lines, about €320,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 Production Readiness rose from 53 to 70, the lowest score rated Strong, the score would rise from 58 to about 61.
Code composition: what the lines of code are
Product code 98%Tests 2%
New since the last survey: 425 findings
These 425 critical or serious findings weren't in the previous survey, on 27 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FileTooLong: engine/containers.rs src/engine/containers.rs
God Classes · FunctionTooLong: smolvm::cli::smolfile::build_create_spec src/cli/smolfile.rs
God Classes · FileTooLong: engine/api.rs src/engine/api.rs
God Classes · FunctionTooLong: smolvm::engine::containers::resolve_mounts src/engine/containers.rs
God Classes · FileTooLong: engine/network.rs src/engine/network.rs
God Classes · MethodTooLong: CreateCmd.create_spec src/cli/machine.rs
God Classes · FunctionTooLong: smolvm::engine::containers::create src/engine/containers.rs
God Classes · FunctionTooLong: smolvm_agent::run_interactive_loop_io crates/smolvm-agent/src/main.rs
God Classes · FileTooLong: engine/image_ops.rs src/engine/image_ops.rs
God Classes · FunctionTooLong: smolvm::engine::exec::start src/engine/exec.rs
God Classes · FunctionTooLong: smolvm_agent::container::prepare crates/smolvm-agent/src/container.rs
God Classes · FileTooLong: src/container.rs crates/smolvm-agent/src/container.rs
God Classes · FileTooLong: api/exec_sessions.rs src/api/exec_sessions.rs
God Classes · MethodTooLong: CreateVmParams.to_create_spec src/cli/vm_common.rs
God Classes · FileTooLong: cli/smolfile.rs src/cli/smolfile.rs
God Classes · FunctionTooLong: smolvm::engine::image_ops::push_inner src/engine/image_ops.rs
God Classes · MethodTooLong: ServeStartCmd.run src/cli/serve.rs
God Classes · FunctionTooLong: smolvm::portable_checkpoint::restore_from_path_with src/portable_checkpoint.rs
God Classes · FileTooLong: handlers/exec_sessions.rs src/api/handlers/exec_sessions.rs
God Classes · FunctionTooLong: smolvm::api::handlers::exec_sessions::attach src/api/handlers/exec_sessions.rs
God Classes · ClassTooLong: TcpRelayTable crates/smolvm-network/src/tcp_relay.rs
God Classes · FunctionTooLong: smolvm::api::handlers::machines::create_spec_from_request src/api/handlers/machines.rs
God Classes · MethodTooLong: VmRecord.new_with_restart src/config.rs
God Classes · FileTooLong: api/memory_pressure.rs src/api/memory_pressure.rs
God Classes · MethodTooLong: VmRecord.new src/config.rs
God Classes · FunctionTooLong: smolvm::engine::containers::run_container src/engine/containers.rs
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 121 findings
These 121 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one. The first 100 are listed here.
€110,000 to €530,000, for 1,763 to 5,593 hours of work, about 2.2 person-years for 1 to 5 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 58. 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: 299,527 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
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 4 points · Medium effort · Text alternatives
2
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 3 points · Medium effort · Page structure
3
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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 €320,000 to build again, about 2.2 person-years of work. Its weakest lens is Production Readiness, at 53 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 257,703 lines over the last 90 days, which is about 1,045,129 lines a year. At that pace, the extra work comes to an estimated 116 to 696 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.
309 modules, with 608 dependencies between them. 5 loops run through 48 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 269 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.
smolvm.agent.fork uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.agent.fork, while a change to smolvm.agent.fork can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.agent.fork uses a module listed above it, which is the healthy direction.
12→22 smolvm.agent.fork uses smolvm.dbpart of a loop✕
Connections
1 pair of types, where a type in smolvm.agent.fork uses a type in smolvm.db.
smolvm.agent.fork uses smolvm.config, so a change to smolvm.config can break smolvm.agent.fork, while a change to smolvm.agent.fork can't break smolvm.config.
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.
smolvm.api.errors uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.api.errors, while a change to smolvm.api.errors can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.api.errors uses a module listed above it, which is the healthy direction.
smolvm.api.errors uses smolvm_cuda.proto, so a change to smolvm_cuda.proto can break smolvm.api.errors, while a change to smolvm.api.errors can't break smolvm_cuda.proto.
Position
Below the diagonal: smolvm.api.errors uses a module listed above it, which is the healthy direction.
smolvm.data.resources uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.data.resources, while a change to smolvm.data.resources can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.data.resources uses a module listed above it, which is the healthy direction.
smolvm.data.resources uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.data.resources, while a change to smolvm.data.resources can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.data.resources uses a module listed above it, which is the healthy direction.
14→25 smolvm.data.resources uses smolvm.data.networkpart of a loop✕
Connections
1 pair of types, where a type in smolvm.data.resources uses a type in smolvm.data.network.
smolvm.data.resources uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.data.resources, while a change to smolvm.data.resources can't break smolvm.data.network.
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.
15→24 smolvm.data.storage uses smolvm.api.typespart of a loop✕
Connections
1 pair of types, where a type in smolvm.data.storage uses a type in smolvm.api.types.
smolvm.data.storage uses smolvm.api.types, so a change to smolvm.api.types can break smolvm.data.storage, while a change to smolvm.data.storage can't break smolvm.api.types.
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.
smolvm.registry uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.registry, while a change to smolvm.registry can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.registry uses a module listed above it, which is the healthy direction.
smolvm.registry uses smolvm_protocol, so a change to smolvm_protocol can break smolvm.registry, while a change to smolvm.registry can't break smolvm_protocol.
Position
Below the diagonal: smolvm.registry uses a module listed above it, which is the healthy direction.
smolvm_agent uses smolvm_agent.oci, so a change to smolvm_agent.oci can break smolvm_agent, while a change to smolvm_agent can't break smolvm_agent.oci.
Position
Below the diagonal: smolvm_agent uses a module listed above it, which is the healthy direction.
smolvm_network uses smolvm_network.queues, so a change to smolvm_network.queues can break smolvm_network, while a change to smolvm_network can't break smolvm_network.queues.
Position
Below the diagonal: smolvm_network uses a module listed above it, which is the healthy direction.
smolvm_network uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm_network, while a change to smolvm_network can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm_network uses a module listed above it, which is the healthy direction.
smolvm_pack.format uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm_pack.format, while a change to smolvm_pack.format can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm_pack.format uses a module listed above it, which is the healthy direction.
smolvm_pack.format uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm_pack.format, while a change to smolvm_pack.format can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm_pack.format uses a module listed above it, which is the healthy direction.
smolvm.agent.client uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.agent.client, while a change to smolvm.agent.client can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.agent.client uses a module listed above it, which is the healthy direction.
smolvm.agent.client uses smolvm_protocol, so a change to smolvm_protocol can break smolvm.agent.client, while a change to smolvm.agent.client can't break smolvm_protocol.
Position
Below the diagonal: smolvm.agent.client uses a module listed above it, which is the healthy direction.
smolvm.agent.client uses smolvm.registry, so a change to smolvm.registry can break smolvm.agent.client, while a change to smolvm.agent.client can't break smolvm.registry.
Position
Below the diagonal: smolvm.agent.client uses a module listed above it, which is the healthy direction.
20→26 smolvm.agent.client uses smolvm.configpart of a loop✕
Connections
1 pair of types, where a type in smolvm.agent.client uses a type in smolvm.config.
smolvm.agent.client uses smolvm.config, so a change to smolvm.config can break smolvm.agent.client, while a change to smolvm.agent.client can't break smolvm.config.
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.
smolvm.agent.launcher uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.agent.launcher, while a change to smolvm.agent.launcher can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.agent.launcher uses a module listed above it, which is the healthy direction.
smolvm.agent.launcher uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.agent.launcher, while a change to smolvm.agent.launcher can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.agent.launcher uses a module listed above it, which is the healthy direction.
21→25 smolvm.agent.launcher uses smolvm.data.networkpart of a loop✕
Connections
3 pairs of types, where a type in smolvm.agent.launcher uses a type in smolvm.data.network.
smolvm.agent.launcher uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.agent.launcher, while a change to smolvm.agent.launcher can't break smolvm.data.network.
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.
21→26 smolvm.agent.launcher uses smolvm.configpart of a loop✕
Connections
1 pair of types, where a type in smolvm.agent.launcher uses a type in smolvm.config.
smolvm.agent.launcher uses smolvm.config, so a change to smolvm.config can break smolvm.agent.launcher, while a change to smolvm.agent.launcher can't break smolvm.config.
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.
smolvm.agent.manager uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm_protocol, so a change to smolvm_protocol can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm_protocol.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm.data.storage, so a change to smolvm.data.storage can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.data.storage.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm.agent.client, so a change to smolvm.agent.client can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.agent.client.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm.agent.launcher, so a change to smolvm.agent.launcher can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.agent.launcher.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
smolvm.agent.manager uses smolvm.db, so a change to smolvm.db can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.db.
Position
Below the diagonal: smolvm.agent.manager uses a module listed above it, which is the healthy direction.
23→25 smolvm.agent.manager uses smolvm.data.networkpart of a loop✕
Connections
4 pairs of types, where a type in smolvm.agent.manager uses a type in smolvm.data.network.
smolvm.agent.manager uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.data.network.
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.
23→26 smolvm.agent.manager uses smolvm.configpart of a loop✕
Connections
2 pairs of types, where a type in smolvm.agent.manager uses a type in smolvm.config.
smolvm.agent.manager uses smolvm.config, so a change to smolvm.config can break smolvm.agent.manager, while a change to smolvm.agent.manager can't break smolvm.config.
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.
smolvm.api.types uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm.api.types, while a change to smolvm.api.types can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm.api.types uses a module listed above it, which is the healthy direction.
smolvm.api.types uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.api.types, while a change to smolvm.api.types can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.api.types uses a module listed above it, which is the healthy direction.
smolvm.api.types uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.api.types, while a change to smolvm.api.types can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.api.types uses a module listed above it, which is the healthy direction.
smolvm.api.types uses smolvm.data.storage, so a change to smolvm.data.storage can break smolvm.api.types, while a change to smolvm.api.types can't break smolvm.data.storage.
Position
Below the diagonal: smolvm.api.types uses a module listed above it, which is the healthy direction.
smolvm.api.types uses smolvm.agent.manager, so a change to smolvm.agent.manager can break smolvm.api.types, while a change to smolvm.api.types can't break smolvm.agent.manager.
Position
Below the diagonal: smolvm.api.types uses a module listed above it, which is the healthy direction.
24→25 smolvm.api.types uses smolvm.data.networkpart of a loop✕
Connections
2 pairs of types, where a type in smolvm.api.types uses a type in smolvm.data.network.
smolvm.api.types uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.api.types, while a change to smolvm.api.types can't break smolvm.data.network.
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.
smolvm.data.network uses smolvm.api.types, so a change to smolvm.api.types can break smolvm.data.network, while a change to smolvm.data.network can't break smolvm.api.types.
Position
Below the diagonal: smolvm.data.network uses a module listed above it, which is the healthy direction.
smolvm.config uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.config, while a change to smolvm.config can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.config uses a module listed above it, which is the healthy direction.
smolvm.config uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm.config, while a change to smolvm.config can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm.config uses a module listed above it, which is the healthy direction.
smolvm.config uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.config, while a change to smolvm.config can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.config uses a module listed above it, which is the healthy direction.
smolvm.config uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.config, while a change to smolvm.config can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.config uses a module listed above it, which is the healthy direction.
smolvm.config uses smolvm.data.storage, so a change to smolvm.data.storage can break smolvm.config, while a change to smolvm.config can't break smolvm.data.storage.
Position
Below the diagonal: smolvm.config uses a module listed above it, which is the healthy direction.
smolvm.config uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.config, while a change to smolvm.config can't break smolvm.data.network.
Position
Below the diagonal: smolvm.config uses a module listed above it, which is the healthy direction.
smolvm.agent.boot_config uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.agent.boot_config, while a change to smolvm.agent.boot_config can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.agent.boot_config uses a module listed above it, which is the healthy direction.
smolvm.agent.boot_config uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.agent.boot_config, while a change to smolvm.agent.boot_config can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.agent.boot_config uses a module listed above it, which is the healthy direction.
smolvm.agent.boot_config uses smolvm.data.storage, so a change to smolvm.data.storage can break smolvm.agent.boot_config, while a change to smolvm.agent.boot_config can't break smolvm.data.storage.
Position
Below the diagonal: smolvm.agent.boot_config uses a module listed above it, which is the healthy direction.
smolvm.agent.boot_config uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.agent.boot_config, while a change to smolvm.agent.boot_config can't break smolvm.data.network.
Position
Below the diagonal: smolvm.agent.boot_config uses a module listed above it, which is the healthy direction.
smolvm.agent.boot_config uses smolvm.config, so a change to smolvm.config can break smolvm.agent.boot_config, while a change to smolvm.agent.boot_config can't break smolvm.config.
Position
Below the diagonal: smolvm.agent.boot_config uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm_protocol, so a change to smolvm_protocol can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm_protocol.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.agent.fork, so a change to smolvm.agent.fork can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.agent.fork.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.agent.client, so a change to smolvm.agent.client can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.agent.client.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.db, so a change to smolvm.db can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.db.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.agent.manager, so a change to smolvm.agent.manager can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.agent.manager.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.api.types, so a change to smolvm.api.types can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.api.types.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.data.network.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.cli.vm_common uses smolvm.config, so a change to smolvm.config can break smolvm.cli.vm_common, while a change to smolvm.cli.vm_common can't break smolvm.config.
Position
Below the diagonal: smolvm.cli.vm_common uses a module listed above it, which is the healthy direction.
smolvm.embedded.handle uses smolvm.agent.client, so a change to smolvm.agent.client can break smolvm.embedded.handle, while a change to smolvm.embedded.handle can't break smolvm.agent.client.
Position
Below the diagonal: smolvm.embedded.handle uses a module listed above it, which is the healthy direction.
smolvm.embedded.handle uses smolvm.agent.manager, so a change to smolvm.agent.manager can break smolvm.embedded.handle, while a change to smolvm.embedded.handle can't break smolvm.agent.manager.
Position
Below the diagonal: smolvm.embedded.handle uses a module listed above it, which is the healthy direction.
smolvm.embedded.handle uses smolvm.config, so a change to smolvm.config can break smolvm.embedded.handle, while a change to smolvm.embedded.handle can't break smolvm.config.
Position
Below the diagonal: smolvm.embedded.handle uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm.data.storage, so a change to smolvm.data.storage can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm.data.storage.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm_pack.format, so a change to smolvm_pack.format can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm_pack.format.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm.data.network.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.machine_spec uses smolvm.config, so a change to smolvm.config can break smolvm.machine_spec, while a change to smolvm.machine_spec can't break smolvm.config.
Position
Below the diagonal: smolvm.machine_spec uses a module listed above it, which is the healthy direction.
smolvm.cli.pack_run uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.cli.pack_run, while a change to smolvm.cli.pack_run can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.cli.pack_run uses a module listed above it, which is the healthy direction.
smolvm.cli.pack_run uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.cli.pack_run, while a change to smolvm.cli.pack_run can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.cli.pack_run uses a module listed above it, which is the healthy direction.
smolvm.cli.pack_run uses smolvm_pack.format, so a change to smolvm_pack.format can break smolvm.cli.pack_run, while a change to smolvm.cli.pack_run can't break smolvm_pack.format.
Position
Below the diagonal: smolvm.cli.pack_run uses a module listed above it, which is the healthy direction.
smolvm.cli.pack_run uses smolvm.agent.client, so a change to smolvm.agent.client can break smolvm.cli.pack_run, while a change to smolvm.cli.pack_run can't break smolvm.agent.client.
Position
Below the diagonal: smolvm.cli.pack_run uses a module listed above it, which is the healthy direction.
smolvm.cli.pack_run uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.cli.pack_run, while a change to smolvm.cli.pack_run can't break smolvm.data.network.
Position
Below the diagonal: smolvm.cli.pack_run uses a module listed above it, which is the healthy direction.
smolvm.cli.pack_run uses smolvm.agent.boot_config, so a change to smolvm.agent.boot_config can break smolvm.cli.pack_run, while a change to smolvm.cli.pack_run can't break smolvm.agent.boot_config.
Position
Below the diagonal: smolvm.cli.pack_run uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.agent.fork, so a change to smolvm.agent.fork can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.agent.fork.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.data.storage, so a change to smolvm.data.storage can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.data.storage.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.agent.launcher, so a change to smolvm.agent.launcher can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.agent.launcher.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.db, so a change to smolvm.db can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.db.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.data.network.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.config, so a change to smolvm.config can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.config.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.embedded.handle, so a change to smolvm.embedded.handle can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.embedded.handle.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.embedded.control uses smolvm.machine_spec, so a change to smolvm.machine_spec can break smolvm.embedded.control, while a change to smolvm.embedded.control can't break smolvm.machine_spec.
Position
Below the diagonal: smolvm.embedded.control uses a module listed above it, which is the healthy direction.
smolvm.engine.containers uses smolvm_protocol, so a change to smolvm_protocol can break smolvm.engine.containers, while a change to smolvm.engine.containers can't break smolvm_protocol.
Position
Below the diagonal: smolvm.engine.containers uses a module listed above it, which is the healthy direction.
smolvm.engine.containers uses smolvm.embedded.handle, so a change to smolvm.embedded.handle can break smolvm.engine.containers, while a change to smolvm.engine.containers can't break smolvm.embedded.handle.
Position
Below the diagonal: smolvm.engine.containers uses a module listed above it, which is the healthy direction.
33→38 smolvm.engine.containers uses smolvm.enginepart of a loop✕
Connections
2 pairs of types, where a type in smolvm.engine.containers uses a type in smolvm.engine.
smolvm.engine.containers uses smolvm.engine, so a change to smolvm.engine can break smolvm.engine.containers, while a change to smolvm.engine.containers can't break smolvm.engine.
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.
smolvm.portable_checkpoint uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.portable_checkpoint uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.portable_checkpoint uses smolvm.registry, so a change to smolvm.registry can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm.registry.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.portable_checkpoint uses smolvm_pack.format, so a change to smolvm_pack.format can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm_pack.format.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.portable_checkpoint uses smolvm.db, so a change to smolvm.db can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm.db.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.portable_checkpoint uses smolvm.config, so a change to smolvm.config can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm.config.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.portable_checkpoint uses smolvm.machine_spec, so a change to smolvm.machine_spec can break smolvm.portable_checkpoint, while a change to smolvm.portable_checkpoint can't break smolvm.machine_spec.
Position
Below the diagonal: smolvm.portable_checkpoint uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.agent.manager, so a change to smolvm.agent.manager can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.agent.manager.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.api.types, so a change to smolvm.api.types can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.api.types.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.config, so a change to smolvm.config can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.config.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.machine_spec, so a change to smolvm.machine_spec can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.machine_spec.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.api.state uses smolvm.portable_checkpoint, so a change to smolvm.portable_checkpoint can break smolvm.api.state, while a change to smolvm.api.state can't break smolvm.portable_checkpoint.
Position
Below the diagonal: smolvm.api.state uses a module listed above it, which is the healthy direction.
smolvm.cli.pack uses smolvm.registry, so a change to smolvm.registry can break smolvm.cli.pack, while a change to smolvm.cli.pack can't break smolvm.registry.
Position
Below the diagonal: smolvm.cli.pack uses a module listed above it, which is the healthy direction.
smolvm.cli.pack uses smolvm_pack.format, so a change to smolvm_pack.format can break smolvm.cli.pack, while a change to smolvm.cli.pack can't break smolvm_pack.format.
Position
Below the diagonal: smolvm.cli.pack uses a module listed above it, which is the healthy direction.
smolvm.cli.pack uses smolvm.agent.client, so a change to smolvm.agent.client can break smolvm.cli.pack, while a change to smolvm.cli.pack can't break smolvm.agent.client.
Position
Below the diagonal: smolvm.cli.pack uses a module listed above it, which is the healthy direction.
smolvm.cli.pack uses smolvm.portable_checkpoint, so a change to smolvm.portable_checkpoint can break smolvm.cli.pack, while a change to smolvm.cli.pack can't break smolvm.portable_checkpoint.
Position
Below the diagonal: smolvm.cli.pack uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.embedded.inflight, so a change to smolvm.embedded.inflight can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.embedded.inflight.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm_protocol.credentials, so a change to smolvm_protocol.credentials can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm_protocol.credentials.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm_protocol.intercept, so a change to smolvm_protocol.intercept can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm_protocol.intercept.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.agent.fork, so a change to smolvm.agent.fork can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.agent.fork.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.db, so a change to smolvm.db can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.db.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.data.network.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.embedded.handle, so a change to smolvm.embedded.handle can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.embedded.handle.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.machine_spec, so a change to smolvm.machine_spec can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.machine_spec.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.embedded.control, so a change to smolvm.embedded.control can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.embedded.control.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.embedded.runtime uses smolvm.portable_checkpoint, so a change to smolvm.portable_checkpoint can break smolvm.embedded.runtime, while a change to smolvm.embedded.runtime can't break smolvm.portable_checkpoint.
Position
Below the diagonal: smolvm.embedded.runtime uses a module listed above it, which is the healthy direction.
smolvm.engine uses smolvm.engine.containers, so a change to smolvm.engine.containers can break smolvm.engine, while a change to smolvm.engine can't break smolvm.engine.containers.
Position
Below the diagonal: smolvm.engine uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.data.disk, so a change to smolvm.data.disk can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.data.disk.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.embedded.inflight, so a change to smolvm.embedded.inflight can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.embedded.inflight.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm_cuda.proto, so a change to smolvm_cuda.proto can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm_cuda.proto.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm_network.dns_cache, so a change to smolvm_network.dns_cache can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm_network.dns_cache.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.agent.fork, so a change to smolvm.agent.fork can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.agent.fork.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.api.errors, so a change to smolvm.api.errors can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.api.errors.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.registry, so a change to smolvm.registry can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.registry.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm_pack.format, so a change to smolvm_pack.format can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm_pack.format.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.agent.manager, so a change to smolvm.agent.manager can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.agent.manager.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.api.types, so a change to smolvm.api.types can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.api.types.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.config, so a change to smolvm.config can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.config.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.portable_checkpoint, so a change to smolvm.portable_checkpoint can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.portable_checkpoint.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.api.handlers.machines uses smolvm.api.state, so a change to smolvm.api.state can break smolvm.api.handlers.machines, while a change to smolvm.api.handlers.machines can't break smolvm.api.state.
Position
Below the diagonal: smolvm.api.handlers.machines uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.data.errors, so a change to smolvm.data.errors can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.data.errors.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm_protocol.egress_rule, so a change to smolvm_protocol.egress_rule can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm_protocol.egress_rule.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.data.resources, so a change to smolvm.data.resources can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.data.resources.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.agent.client, so a change to smolvm.agent.client can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.agent.client.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.agent.manager, so a change to smolvm.agent.manager can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.agent.manager.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.data.network, so a change to smolvm.data.network can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.data.network.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.config, so a change to smolvm.config can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.config.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.cli.vm_common, so a change to smolvm.cli.vm_common can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.cli.vm_common.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.machine_spec, so a change to smolvm.machine_spec can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.machine_spec.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
smolvm.cli.machine uses smolvm.cli.pack, so a change to smolvm.cli.pack can break smolvm.cli.machine, while a change to smolvm.cli.machine can't break smolvm.cli.pack.
Position
Below the diagonal: smolvm.cli.machine uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 77% · Adequate · gated by D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
101
High / Critical
A02:2025 — Security Misconfiguration
26
High / Critical
A03:2025 — Software Supply Chain Failures
18
Medium
Roadmap
Top priorities: Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video; Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh; Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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 — 108
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 — 1400
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 — 126
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
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 59 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 — 59 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, 1586 of 1634 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 source is present (.rs, .py) and this repository declares a Cargo test suite (repository root, 260 test files), but it was not re-run: its build outgrew the 8 GB scratch ceiling (9.42 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (70 contributor(s) across 2260 commit(s) sampled, automation and bot accounts excluded). One of them holds 87% of the history; the other 69 hold 0.2% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — 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 the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — 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.
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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via ToolchainServer (.). the service did not build — `cargo build --locked --bin 'smolvm'` exited 1: info: syncing channel updates for stable-x86_64-unknown-linux-gnu
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/usr/local/rustup/tmp/st25…; runtime evidence skipped (launch chosen because 'axum' dependency in Cargo.toml, binary 'smolvm', started with its 'serve' subcommand).
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 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.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — 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. 15 further occurrence(s) are not listed individually; the score already reflects all 55.
X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality 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.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (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.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
155 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was smolvm_cuda::host::dispatch at 292. A further 10 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 Op::from_u8 at 105 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/agent/input.rs (smolvm::agent::input::keysym_to_evdev at 84), crates/smolvm-protocol/src/lib.rs (AgentRequest::log_summary at 56), src/engine/util.rs (smolvm::engine::util::signal_number at 33), src/agent/vnc_client.html (vnc_client.html.startVideo at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 35 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 Cyclomatic Complexity — start with smolvm_cuda::host::dispatch (cyclomatic 292), smolvm::agent::launcher::launch_agent_vm (cyclomatic 213), RunCmd::run (cyclomatic 121). — 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 Cyclomatic Complexity from 4.9 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.
+ 63 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 240 down to 240 or less in Cognitive Complexity — start with smolvm_cuda::host::dispatch (cognitive 467), smolvm::agent::launcher::launch_agent_vm (cognitive 467). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 2.0 to about 2.8/10, projected with the scoring formula itself and assuming each lands exactly at 240; 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 Classes8.7 / 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 80 FunctionTooLong finding(s) in God Classes — start with main.rs (11), machines.rs (10), cuda_daemon.rs (6). — One of this dimension's main actionable groups (80 warning-level).
Resolve the 72 FileTooLong finding(s) in God Classes — start with lib.rs (3), client.rs (3), main.rs (2). — One of this dimension's main actionable groups (72 warning-level).
Resolve the 36 MethodTooLong finding(s) in God Classes — start with machine.rs (7), gpu.rs (6), manager.rs (2). — One of this dimension's main actionable groups (36 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.
379 duplicated block group(s) detected. 4.5 % of the production lines (13,358 of 299,527) are in a reported copy. A further 209 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 5 of the 588 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 164 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 36 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with lib.rs (4), packer.rs (3), machines.rs (3). — One of this dimension's main actionable groups (36 warning-level).
Resolve the 35 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with extract.rs (5), lib.rs (4), machines.rs (3). — One of this dimension's main actionable groups (35 warning-level).
Resolve the 27 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with pack.rs (3), db.rs (3), main.rs (2). — One of this dimension's main actionable groups (27 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.2 / 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.
18 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 4 module(s) off the main sequence, with abstractness counted on 16 of the 18 (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: smolvm-protocol · ×4
What to do
Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 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 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with gpu.rs, client.rs, state.rs. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
30 outdated, 0 yanked direct Cargo dependencies. 78 of 79 direct crates were graded against crates.io (0 not published there, 1 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: bytes · ×30
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: 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 495 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.
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 44 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.rs (2), machine.rs, launcher.rs. — One of this dimension's main actionable groups (44 warning-level).
Detailed fixes: d15_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.
0 deducted task-comment markers across 299527 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.
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 1 documentation facets pass in full. 92 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 18 build units (Cargo) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 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: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
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).
101 finding(s): 0 critical, 99 high, 1 medium, 1 low. 90 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 40 file(s) — `bench/bench.sh` (line 197), `crates/smolvm-cuda-shim/src/lib.rs` (line 863, lines 880–881), `crates/smolvm-network/src/tcp_relay.rs` (line 2314), `docs/branch-and-checkpoint/scripts/cleanup.sh` (lines 80–83, lines 95–96, lines 117–135), `docs/branch-and-checkpoint/scripts/preflight.sh` (line 64), … (+35 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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).
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).
No action in Static Analysis (SAST) — all 90 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (90 issue-level, 0 of them charged here).
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.
Resolve the 8 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 22 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (20), REDACTED (2). — One of this dimension's main actionable groups (22 warning-level).
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 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 294 of the 312 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 6 Boundary-crossing change coupling finding(s) in Change Coupling — start with boot_config.rs (3), forkpoint.rs (3). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 6 Change coupling finding(s) in Change Coupling — start with main.rs (3), boot_config.rs, client.rs. — One of this dimension's main actionable groups (6 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 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
0/1 workload(s) run every container under a seccomp profile; 0/1 declare an AppArmor/SELinux profile.
No seccomp profileREDACTED:11
What to do
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — src/agent/vnc_client.html:22
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
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.
Do you agree with this assessment?
AC3 · Page structure4.9 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — packaging/repos/pacman-arch-index.html:2, src/agent/vnc_client.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 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.
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 dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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.
`RegistryClient.get_token` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — crates/smolvm-registry/src/client.rs:1405
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
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.
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.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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/dev-env/README.md links to `../live-resize.md`, but `docs/live-resize.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, 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/dev-env/README.md:55
What to do
Reconcile the README with reality: docs/dev-env/README.md links to `../live-resize.md`, but `docs/live-resize.md` does not exist.
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 10/13 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/smolvm-cuda-codegen`, `crates/smolvm-cuda-guest`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment automation exists and the service already exposes health probe endpoints (healthz/livez/readyz or a container healthcheck), but no manifest in this repository wires them into readiness/liveness probes, a rolling-update strategy, lifecycle hooks or a migration job — a bad release is harder to detect and reverse. If that wiring lives in a separate ops/Helm repository, document the pointer here so release safety is evidenced.
What to do
Wire the existing health endpoints into readiness/liveness probes and a rolling-update (or blue/green) strategy in the deployment manifests — or document where that wiring lives — so a bad release is caught and rolled back automatically.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.
`urllib.request.urlopen(` 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. — REDACTED:24
`reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — src/api/handlers/exec.rs:1522, src/engine/image_ops.rs:560
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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.
`run_server` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — src/cli/serve.rs:461
`serve_tcp_tls` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — src/cli/serve.rs:801
What to do
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (src/engine/supervisor.rs:448)), 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. — src/agent/websocket.rs:33
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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (src/engine/supervisor.rs:448).
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 what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
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 · 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.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
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?
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 `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info!` at line 1986 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`. — src/cuda_daemon.rs:1986
`info!` at line 556 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`. — src/cuda_host.rs:556
`warn!` at line 696 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`. — src/internal_boot.rs:696
`info!` at line 213 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`. — src/vm_exit.rs:213
`warn!` at line 215 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`. — src/vm_exit.rs:215
`debug!` at line 150 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`. — src/vm/backend/libkrun.rs:150
`debug!` at line 167 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`. — src/vm/backend/libkrun.rs:167
`debug!` at line 239 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`. — src/vm/backend/libkrun.rs:239
`debug!` at line 240 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`. — src/vm/backend/libkrun.rs:240
`debug!` at line 241 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`. — src/vm/backend/libkrun.rs:241
`debug!` at line 242 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`. — src/vm/backend/libkrun.rs:242
`debug!` at line 245 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`. — src/vm/backend/libkrun.rs:245
`warn!` at line 269 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`. — src/vm/backend/libkrun.rs:269
`warn!` at line 321 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`. — src/vm/backend/libkrun.rs:321
`warn!` at line 341 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`. — src/vm/backend/libkrun.rs:341
`warn!` at line 360 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`. — src/vm/backend/libkrun.rs:360
`warn!` at line 377 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`. — src/vm/backend/libkrun.rs:377
`debug!` at line 490 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`. — src/vm/backend/libkrun.rs:490
`debug!` at line 503 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`. — src/vm/backend/libkrun.rs:503
`debug!` at line 525 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`. — src/vm/backend/libkrun.rs:525
`debug!` at line 527 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`. — src/vm/backend/libkrun.rs:527
`debug!` at line 539 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`. — src/vm/backend/libkrun.rs:539
`debug!` at line 61 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`. — src/platform/macos.rs:61
`debug!` at line 219 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`. — src/platform/macos.rs:219
`warn!` at line 119 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`. — src/network/private_floor.rs:119
`warn!` at line 1098 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`. — src/cli/pack.rs:1098
`warn!` at line 1114 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`. — src/cli/pack.rs:1114
`warn!` at line 1785 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`. — src/cli/pack.rs:1785
`warn!` at line 1801 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`. — src/cli/pack.rs:1801
`warn!` at line 1843 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`. — src/cli/pack.rs:1843
`warn!` at line 1150 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`. — src/cli/serve.rs:1150
`warn!` at line 1907 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`. — src/agent/launcher.rs:1907
`warn!` at line 1925 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`. — src/agent/launcher.rs:1925
`warn!` at line 1941 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`. — src/agent/launcher.rs:1941
`warn!` at line 1979 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`. — src/agent/launcher.rs:1979
`info!` at line 1985 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`. — src/agent/launcher.rs:1985
`warn!` at line 2026 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`. — src/agent/launcher.rs:2026
`warn!` at line 2090 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`. — src/agent/launcher.rs:2090
`error!` at line 2174 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`. — src/agent/launcher.rs:2174
`warn!` at line 2163 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`. — src/agent/manager.rs:2163
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 — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 16 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 23 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 57 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.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; 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.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 — the service did not build — `cargo build --locked --bin 'smolvm'` exited 1: info: syncing channel updates for stable-x86_64-unknown-linux-gnu
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/usr/local/rustup/tmp/st25…; runtime evidence skipped (launch chosen because 'axum' dependency in Cargo.toml, binary 'smolvm', started with its 'serve' subcommand) This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
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 — ~7436 lines of test source are present (.rs, .py) 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 included — the .rs suite was found but not re-run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency does not read html yet; not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
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) — 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.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root ran but left no coverage of the workspace's own crates. 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 (2 of 3 signals for this style — below the bar we score at): 64 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage 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.
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (298,633 lines), c (351 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Boundary-crossing change coupling: boot_config.rs ↔ machine.rs src/agent/boot_config.rs:1— `src/agent/boot_config.rs` (context agent) and `src/cli/machine.rs` (context cli) sit in DIFFERENT parts of the tree yet change together 91% of the time (10 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `da8509e6` Stop a machine's workload gracefully and keep its output in a workloa…; `5e9d3584` External egress interceptor (#1405); `b310083f` feat: add --expose-socket and --mount-socket for forwarding arbitrary… — run `git show` on any of them.
Boundary-crossing change coupling: boot_config.rs ↔ vm_common.rs src/agent/boot_config.rs:1— `src/agent/boot_config.rs` (context agent) and `src/cli/vm_common.rs` (context cli) sit in DIFFERENT parts of the tree yet change together 82% of the time (9 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `da8509e6` Stop a machine's workload gracefully and keep its output in a workloa…; `5e9d3584` External egress interceptor (#1405); `b310083f` feat: add --expose-socket and --mount-socket for forwarding arbitrary… — run `git show` on any of them.
Boundary-crossing change coupling: boot_config.rs ↔ smolfile.rs src/agent/boot_config.rs:1— `src/agent/boot_config.rs` (context agent) and `src/cli/smolfile.rs` (context cli) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `da8509e6` Stop a machine's workload gracefully and keep its output in a workloa…; `b310083f` feat: add --expose-socket and --mount-socket for forwarding arbitrary…; `b000644e` feat: expose the guest Docker daemon socket to the host over vsock — run `git show` on any of them.
Boundary-crossing change coupling: forkpoint.rs ↔ launcher.rs crates/smolvm-protocol/src/forkpoint.rs:1— `crates/smolvm-protocol/src/forkpoint.rs` (context crates) and `src/agent/launcher.rs` (context agent) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `0fa81825` Share active branch memory and guard host capacity (#1204); `62d9b9e9` Keep a released clone alive when the branch helper is its main proces…; `78e5250f` Park idle branchpoints until capture (#1147) — run `git show` on any of them.
Boundary-crossing change coupling: forkpoint.rs ↔ vm_common.rs crates/smolvm-protocol/src/forkpoint.rs:1— `crates/smolvm-protocol/src/forkpoint.rs` (context crates) and `src/cli/vm_common.rs` (context cli) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `62d9b9e9` Keep a released clone alive when the branch helper is its main proces…; `a7eb7885` Make branching the primary machine lifecycle (#1118); `c993b1b0` Support nested machine checkpoints (#1062) — run `git show` on any of them.
Boundary-crossing change coupling: forkpoint.rs ↔ manager.rs crates/smolvm-protocol/src/forkpoint.rs:1— `crates/smolvm-protocol/src/forkpoint.rs` (context crates) and `src/agent/manager.rs` (context agent) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `62d9b9e9` Keep a released clone alive when the branch helper is its main proces…; `78e5250f` Park idle branchpoints until capture (#1147); `a68f0429` Harden post-training CUDA pools (#886) — run `git show` on any of them.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×1
Query writes persistent state on the read path: RegistryClient.get_token crates/smolvm-registry/src/client.rs:1405— `RegistryClient.get_token` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
smolvm::agent::launcher::launch_agent_vm (cognitive 467) src/agent/launcher.rs:677— smolvm::agent::launcher::launch_agent_vm has cognitive complexity 467 (threshold 15). Drivers by points: if/else 177 (355 pts), match/switch 28 (77 pts), loops 10 (25 pts), boolean chains 10 (nesting depth added 242). 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.
smolvm::cuda_daemon::spawn_clone_worker (cognitive 201) src/cuda_daemon.rs:5348— smolvm::cuda_daemon::spawn_clone_worker has cognitive complexity 201 (threshold 15). Drivers by points: if/else 63 (108 pts), loops 17 (50 pts), match/switch 13 (35 pts), boolean chains 8 (nesting depth added 100). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic (cognitive 176) src/agent/launcher_dynamic.rs:119— smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic has cognitive complexity 176 (threshold 15). Drivers by points: if/else 68 (115 pts), match/switch 16 (50 pts), loops 6 (7 pts), boolean chains 4 (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::portable_checkpoint::capture_with_completion (cognitive 167) src/portable_checkpoint.rs:2043— smolvm::portable_checkpoint::capture_with_completion has cognitive complexity 167 (threshold 15). Drivers by points: if/else 86 (114 pts), boolean chains 28, match/switch 13 (24 pts), loops 1 (nesting depth added 39). 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.
smolvm::cuda_daemon::reconstruct_golden_memory (cognitive 143) src/cuda_daemon.rs:2843— smolvm::cuda_daemon::reconstruct_golden_memory has cognitive complexity 143 (threshold 15). Drivers by points: if/else 36 (91 pts), loops 9 (25 pts), match/switch 6 (22 pts), boolean chains 5 (nesting depth added 87). 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.
smolvm::cuda_daemon::write_module_handoff (cognitive 118) src/cuda_daemon.rs:5061— smolvm::cuda_daemon::write_module_handoff has cognitive complexity 118 (threshold 15). Drivers by points: if/else 46 (96 pts), loops 13 (21 pts), boolean chains 1 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::agent::fork::prepare_forks_reusing (cognitive 115) src/agent/fork.rs:2670— smolvm::agent::fork::prepare_forks_reusing has cognitive complexity 115 (threshold 15). Drivers by points: if/else 44 (80 pts), match/switch 8 (17 pts), boolean chains 10, loops 5 (8 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::internal_boot::run (cognitive 107) src/internal_boot.rs:78— smolvm::internal_boot::run has cognitive complexity 107 (threshold 15). Drivers by points: if/else 52 (82 pts), match/switch 9 (14 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 38). Of this number, 101 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::cli::vm_common::start_vm_named_with_db (cognitive 98) src/cli/vm_common.rs:1707— smolvm::cli::vm_common::start_vm_named_with_db has cognitive complexity 98 (threshold 15). Drivers by points: if/else 53 (80 pts), boolean chains 8, match/switch 3 (7 pts), loops 1 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::api::memory_pressure::run (cognitive 91) src/api/memory_pressure.rs:647— smolvm::api::memory_pressure::run has cognitive complexity 91 (threshold 15). Drivers by points: if/else 20 (69 pts), match/switch 4 (14 pts), boolean chains 7, loops 1 (nesting depth added 59). 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.
smolvm::api::handlers::machines::create_machine_to_end (cognitive 76) src/api/handlers/machines.rs:2657— smolvm::api::handlers::machines::create_machine_to_end has cognitive complexity 76 (threshold 15). Drivers by points: if/else 44 (60 pts), match/switch 6 (10 pts), boolean chains 6 (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.
smolvm::cli::vm_common::list_vms (cognitive 74) src/cli/vm_common.rs:3734— smolvm::cli::vm_common::list_vms has cognitive complexity 74 (threshold 15). Drivers by points: if/else 19 (43 pts), loops 6 (20 pts), match/switch 2 (10 pts), boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::portable_checkpoint::install_with (cognitive 73) src/portable_checkpoint.rs:6150— smolvm::portable_checkpoint::install_with has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (56 pts), loops 7 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 40). 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.
smolvm::api::handlers::machines::start_machine (cognitive 71) src/api/handlers/machines.rs:3590— smolvm::api::handlers::machines::start_machine has cognitive complexity 71 (threshold 15). Drivers by points: if/else 37 (57 pts), boolean chains 9, 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.
smolvm::cuda_daemon::reconstruct_golden_modules (cognitive 68) src/cuda_daemon.rs:3311— smolvm::cuda_daemon::reconstruct_golden_modules has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 13 (29 pts), match/switch 2 (4 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.
smolvm::engine::containers::resolve_mounts (cognitive 68) src/engine/containers.rs:741— smolvm::engine::containers::resolve_mounts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (44 pts), match/switch 5 (11 pts), loops 8 (9 pts), boolean chains 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::agent::vnc::run_client (cognitive 65) src/agent/vnc.rs:468— smolvm::agent::vnc::run_client has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 12, match/switch 3 (9 pts), loops 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::portable_checkpoint::stage_disk_chains_with_links (cognitive 62) src/portable_checkpoint.rs:5024— smolvm::portable_checkpoint::stage_disk_chains_with_links has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 7 (22 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::cuda_daemon::route_clone_connection (cognitive 60) src/cuda_daemon.rs:3968— smolvm::cuda_daemon::route_clone_connection has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (47 pts), match/switch 6 (9 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm::api::handlers::exec::log_event_stream (cognitive 55) src/api/handlers/exec.rs:1059— smolvm::api::handlers::exec::log_event_stream has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (44 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (2 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.
smolvm::api::handlers::exec_sessions::attach (cognitive 53) src/api/handlers/exec_sessions.rs:680— smolvm::api::handlers::exec_sessions::attach has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 7 (16 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::agent::vnc::read_client_messages (cognitive 51) src/agent/vnc.rs:740— smolvm::agent::vnc::read_client_messages has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (37 pts), loops 3 (8 pts), match/switch 2 (6 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::api::handlers::machines::restore_portable_checkpoint (cognitive 48) src/api/handlers/machines.rs:2094— smolvm::api::handlers::machines::restore_portable_checkpoint has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (36 pts), loops 2 (6 pts), boolean chains 3, match/switch 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm::cuda_host::start_with_clone_mode (cognitive 42) src/cuda_host.rs:53— smolvm::cuda_host::start_with_clone_mode has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm::cli::vm_common::fork_vm_batch (cognitive 41) src/cli/vm_common.rs:1136— smolvm::cli::vm_common::fork_vm_batch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 3 (4 pts), boolean chains 3, 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.
FunctionTooLong: smolvm::agent::launcher::launch_agent_vm src/agent/launcher.rs:677— FunctionTooLong — smolvm::agent::launcher::launch_agent_vm runs 1322 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 1222 over it, 13.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_cuda::host::dispatch crates/smolvm-cuda/src/host.rs:4714— FunctionTooLong — smolvm_cuda::host::dispatch runs 1246 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 1146 over it, 12.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::portable_checkpoint::capture_with_completion src/portable_checkpoint.rs:2043— FunctionTooLong — smolvm::portable_checkpoint::capture_with_completion runs 665 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 565 over it, 6.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_cuda::proto::encode_request crates/smolvm-cuda/src/proto.rs:976— FunctionTooLong — smolvm_cuda::proto::encode_request 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: smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic src/agent/launcher_dynamic.rs:119— FunctionTooLong — smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic runs 531 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 431 over it, 5.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::cuda_daemon::spawn_clone_worker src/cuda_daemon.rs:5348— FunctionTooLong — smolvm::cuda_daemon::spawn_clone_worker runs 478 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 378 over it, 4.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::api::handlers::machines::create_machine_to_end src/api/handlers/machines.rs:2657— FunctionTooLong — smolvm::api::handlers::machines::create_machine_to_end runs 397 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 297 over it, 3.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::internal_boot::run src/internal_boot.rs:78— FunctionTooLong — smolvm::internal_boot::run runs 376 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 276 over it, 3.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: smolvm::agent::fork::prepare_forks_reusing src/agent/fork.rs:2670— FunctionTooLong — smolvm::agent::fork::prepare_forks_reusing runs 350 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::api::handlers::machines::start_machine src/api/handlers/machines.rs:3590— FunctionTooLong — smolvm::api::handlers::machines::start_machine runs 344 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 244 over it, 3.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_cuda::proto::decode_request crates/smolvm-cuda/src/proto.rs:1674— FunctionTooLong — smolvm_cuda::proto::decode_request runs 334 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 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_agent::handle_request crates/smolvm-agent/src/main.rs:2714— FunctionTooLong — smolvm_agent::handle_request runs 314 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 214 over it, 3.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::cli::smolfile::build_create_spec src/cli/smolfile.rs:111— FunctionTooLong — smolvm::cli::smolfile::build_create_spec runs 297 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 197 over it, 2.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_agent::storage::pull_image_with_progress_and_auth crates/smolvm-agent/src/storage.rs:3244— FunctionTooLong — smolvm_agent::storage::pull_image_with_progress_and_auth runs 292 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_network::stack::run_network_stack crates/smolvm-network/src/stack.rs:265— FunctionTooLong — smolvm_network::stack::run_network_stack runs 289 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 189 over it, 2.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: smolvm::cuda_daemon::reconstruct_golden_memory src/cuda_daemon.rs:2843— FunctionTooLong — smolvm::cuda_daemon::reconstruct_golden_memory runs 289 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 189 over it, 2.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: smolvm::cli::vm_common::start_vm_named_with_db src/cli/vm_common.rs:1707— FunctionTooLong — smolvm::cli::vm_common::start_vm_named_with_db runs 288 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 188 over it, 2.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: smolvm_agent::handle_run_detached crates/smolvm-agent/src/main.rs:4741— FunctionTooLong — smolvm_agent::handle_run_detached runs 272 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 172 over it, 2.72× 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: smolvm_pack::extract::safe_unpack_skipping crates/smolvm-pack/src/extract.rs:986— FunctionTooLong — smolvm_pack::extract::safe_unpack_skipping runs 246 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 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_cuda::host::serve_rings crates/smolvm-cuda/src/host.rs:3394— FunctionTooLong — smolvm_cuda::host::serve_rings runs 231 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 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::engine::containers::resolve_mounts src/engine/containers.rs:741— FunctionTooLong — smolvm::engine::containers::resolve_mounts runs 228 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm::api::handlers::machines::restore_portable_checkpoint src/api/handlers/machines.rs:2094— FunctionTooLong — smolvm::api::handlers::machines::restore_portable_checkpoint 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.
FunctionTooLong: smolvm::cli::pack_run::daemon_start src/cli/pack_run.rs:2270— FunctionTooLong — smolvm::cli::pack_run::daemon_start runs 197 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 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: smolvm_agent::setup_persistent_rootfs crates/smolvm-agent/src/main.rs:1265— FunctionTooLong — smolvm_agent::setup_persistent_rootfs runs 196 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 96 over it, 1.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: smolvm::cli::pack_run::run_from_cache src/cli/pack_run.rs:1858— FunctionTooLong — smolvm::cli::pack_run::run_from_cache runs 195 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 95 over it, 1.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.
FileTooLong: src/main.rs crates/smolvm-agent/src/main.rs— FileTooLong — 5319 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 145 free functions. The bar is 500 significant lines; this is 4819 over it, 10.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/host.rs crates/smolvm-cuda/src/host.rs— FileTooLong — 4500 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 130 free functions. The bar is 500 significant lines; this is 4000 over it, 9.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: handlers/machines.rs src/api/handlers/machines.rs— FileTooLong — 4464 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 109 free functions. The bar is 500 significant lines; this is 3964 over it, 8.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/portable_checkpoint.rs src/portable_checkpoint.rs— FileTooLong — 4384 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 170 free functions. The bar is 500 significant lines; this is 3884 over it, 8.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/lib.rs crates/smolvm-cudart-shim/src/lib.rs— FileTooLong — 4222 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 242 free functions. The bar is 500 significant lines; this is 3722 over it, 8.44× 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: cli/machine.rs src/cli/machine.rs— FileTooLong — 4183 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 3683 over it, 8.37× 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/storage.rs crates/smolvm-agent/src/storage.rs— FileTooLong — 4092 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 168 free functions. The bar is 500 significant lines; this is 3592 over it, 8.18× 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/cuda_daemon.rs src/cuda_daemon.rs— FileTooLong — 4076 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 142 free functions. The bar is 500 significant lines; this is 3576 over it, 8.15× 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: host/gpu.rs crates/smolvm-cuda/src/host/gpu.rs— FileTooLong — 3200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: GpuBackend (5 blocks, 97-4324). The bar is 500 significant lines; this is 2700 over it, 6.40× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: agent/fork.rs src/agent/fork.rs— FileTooLong — 2904 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 125 free functions. The bar is 500 significant lines; this is 2404 over it, 5.81× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/extract.rs crates/smolvm-pack/src/extract.rs— FileTooLong — 2891 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 129 free functions. The bar is 500 significant lines; this is 2391 over it, 5.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs crates/smolvm-cuda-shim/src/lib.rs— FileTooLong — 2806 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 217 free functions. The bar is 500 significant lines; this is 2306 over it, 5.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: agent/manager.rs src/agent/manager.rs— FileTooLong — 2508 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 64% of them inside a single declaration: AgentManager (3 blocks, 1676-4825), declaring 82 free functions. The bar is 500 significant lines; this is 2008 over it, 5.02× 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: cli/vm_common.rs src/cli/vm_common.rs— FileTooLong — 2437 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 77 free functions. The bar is 500 significant lines; this is 1937 over it, 4.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/process.rs src/process.rs— FileTooLong — 2436 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 115 free functions. The bar is 500 significant lines; this is 1936 over it, 4.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: agent/client.rs src/agent/client.rs— FileTooLong — 2270 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: AgentClient (2 blocks, 1115-4031). The bar is 500 significant lines; this is 1770 over it, 4.54× 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/store.rs crates/smolvm-checkpoint/src/store.rs— FileTooLong — 2100 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 1600 over it, 4.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: agent/launcher.rs src/agent/launcher.rs— FileTooLong — 1941 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 1441 over it, 3.88× 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: engine/containers.rs src/engine/containers.rs— FileTooLong — 1896 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 53 free functions. The bar is 500 significant lines; this is 1396 over it, 3.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/proto.rs crates/smolvm-cuda/src/proto.rs— FileTooLong — 1689 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 1189 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: cli/pack_run.rs src/cli/pack_run.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), declaring 38 free functions. The bar is 500 significant lines; this is 1162 over it, 3.32× 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/db.rs src/db.rs— FileTooLong — 1619 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: SmolvmDb (3 blocks, 196-2384). The bar is 500 significant lines; this is 1119 over it, 3.24× 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: api/rollout.rs src/api/rollout.rs— FileTooLong — 1488 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 988 over it, 2.98× 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: cli/pack.rs src/cli/pack.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). 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.
FileTooLong: src/client.rs crates/smolvm-cuda/src/client.rs— FileTooLong — 1328 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: Client (2 blocks, 209-2152). The bar is 500 significant lines; this is 828 over it, 2.66× 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.
smolvm::agent::launcher::launch_agent_vm (cyclomatic 213) src/agent/launcher.rs:677— smolvm::agent::launcher::launch_agent_vm has cyclomatic complexity 213 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::portable_checkpoint::capture_with_completion (cyclomatic 115) src/portable_checkpoint.rs:2043— smolvm::portable_checkpoint::capture_with_completion has cyclomatic complexity 115 (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.
smolvm::cuda_daemon::spawn_clone_worker (cyclomatic 93) src/cuda_daemon.rs:5348— smolvm::cuda_daemon::spawn_clone_worker has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic (cyclomatic 91) src/agent/launcher_dynamic.rs:119— smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::internal_boot::run (cyclomatic 65) src/internal_boot.rs:78— smolvm::internal_boot::run has cyclomatic complexity 65 (threshold 15). Of this number, 62 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::agent::fork::prepare_forks_reusing (cyclomatic 64) src/agent/fork.rs:2670— smolvm::agent::fork::prepare_forks_reusing has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::cli::vm_common::start_vm_named_with_db (cyclomatic 61) src/cli/vm_common.rs:1707— smolvm::cli::vm_common::start_vm_named_with_db has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::cuda_daemon::write_module_handoff (cyclomatic 61) src/cuda_daemon.rs:5061— smolvm::cuda_daemon::write_module_handoff has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::cuda_daemon::reconstruct_golden_memory (cyclomatic 54) src/cuda_daemon.rs:2843— smolvm::cuda_daemon::reconstruct_golden_memory has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::api::handlers::machines::create_machine_to_end (cyclomatic 51) src/api/handlers/machines.rs:2657— smolvm::api::handlers::machines::create_machine_to_end has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::api::handlers::machines::start_machine (cyclomatic 49) src/api/handlers/machines.rs:3590— smolvm::api::handlers::machines::start_machine 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.
smolvm::engine::containers::resolve_mounts (cyclomatic 40) src/engine/containers.rs:741— smolvm::engine::containers::resolve_mounts 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.
smolvm::agent::vnc::run_client (cyclomatic 36) src/agent/vnc.rs:468— smolvm::agent::vnc::run_client 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.
smolvm::api::memory_pressure::run (cyclomatic 34) src/api/memory_pressure.rs:647— smolvm::api::memory_pressure::run 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.
smolvm::portable_checkpoint::install_with (cyclomatic 33) src/portable_checkpoint.rs:6150— smolvm::portable_checkpoint::install_with 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.
smolvm::cuda_daemon::reconstruct_golden_modules (cyclomatic 32) src/cuda_daemon.rs:3311— smolvm::cuda_daemon::reconstruct_golden_modules 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.
smolvm::api::handlers::exec::log_event_stream (cyclomatic 31) src/api/handlers/exec.rs:1059— smolvm::api::handlers::exec::log_event_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.
smolvm::cuda_daemon::route_clone_connection (cyclomatic 31) src/cuda_daemon.rs:3968— smolvm::cuda_daemon::route_clone_connection 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.
smolvm::api::handlers::exec_sessions::attach (cyclomatic 29) src/api/handlers/exec_sessions.rs:680— smolvm::api::handlers::exec_sessions::attach 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.
smolvm::portable_checkpoint::stage_disk_chains_with_links (cyclomatic 29) src/portable_checkpoint.rs:5024— smolvm::portable_checkpoint::stage_disk_chains_with_links 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.
smolvm::api::handlers::machines::restore_portable_checkpoint (cyclomatic 28) src/api/handlers/machines.rs:2094— smolvm::api::handlers::machines::restore_portable_checkpoint 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.
smolvm::cli::vm_common::fork_vm_batch (cyclomatic 27) src/cli/vm_common.rs:1136— smolvm::cli::vm_common::fork_vm_batch has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::engine::exec::start (cyclomatic 27) src/engine/exec.rs:129— smolvm::engine::exec::start has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::portable_checkpoint::validate_compatibility (cyclomatic 27) src/portable_checkpoint.rs:5441— smolvm::portable_checkpoint::validate_compatibility has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm::api::rollout::validate_generate_request (cyclomatic 26) src/api/rollout.rs:1873— smolvm::api::rollout::validate_generate_request 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.
Hotspot: src/cli/machine.rs src/cli/machine.rs:1405— src/cli/machine.rs changed 135 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in RunCmd::run at line 1405. 5 of those changes were fix/bug commits, and the other 130 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/cli/machine.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/agent/launcher.rs src/agent/launcher.rs:677— src/agent/launcher.rs changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 213 in smolvm::agent::launcher::launch_agent_vm at line 677. 1 of those changes was a fix/bug commit, and the other 71 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/agent/launcher.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/portable_checkpoint.rs src/portable_checkpoint.rs:2043— src/portable_checkpoint.rs changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 115 in smolvm::portable_checkpoint::capture_with_completion at line 2043. 2 of those changes were fix/bug commits, and the other 88 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/portable_checkpoint.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/api/handlers/machines.rs src/api/handlers/machines.rs:2657— src/api/handlers/machines.rs changed 126 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in smolvm::api::handlers::machines::create_machine_to_end at line 2657. 6 of those changes were fix/bug commits, and the other 120 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/api/handlers/machines.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-agent/src/main.rs crates/smolvm-agent/src/main.rs:2714— crates/smolvm-agent/src/main.rs changed 93 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in smolvm_agent::handle_request at line 2714. 1 of those changes was a fix/bug commit, and the other 92 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-agent/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/agent/manager.rs src/agent/manager.rs:3167— src/agent/manager.rs changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in AgentManager::start_via_subprocess at line 3167. 2 of those changes were fix/bug commits, and the other 66 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/agent/manager.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cli/vm_common.rs src/cli/vm_common.rs:1707— src/cli/vm_common.rs changed 92 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in smolvm::cli::vm_common::start_vm_named_with_db at line 1707. 3 of those changes were fix/bug commits, and the other 89 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/cli/vm_common.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/agent/fork.rs src/agent/fork.rs:2670— src/agent/fork.rs changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in smolvm::agent::fork::prepare_forks_reusing at line 2670. 5 of those changes were fix/bug commits, and the other 74 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/agent/fork.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/agent/launcher_dynamic.rs src/agent/launcher_dynamic.rs:119— src/agent/launcher_dynamic.rs changed 49 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in smolvm::agent::launcher_dynamic::launch_agent_vm_dynamic at line 119. 1 of those changes was a fix/bug commit, and the other 48 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/agent/launcher_dynamic.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-pack/src/extract.rs crates/smolvm-pack/src/extract.rs:986— crates/smolvm-pack/src/extract.rs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in smolvm_pack::extract::safe_unpack_skipping at line 986. 4 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-pack/src/extract.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/internal_boot.rs src/internal_boot.rs:78— src/internal_boot.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in smolvm::internal_boot::run at line 78. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/internal_boot.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/config.rs src/config.rs:1601— src/config.rs changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in VmRecord::updated_egress at line 1601. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-agent/src/storage.rs crates/smolvm-agent/src/storage.rs:3244— crates/smolvm-agent/src/storage.rs changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in smolvm_agent::storage::pull_image_with_progress_and_auth at line 3244. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-agent/src/storage.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cli/pack.rs src/cli/pack.rs:683— src/cli/pack.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in PackCreateCmd::run at line 683. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/cli/pack.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/agent/client.rs src/agent/client.rs:2978— src/agent/client.rs changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in AgentClient::interactive_session_io_started at line 2978. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/agent/client.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-network/src/stack.rs crates/smolvm-network/src/stack.rs:265— crates/smolvm-network/src/stack.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in smolvm_network::stack::run_network_stack at line 265. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-network/src/stack.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cli/pack_run.rs src/cli/pack_run.rs:472— src/cli/pack_run.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in PackRunCmd::run at line 472. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/cli/pack_run.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-cuda/src/host.rs crates/smolvm-cuda/src/host.rs:4714— crates/smolvm-cuda/src/host.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 292 in smolvm_cuda::host::dispatch at line 4714. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-cuda/src/host.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cli/serve.rs src/cli/serve.rs:461— src/cli/serve.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ServeStartCmd::run_server at line 461. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/cli/serve.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cli/smolfile.rs src/cli/smolfile.rs:111— src/cli/smolfile.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in smolvm::cli::smolfile::build_create_spec at line 111. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/cli/smolfile.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/embedded/runtime.rs src/embedded/runtime.rs:259— src/embedded/runtime.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in EmbeddedRuntime::pause_machine_inner at line 259. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/embedded/runtime.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/pack_export.rs src/pack_export.rs:759— src/pack_export.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in smolvm::pack_export::reap_stale_export_scratch_in at line 759. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/pack_export.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-s3fs/src/fs.rs crates/smolvm-s3fs/src/fs.rs:710— crates/smolvm-s3fs/src/fs.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in S3Fs::dispatch at line 710. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-s3fs/src/fs.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/api/handlers/exec.rs src/api/handlers/exec.rs:1059— src/api/handlers/exec.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in smolvm::api::handlers::exec::log_event_stream at line 1059. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- src/api/handlers/exec.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/smolvm-network/src/tcp_relay.rs crates/smolvm-network/src/tcp_relay.rs:1367— crates/smolvm-network/src/tcp_relay.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in smolvm_network::tcp_relay::open_relay_target at line 1367. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 20:30:22 +09:00' --until='2026-11-14 20:30:22 +09:00' --full-history --no-merges -- crates/smolvm-network/src/tcp_relay.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.
smolvm_agent::run_interactive_loop_io (cognitive 110) crates/smolvm-agent/src/main.rs:6498— smolvm_agent::run_interactive_loop_io has cognitive complexity 110 (threshold 15). Drivers by points: if/else 33 (75 pts), match/switch 6 (22 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::run_interactive_loop_pty (cognitive 77) crates/smolvm-agent/src/main.rs:6803— smolvm_agent::run_interactive_loop_pty has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (47 pts), match/switch 6 (19 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::handle_connection (cognitive 66) crates/smolvm-agent/src/main.rs:2368— smolvm_agent::handle_connection has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28 (58 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::storage::pull_image_with_progress_and_auth (cognitive 63) crates/smolvm-agent/src/storage.rs:3244— smolvm_agent::storage::pull_image_with_progress_and_auth has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (36 pts), loops 7 (14 pts), match/switch 4 (10 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::container::prepare (cognitive 46) crates/smolvm-agent/src/container.rs:84— smolvm_agent::container::prepare has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 3 (8 pts), loops 5 (6 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.
smolvm_agent::setup_persistent_rootfs (cognitive 41) crates/smolvm-agent/src/main.rs:1265— smolvm_agent::setup_persistent_rootfs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::process::wait_with_timeout_cleanup_and_liveness (cognitive 37) crates/smolvm-agent/src/process.rs:653— smolvm_agent::process::wait_with_timeout_cleanup_and_liveness has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 3 (6 pts), loops 5 (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.
smolvm_agent::handle_vm_exec (cognitive 36) crates/smolvm-agent/src/main.rs:8713— smolvm_agent::handle_vm_exec has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (27 pts), match/switch 3 (6 pts), loops 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::handle_run_detached (cognitive 34) crates/smolvm-agent/src/main.rs:4741— smolvm_agent::handle_run_detached has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 11 (16 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.
smolvm_agent::storage::garbage_collect (cognitive 34) crates/smolvm-agent/src/storage.rs:3953— smolvm_agent::storage::garbage_collect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 3 (9 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_agent::main (cognitive 33) crates/smolvm-agent/src/main.rs:347— smolvm_agent::main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27 (28 pts), boolean chains 3, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
smolvm_agent::storage::oci_archive_compatibility (cognitive 31) crates/smolvm-agent/src/storage.rs:2020— smolvm_agent::storage::oci_archive_compatibility has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 6, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::storage::setup_volume_mounts (cognitive 30) crates/smolvm-agent/src/storage.rs:5521— smolvm_agent::storage::setup_volume_mounts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::spawn_exec_in_container (cognitive 29) crates/smolvm-agent/src/main.rs:5606— smolvm_agent::spawn_exec_in_container has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 3 (8 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.
smolvm_agent::rosetta_tracer::linux::serve (cognitive 28) crates/smolvm-agent/src/rosetta_tracer.rs:228— smolvm_agent::rosetta_tracer::linux::serve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::cuda::find_rpath_pinned_libs (cognitive 27) crates/smolvm-agent/src/cuda.rs:249— smolvm_agent::cuda::find_rpath_pinned_libs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 5, match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::publish_socket::relay (cognitive 27) crates/smolvm-agent/src/publish_socket.rs:319— smolvm_agent::publish_socket::relay has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::relay::relay_half_close (cognitive 27) crates/smolvm-agent/src/relay.rs:17— smolvm_agent::relay::relay_half_close has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::spawn_crun_run (cognitive 25) crates/smolvm-agent/src/main.rs:6237— smolvm_agent::spawn_crun_run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::forkpoint::run_helper_at (cognitive 24) crates/smolvm-agent/src/forkpoint.rs:296— smolvm_agent::forkpoint::run_helper_at has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_agent::pod::handle_pod_signal (cognitive 24) crates/smolvm-agent/src/pod.rs:564— smolvm_agent::pod::handle_pod_signal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 4 (6 pts), 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.
smolvm_agent::handle_request (cognitive 23) crates/smolvm-agent/src/main.rs:2714— smolvm_agent::handle_request has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 9 (16 pts), if/else 5 (7 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.
smolvm_agent::storage::mount_cache_disk (cognitive 23) crates/smolvm-agent/src/storage.rs:959— smolvm_agent::storage::mount_cache_disk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 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.
smolvm_agent::setup_gpu_dev_nodes (cognitive 21) crates/smolvm-agent/src/main.rs:1030— smolvm_agent::setup_gpu_dev_nodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2, 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.
smolvm_agent::pod::write_pod_bundle (cognitive 21) crates/smolvm-agent/src/pod.rs:886— smolvm_agent::pod::write_pod_bundle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MethodTooLong: RunCmd.run src/cli/machine.rs:1405— MethodTooLong — run runs 797 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 697 over it, 7.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AgentManager.start_via_subprocess src/agent/manager.rs:3167— MethodTooLong — start_via_subprocess runs 448 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 348 over it, 4.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GpuBackend.cuda_driver_library_call crates/smolvm-cuda/src/host/gpu.rs:745— MethodTooLong — cuda_driver_library_call runs 296 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PackRunCmd.run src/cli/pack_run.rs:472— MethodTooLong — run runs 293 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 193 over it, 2.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.
MethodTooLong: S3Fs.dispatch crates/smolvm-s3fs/src/fs.rs:710— MethodTooLong — dispatch runs 277 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: State.forward crates/smolvm-credentials/src/intercept.rs:470— MethodTooLong — forward runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: UpdateCmd.run src/cli/machine.rs:7170— MethodTooLong — run 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.
MethodTooLong: PackCreateCmd.run src/cli/pack.rs:683— MethodTooLong — run runs 245 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 145 over it, 2.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: CudnnBn.dispatch crates/smolvm-cuda/src/host/gpu.rs:3566— MethodTooLong — dispatch runs 214 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 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateCmd.run_from_smolmachine src/cli/machine.rs:5375— MethodTooLong — run_from_smolmachine runs 200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SmolvmDb.claim_fork_pool_slot src/db.rs:1545— MethodTooLong — claim_fork_pool_slot runs 195 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 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MonitorCmd.run src/cli/machine.rs:8250— MethodTooLong — run runs 194 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 94 over it, 1.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LibkrunVm.exec_vm src/vm/backend/libkrun.rs:101— MethodTooLong — exec_vm 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: CreateCmd.create_spec src/cli/machine.rs:5148— MethodTooLong — create_spec runs 184 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 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ServeStartCmd.run_server src/cli/serve.rs:461— MethodTooLong — run_server 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: PoolAdmissionState.observe src/api/admission.rs:251— MethodTooLong — observe runs 174 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 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GpuBackend.load crates/smolvm-cuda/src/host/gpu.rs:554— MethodTooLong — load runs 172 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 72 over it, 1.72× 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: CublasLt.dispatch crates/smolvm-cuda/src/host/gpu.rs:3089— MethodTooLong — dispatch runs 157 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 57 over it, 1.57× 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: GpuBackend.graph_exec_patch crates/smolvm-cuda/src/host/gpu.rs:2133— MethodTooLong — graph_exec_patch runs 155 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 55 over it, 1.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: NvmlSampler.new src/api/admission.rs:1034— MethodTooLong — new runs 149 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 49 over it, 1.49× 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: ExecCmd.run src/cli/machine.rs:4290— MethodTooLong — run runs 140 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 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RolloutExecutor.publish_device_policy src/api/rollout.rs:1102— MethodTooLong — publish_device_policy runs 133 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 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateVmParams.to_create_spec src/cli/vm_common.rs:745— MethodTooLong — to_create_spec runs 127 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 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ForkPoolController.fill_pool src/api/pool_controller.rs:541— MethodTooLong — fill_pool runs 123 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 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AgentManager.wait_for_ready src/agent/manager.rs:4505— MethodTooLong — wait_for_ready runs 122 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 22 over it, 1.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.
Duplicated block (8 lines × 2) crates/smolvm-agent/src/main.rs:6780— crates/smolvm-agent/src/main.rs:6780-6787 | crates/smolvm-agent/src/main.rs:7038-7045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6780` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:94— crates/smolvm-cuda-shim/src/lib.rs:94-101 | crates/smolvm-cudart-shim/src/lib.rs:1289-1296 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (8 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:638— crates/smolvm-cuda-shim/src/lib.rs:638-645 | crates/smolvm-cuda-shim/src/lib.rs:648-655 — both copies are in the same file, so extract the 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 (8 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:1803— crates/smolvm-cuda-shim/src/lib.rs:1803-1810 | crates/smolvm-cuda-shim/src/lib.rs:4140-4147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:1803` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:2105— crates/smolvm-cuda-shim/src/lib.rs:2105-2112 | crates/smolvm-cuda-shim/src/lib.rs:2121-2128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:2105` it does not close everything it opens, so those 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 `out` to `*mut u64` in one and `*mut c_uint` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/smolvm-cuda/src/client.rs:607— crates/smolvm-cuda/src/client.rs:607-614 | crates/smolvm-cuda/src/client.rs:882-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/client.rs:607` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/smolvm-cuda/src/host/gpu.rs:2153— crates/smolvm-cuda/src/host/gpu.rs:2153-2160 | crates/smolvm-cuda/src/host/gpu.rs:2401-2408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/smolvm-pack/src/packer.rs:869— crates/smolvm-pack/src/packer.rs:869-876 | crates/smolvm-pack/src/packer.rs:915-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/packer.rs:869` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/smolvm-pack/src/packer.rs:993— crates/smolvm-pack/src/packer.rs:993-1000 | crates/smolvm-pack/src/packer.rs:1025-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/packer.rs:993` it begins part-way through the construct above it, so those exact lines 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) src/agent/fork/compact.rs:556— src/agent/fork/compact.rs:556-563 | src/agent/fork/compact.rs:618-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/fork/compact.rs:556` it does not close everything it opens, so those exact lines 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) src/agent/launcher.rs:2846— src/agent/launcher.rs:2846-2853 | src/agent/launcher_dynamic.rs:1313-1320 — before extracting anything, compare `src/agent/launcher.rs` and `src/agent/launcher_dynamic.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) src/api/handlers/machines.rs:2956— src/api/handlers/machines.rs:2956-2963 | src/api/handlers/machines.rs:3924-3931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:2956` it does not close everything it opens, so those exact lines 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) src/api/handlers/machines.rs:6350— src/api/handlers/machines.rs:6350-6357 | src/api/handlers/machines.rs:7021-7028 — both copies are in the same file, so extract the block into 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) src/cli/pack_run.rs:1902— src/cli/pack_run.rs:1902-1909 | src/cli/pack_run.rs:2334-2341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/cuda_daemon.rs:3449— src/cuda_daemon.rs:3449-3456 | src/cuda_daemon.rs:3506-3513 — both copies are in the same file, so extract the block into 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) src/cuda_host.rs:410— src/cuda_host.rs:410-417 | src/cuda_host.rs:441-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_host.rs:410` 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) src/portable_checkpoint.rs:4440— src/portable_checkpoint.rs:4440-4447 | src/portable_checkpoint.rs:5034-5041 — both copies are in the same file, so extract the block into 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) src/portable_checkpoint.rs:5374— src/portable_checkpoint.rs:5374-5381 | src/portable_checkpoint.rs:5403-5410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/smolvm-network/src/stack.rs:461— crates/smolvm-network/src/stack.rs:461-468 | crates/smolvm-network/src/stack.rs:473-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 `crates/smolvm-network/src/stack.rs:461` 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) src/agent/launcher.rs:2665— src/agent/launcher.rs:2665-2672 | src/agent/launcher_dynamic.rs:886-893 — before extracting anything, compare `src/agent/launcher.rs` and `src/agent/launcher_dynamic.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src/agent/launcher_dynamic.rs:97— src/agent/launcher_dynamic.rs:97-104 | src/data/disk.rs:489-496 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/launcher_dynamic.rs:97` it does not close everything it opens, so those 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 `path` 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 (8 lines × 2) crates/smolvm-cuda/src/host.rs:3442— crates/smolvm-cuda/src/host.rs:3442-3449 | crates/smolvm-cuda/src/host.rs:3459-3466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:3442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:2842— crates/smolvm-cuda/src/host/gpu.rs:2842-2849 | crates/smolvm-cudart-shim/src/lib.rs:5284-5291 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/smolvm-network/src/publish_bind.rs:42— crates/smolvm-network/src/publish_bind.rs:42-49 | crates/smolvm-protocol/src/auto_ports.rs:112-119 — 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) src/api/cache_base_budget.rs:41— src/api/cache_base_budget.rs:41-48 | src/checkpoint_retention.rs:454-461 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/smolvm-agent/src/storage.rs:3413— crates/smolvm-agent/src/storage.rs:3413-3418 | crates/smolvm-agent/src/storage.rs:3494-3499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:3413` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/smolvm-agent/src/storage.rs:3641— crates/smolvm-agent/src/storage.rs:3641-3646 | crates/smolvm-agent/src/storage.rs:3771-3776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:119— crates/smolvm-cuda-shim/src/lib.rs:119-124 | crates/smolvm-cudart-shim/src/lib.rs:89-94 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda-shim/src/lib.rs:125` calls `Err`, `other` and `crates/smolvm-cudart-shim/src/lib.rs:95` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:131— crates/smolvm-cuda-shim/src/lib.rs:131-136 | crates/smolvm-cudart-shim/src/lib.rs:100-105 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda-shim/src/lib.rs:137` calls `Err`, `other` and `crates/smolvm-cudart-shim/src/lib.rs:106` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:156— crates/smolvm-cuda-shim/src/lib.rs:156-161 | crates/smolvm-cudart-shim/src/lib.rs:122-127 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:4133— crates/smolvm-cuda-shim/src/lib.rs:4133-4138 | crates/smolvm-cuda-shim/src/lib.rs:4157-4162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:4133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:2929— crates/smolvm-cuda/src/host/gpu.rs:2929-2934 | crates/smolvm-cuda/src/host/gpu.rs:2952-2961 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:2929` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/smolvm-network/src/dns_relay.rs:302— crates/smolvm-network/src/dns_relay.rs:302-308 | src/dns_filter.rs:99-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/smolvm-pack/src/assets.rs:260— crates/smolvm-pack/src/assets.rs:260-265 | src/checkpoint_delta.rs:331-336 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/smolvm-pack/src/extract.rs:3786— crates/smolvm-pack/src/extract.rs:3786-3791 | crates/smolvm-pack/src/extract.rs:3802-3807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-pack/src/extract.rs:3792` calls `ctime`, `ctime_nsec` and `crates/smolvm-pack/src/extract.rs:3808` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crates/smolvm-pack/src/extract.rs:5255— crates/smolvm-pack/src/extract.rs:5255-5260 | crates/smolvm-pack/src/extract.rs:5271-5276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/smolvm-pack/src/extract.rs:5535— crates/smolvm-pack/src/extract.rs:5535-5540 | crates/smolvm-pack/src/extract.rs:5604-5611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:5535` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/api/handlers/machines.rs:3660— src/api/handlers/machines.rs:3660-3665 | src/api/handlers/machines.rs:5495-5500 — both copies are in the same file, so extract the block into 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) src/api/handlers/machines.rs:5471— src/api/handlers/machines.rs:5471-5481 | src/api/handlers/machines.rs:5656-5661 — both copies are in the same file, so extract the block into 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) src/artifact_cache.rs:905— src/artifact_cache.rs:905-912 | src/artifact_cache.rs:1140-1145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/artifact_cache.rs:905` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/cli/serve.rs:785— src/cli/serve.rs:785-790 | src/cli/serve.rs:924-929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/serve.rs:785` 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) src/engine/network.rs:270— src/engine/network.rs:270-275 | src/engine/network.rs:354-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/engine/network.rs:270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/smolvm-cuda/src/proto.rs:956— crates/smolvm-cuda/src/proto.rs:956-961 | crates/smolvm-network/src/fabric.rs:139-144 — 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) src/cli/machine.rs:1788— src/cli/machine.rs:1788-1793 | src/cli/machine.rs:2272-2277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/machine.rs:1788` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/engine/network.rs:657— src/engine/network.rs:657-662 | src/engine/network.rs:1318-1323 — both copies are in the same file, so extract the block into 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) src/portable_checkpoint.rs:5697— src/portable_checkpoint.rs:5697-5702 | src/portable_checkpoint.rs:5750-5755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/smolvm-pack/src/extract.rs:3057— crates/smolvm-pack/src/extract.rs:3057-3062 | crates/smolvm-pack/src/packer.rs:122-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/smolvm-shim/src/backend.rs:131— crates/smolvm-shim/src/backend.rs:131-136 | crates/smolvm-shim/src/engine.rs:164-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src/api/handlers/machines.rs:976— src/api/handlers/machines.rs:976-981 | src/api/handlers/mounts.rs:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/smolvm-pack/src/extract.rs:3776— crates/smolvm-pack/src/extract.rs:3776-3781 | crates/smolvm-pack/src/packer.rs:224-229 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/smolvm-agent/src/main.rs:6182— crates/smolvm-agent/src/main.rs:6182-6190 | crates/smolvm-agent/src/main.rs:6353-6361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) crates/smolvm-agent/src/main.rs:6736— crates/smolvm-agent/src/main.rs:6736-6744 | crates/smolvm-agent/src/main.rs:6979-6987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/smolvm-agent/src/storage.rs:3126— crates/smolvm-agent/src/storage.rs:3126-3134 | src/agent/rootfs_store.rs:249-257 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:3412— crates/smolvm-cuda-shim/src/lib.rs:3412-3420 | crates/smolvm-cudart-shim/src/lib.rs:5017-5025 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:3412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/smolvm-cuda/src/host.rs:2921— crates/smolvm-cuda/src/host.rs:2921-2929 | crates/smolvm-cuda/src/host.rs:2951-2959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/smolvm-cuda/src/proto.rs:1260— crates/smolvm-cuda/src/proto.rs:1260-1268 | crates/smolvm-cuda/src/proto.rs:1283-1291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda/src/proto.rs:1269` calls `w_u32` and `crates/smolvm-cuda/src/proto.rs:1292` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/smolvm-registry/src/client.rs:301— crates/smolvm-registry/src/client.rs:301-309 | crates/smolvm-registry/src/client.rs:837-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 `crates/smolvm-registry/src/client.rs:301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/smolvm-registry/src/client.rs:299— crates/smolvm-registry/src/client.rs:299-307 | crates/smolvm-registry/src/client.rs:1090-1098 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/api/handlers/files.rs:131— src/api/handlers/files.rs:131-139 | src/api/handlers/files.rs:281-289 — both copies are in the same file, so extract the block into 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) src/api/handlers/machines.rs:165— src/api/handlers/machines.rs:165-173 | src/api/state.rs:2083-2091 — before extracting anything, compare `src/api/handlers/machines.rs` and `src/api/state.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) src/api/handlers/pools.rs:1194— src/api/handlers/pools.rs:1194-1202 | src/api/pool_controller.rs:519-527 — 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) src/cli/machine.rs:1681— src/cli/machine.rs:1681-1689 | src/cli/machine.rs:1843-1851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/machine.rs:1681` 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) src/cli/machine.rs:2365— src/cli/machine.rs:2365-2374 | src/cli/machine.rs:2521-2529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/machine.rs:2365` 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 (9 lines × 2) src/cli/pack.rs:792— src/cli/pack.rs:792-800 | src/cli/pack.rs:811-819 — both copies are in the same file, so extract the block into 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) src/cli/pack.rs:1939— src/cli/pack.rs:1939-1947 | src/cli/pack.rs:2189-2197 — both copies are in the same file, so extract the 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, `src/cli/pack.rs:1949` calls `is_some` and `src/cli/pack.rs:2199` 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) src/cli/pack.rs:2282— src/cli/pack.rs:2282-2290 | src/cli/pack_run.rs:2117-2125 — 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) src/cuda_daemon.rs:2741— src/cuda_daemon.rs:2741-2749 | src/cuda_daemon.rs:5530-5538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:2741` it begins part-way through the construct above it, so those exact lines 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) src/cuda_daemon.rs:5739— src/cuda_daemon.rs:5739-5747 | src/cuda_daemon.rs:5764-5772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:5739` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cuda_daemon.rs:5774` calls `close` and `src/cuda_daemon.rs:5748` 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) src/db.rs:1184— src/db.rs:1184-1192 | src/db.rs:2136-2144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/db.rs:1184` it does not close everything it opens, so those exact lines 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) src/db.rs:1361— src/db.rs:1361-1369 | src/db.rs:1579-1587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/db.rs:1361` it does not close everything it opens, so those exact lines 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) src/staged_mount.rs:93— src/staged_mount.rs:93-101 | src/staged_mount.rs:132-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:2170— crates/smolvm-cudart-shim/src/lib.rs:2170-2178 | crates/smolvm-cudart-shim/src/lib.rs:2248-2256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:2170` it does not close everything it opens, so those exact lines 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) src/agent/fork.rs:1643— src/agent/fork.rs:1643-1651 | src/agent/fork.rs:2263-2271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/fork.rs:1643` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/agent/video.rs:599— src/agent/video.rs:599-607 | src/process.rs:1442-1452 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/video.rs:599` it begins part-way through the construct above it, so those exact lines 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) src/db.rs:1203— src/db.rs:1203-1212 | src/db.rs:2163-2171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/db.rs:1203` it does not close everything it opens, so those 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) crates/smolvm-agent/src/credentials.rs:35— crates/smolvm-agent/src/credentials.rs:35-41 | crates/smolvm-agent/src/credentials.rs:69-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/credentials.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.
Duplicated block (7 lines × 2) crates/smolvm-agent/src/main.rs:6626— crates/smolvm-agent/src/main.rs:6626-6633 | crates/smolvm-agent/src/main.rs:6912-6918 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6626` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/smolvm-agent/src/nsfile.rs:78— crates/smolvm-agent/src/nsfile.rs:78-84 | crates/smolvm-agent/src/nsfile.rs:90-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 `crates/smolvm-agent/src/nsfile.rs:78` 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) crates/smolvm-agent/src/oci.rs:1509— crates/smolvm-agent/src/oci.rs:1509-1515 | crates/smolvm-protocol/src/credentials.rs:428-434 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-protocol/src/credentials.rs:434` calls `all`, `is_ascii_lowercase`, `is_ascii_digit` and `crates/smolvm-agent/src/oci.rs:1515` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/smolvm-agent/src/ssh_agent.rs:175— crates/smolvm-agent/src/ssh_agent.rs:175-181 | crates/smolvm-agent/src/ssh_agent.rs:184-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-agent/src/ssh_agent.rs:180` calls `write_all` and `crates/smolvm-agent/src/ssh_agent.rs:171` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/smolvm-agent/src/storage.rs:1638— crates/smolvm-agent/src/storage.rs:1638-1644 | src/data/image_source.rs:431-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:1171— crates/smolvm-cuda-shim/src/lib.rs:1171-1177 | crates/smolvm-cuda-shim/src/lib.rs:1375-1384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) crates/smolvm-cuda/src/host.rs:5376— crates/smolvm-cuda/src/host.rs:5376-5382 | crates/smolvm-cuda/src/host.rs:6345-6351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:5376` 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) crates/smolvm-cudart-shim/src/lib.rs:1123— crates/smolvm-cudart-shim/src/lib.rs:1123-1129 | crates/smolvm-cudart-shim/src/lib.rs:1139-1145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/smolvm-pack/src/assets.rs:1834— crates/smolvm-pack/src/assets.rs:1834-1840 | crates/smolvm-pack/src/extract.rs:5533-5539 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/assets.rs:1834` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/agent/client.rs:2125— src/agent/client.rs:2125-2131 | src/agent/client.rs:2152-2158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/client.rs:2125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/api/handlers/machines.rs:4677— src/api/handlers/machines.rs:4677-4683 | src/api/handlers/machines.rs:4814-4820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/api/handlers/machines.rs:6007— src/api/handlers/machines.rs:6007-6013 | src/api/handlers/machines.rs:6442-6448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:6007` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) src/cli/machine.rs:1571— src/cli/machine.rs:1571-1577 | src/cli/machine.rs:5312-5318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) src/cuda_daemon.rs:6109— src/cuda_daemon.rs:6109-6115 | src/storage.rs:310-316 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:6109` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/cuda_host.rs:337— src/cuda_host.rs:337-343 | src/cuda_host.rs:428-434 — both copies are in the same file, so extract the 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) src/db.rs:737— src/db.rs:737-743 | src/db.rs:2314-2320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/engine/network.rs:849— src/engine/network.rs:849-855 | src/engine/network.rs:867-873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/engine/network.rs:849` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/engine/network.rs:856` calls `create_dir_all` and `src/engine/network.rs:874` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) src/portable_checkpoint.rs:5813— src/portable_checkpoint.rs:5813-5819 | src/portable_checkpoint.rs:5915-5921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/portable_checkpoint.rs:5813` it does not close everything it opens, so those 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) crates/smolvm-cuda-shim/src/lib.rs:2383— crates/smolvm-cuda-shim/src/lib.rs:2383-2389 | crates/smolvm-cuda-shim/src/lib.rs:2523-2529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/agent/terminal.rs:201— src/agent/terminal.rs:201-207 | src/agent/terminal.rs:216-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/terminal.rs:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/cuda_daemon.rs:4651— src/cuda_daemon.rs:4651-4657 | src/cuda_daemon.rs:4720-4726 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:4651` 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) src/portable_checkpoint.rs:5382— src/portable_checkpoint.rs:5382-5388 | src/portable_checkpoint.rs:5665-5671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/portable_checkpoint.rs:5382` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/embedded/runtime.rs:1160— src/embedded/runtime.rs:1160-1166 | src/embedded/runtime.rs:1196-1202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/embedded/runtime.rs:1160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/smolvm-pack/src/extract.rs:1796— crates/smolvm-pack/src/extract.rs:1796-1805 | src/api/handlers/machines.rs:225-231 — before extracting anything, compare `crates/smolvm-pack/src/extract.rs` and `src/api/handlers/machines.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:1796` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/smolvm-agent/src/live_resources.rs:282— crates/smolvm-agent/src/live_resources.rs:282-286 | crates/smolvm-agent/src/live_resources.rs:354-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/live_resources.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.
Duplicated block (5 lines × 2) crates/smolvm-agent/src/nsfile.rs:271— crates/smolvm-agent/src/nsfile.rs:271-275 | crates/smolvm-agent/src/nsfile.rs:542-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/agent/fork.rs:297— src/agent/fork.rs:297-301 | src/agent/rootfs_store.rs:249-253 — 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) src/agent/krun.rs:559— src/agent/krun.rs:559-564 | src/agent/krun.rs:599-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/krun.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 (5 lines × 2) src/api/pool_controller.rs:275— src/api/pool_controller.rs:275-279 | src/api/pool_controller.rs:281-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/pool_controller.rs:275` it begins part-way through the construct above it, so those exact lines 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) src/cli/machine.rs:4393— src/cli/machine.rs:4393-4397 | src/cli/machine.rs:4407-4411 — both copies are in the same file, so extract the 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, `src/cli/machine.rs:4399` calls `with_tty` and `src/cli/machine.rs:4413` 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) src/cli/machine.rs:5538— src/cli/machine.rs:5538-5542 | src/portable_checkpoint.rs:964-968 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/machine.rs:5538` it does not close everything it opens, so those exact lines 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) src/cuda_daemon.rs:5290— src/cuda_daemon.rs:5290-5294 | src/cuda_daemon.rs:5317-5321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/cuda_daemon.rs:5789— src/cuda_daemon.rs:5789-5793 | src/cuda_daemon.rs:5816-5820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:5789` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cuda_daemon.rs:5793` calls `last_os_error`, `close` and `src/cuda_daemon.rs:5820` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/smolvm-cuda/src/host.rs:6554— crates/smolvm-cuda/src/host.rs:6554-6558 | crates/smolvm-cuda/src/host/gpu.rs:1669-1673 — 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) src/cli/serve_tls.rs:80— src/cli/serve_tls.rs:80-84 | src/embedded/bundle.rs:57-61 — 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) src/cuda_daemon.rs:3017— src/cuda_daemon.rs:3017-3024 | src/cuda_daemon.rs:3163-3167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:3017` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) src/api/admission.rs:1110— src/api/admission.rs:1110-1116 | src/api/admission.rs:1169-1173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/admission.rs:1110` it begins part-way through the construct above it, so those exact lines 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) src/cuda_daemon.rs:2991— src/cuda_daemon.rs:2991-2997 | src/cuda_daemon.rs:3141-3145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:2991` it begins part-way through the construct above it, so those exact lines 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) src/cli/pack_run.rs:706— src/cli/pack_run.rs:706-710 | src/cli/pack_run.rs:2389-2394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:706` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) src/api/handlers/machines.rs:6297— src/api/handlers/machines.rs:6297-6301 | src/api/handlers/machines.rs:6389-6394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:6297` it begins part-way through the construct above it, so those exact lines 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) src/api/admission.rs:1114— src/api/admission.rs:1114-1118 | src/api/admission.rs:1120-1124 — both copies are in the same file, so extract the 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) src/embedded/runtime.rs:1340— src/embedded/runtime.rs:1340-1344 | src/embedded/runtime.rs:1353-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/embedded/runtime.rs:1340` it does not close everything it opens, so those exact lines 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) src/api/rollout.rs:1089— src/api/rollout.rs:1089-1093 | src/api/rollout.rs:1261-1265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/rollout.rs:1089` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/smolvm-agent/src/main.rs:7503— crates/smolvm-agent/src/main.rs:7503-7507 | crates/smolvm-agent/src/main.rs:7736-7740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-agent/src/main.rs:7730` calls `EphemeralContainer`, `then`, `clone` and `crates/smolvm-agent/src/main.rs:7499` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/smolvm-agent/src/nsfile.rs:731— crates/smolvm-agent/src/nsfile.rs:731-735 | crates/smolvm-agent/src/nsfile.rs:750-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 `crates/smolvm-agent/src/nsfile.rs:731` 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 (5 lines × 2) crates/smolvm-agent/src/storage.rs:842— crates/smolvm-agent/src/storage.rs:842-846 | crates/smolvm-agent/src/storage.rs:930-934 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-agent/src/storage.rs:935` calls `expect` and `crates/smolvm-agent/src/storage.rs:848` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:3238— crates/smolvm-cuda/src/host/gpu.rs:3238-3242 | crates/smolvm-cuda/src/host/gpu.rs:3243-3247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/agent/manager.rs:801— src/agent/manager.rs:801-805 | src/agent/manager.rs:906-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/engine/logs.rs:135— src/engine/logs.rs:135-139 | src/engine/logs.rs:166-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/engine/logs.rs:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-agent/src/forkpoint.rs:255— crates/smolvm-agent/src/forkpoint.rs:255-264 | src/agent/fork.rs:4140-4149 — 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) crates/smolvm-agent/src/forkpoint.rs:480— crates/smolvm-agent/src/forkpoint.rs:480-489 | crates/smolvm-agent/src/forkpoint.rs:536-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/forkpoint.rs:480` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-cuda-guest/src/main.rs:196— crates/smolvm-cuda-guest/src/main.rs:196-205 | crates/smolvm-cuda-guest/src/main.rs:264-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.
Duplicated block (10 lines × 2) crates/smolvm-cuda/src/host.rs:4052— crates/smolvm-cuda/src/host.rs:4052-4061 | crates/smolvm-cuda/src/host.rs:4578-4587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:2158— crates/smolvm-cudart-shim/src/lib.rs:2158-2167 | crates/smolvm-cudart-shim/src/lib.rs:2236-2245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:2158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:3638— crates/smolvm-cudart-shim/src/lib.rs:3638-3647 | crates/smolvm-cudart-shim/src/lib.rs:3705-3714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:3638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:6148— crates/smolvm-cudart-shim/src/lib.rs:6148-6157 | crates/smolvm-cudart-shim/src/lib.rs:6179-6188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:6148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-pack/src/assets.rs:694— crates/smolvm-pack/src/assets.rs:694-703 | crates/smolvm-pack/src/assets.rs:1837-1846 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/assets.rs:694` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-pack/src/assets.rs:1890— crates/smolvm-pack/src/assets.rs:1890-1899 | crates/smolvm-pack/src/assets.rs:1906-1915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/assets.rs:1890` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-pack/src/format.rs:150— crates/smolvm-pack/src/format.rs:150-159 | crates/smolvm-pack/src/format.rs:289-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 `crates/smolvm-pack/src/format.rs:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-pack/src/format.rs:160` calls `from_le_bytes` and `crates/smolvm-pack/src/format.rs:299` 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) src/agent/fork.rs:61— src/agent/fork.rs:61-70 | src/agent/fork.rs:77-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/agent/fork.rs:1358— src/agent/fork.rs:1358-1367 | src/agent/fork/compact.rs:173-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/fork.rs:1358` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) src/api/handlers/exec.rs:210— src/api/handlers/exec.rs:210-219 | src/api/handlers/exec.rs:541-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/exec.rs:210` 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) src/api/handlers/pools.rs:352— src/api/handlers/pools.rs:352-361 | src/api/handlers/pools.rs:379-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.
Duplicated block (10 lines × 2) src/cli/pack_run.rs:1371— src/cli/pack_run.rs:1371-1380 | src/cli/pack_run.rs:1405-1414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:1371` 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) src/cli/pack_run.rs:595— src/cli/pack_run.rs:595-604 | src/cli/pack_run.rs:1867-1876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:595` it begins part-way through the construct above it, so those exact lines 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) src/cuda_daemon.rs:2317— src/cuda_daemon.rs:2317-2326 | src/cuda_daemon.rs:2526-2535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:2317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-cuda/src/client.rs:268— crates/smolvm-cuda/src/client.rs:268-277 | crates/smolvm-cuda/src/host.rs:3939-3952 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/api/handlers/mod.rs:161— src/api/handlers/mod.rs:161-174 | src/api/handlers/mod.rs:196-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/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.
Duplicated block (10 lines × 2) crates/smolvm-agent/src/main.rs:6553— crates/smolvm-agent/src/main.rs:6553-6564 | crates/smolvm-agent/src/main.rs:6853-6862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6553` it begins part-way through the construct above it, so those exact lines 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) src/cli/vm_common.rs:1250— src/cli/vm_common.rs:1250-1260 | src/cli/vm_common.rs:1610-1619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/vm_common.rs:1250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/smolvm-agent/src/main.rs:2909— crates/smolvm-agent/src/main.rs:2909-2918 | crates/smolvm-agent/src/main.rs:2931-2940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:2909` it begins part-way through the construct above it, so those exact lines 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) src/cli/pack_run.rs:881— src/cli/pack_run.rs:881-890 | src/cli/pack_run.rs:2064-2073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:881` 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) src/pack_export.rs:1233— src/pack_export.rs:1233-1242 | src/pack_export.rs:1378-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/pack_export.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.
ClassTooLong: GpuBackend crates/smolvm-cuda/src/host/gpu.rs:97— ClassTooLong — 2148 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 5 blocks, lines 97-4324. The bar is 400 significant lines; this is 1748 over it, 5.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: AgentManager src/agent/manager.rs:1676— ClassTooLong — 1595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 79 methods, 3 blocks, lines 1676-4825. The bar is 400 significant lines; this is 1195 over it, 3.99× 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: AgentClient src/agent/client.rs:1115— ClassTooLong — 1592 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 106 methods, 2 blocks, lines 1115-4031. The bar is 400 significant lines; this is 1192 over it, 3.98× 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: SmolvmDb src/db.rs:196— ClassTooLong — 1532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 78 methods, 3 blocks, lines 196-2384. The bar is 400 significant lines; this is 1132 over it, 3.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Client crates/smolvm-cuda/src/client.rs:209— ClassTooLong — 1208 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 132 methods, 2 blocks, lines 209-2152. The bar is 400 significant lines; this is 808 over it, 3.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EmbeddedRuntime src/embedded/runtime.rs:84— ClassTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 85 methods, 2 blocks, lines 84-1899. The bar is 400 significant lines; this is 729 over it, 2.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RunCmd src/cli/machine.rs:535— ClassTooLong — 985 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 535-2628. The bar is 400 significant lines; this is 585 over it, 2.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RegistryClient crates/smolvm-registry/src/client.rs:208— ClassTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 2 blocks, lines 208-1630. The bar is 400 significant lines; this is 389 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VmRecord src/config.rs:437— ClassTooLong — 755 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, 2 blocks, lines 437-1795. The bar is 400 significant lines; this is 355 over it, 1.89× 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: RolloutExecutor src/api/rollout.rs:692— ClassTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 2 blocks, lines 692-1665. The bar is 400 significant lines; this is 306 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PackCreateCmd src/cli/pack.rs:422— ClassTooLong — 648 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 422-1603. The bar is 400 significant lines; this is 248 over it, 1.62× 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: S3Fs crates/smolvm-s3fs/src/fs.rs:158— ClassTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 3 blocks, lines 158-1139. The bar is 400 significant lines; this is 234 over it, 1.59× 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: ApiState src/api/state.rs:72— ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 2 blocks, lines 72-1437. 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: UpdateCmd src/cli/machine.rs:6663— ClassTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 6663-7566. The bar is 400 significant lines; this is 198 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: CreateCmd src/cli/machine.rs:4594— ClassTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 2 blocks, lines 4594-5668. The bar is 400 significant lines; this is 188 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.
ClassTooLong: ForkPoolController src/api/pool_controller.rs:70— ClassTooLong — 517 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, 2 blocks, lines 70-788. The bar is 400 significant lines; this is 117 over it, 1.29× 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: ServeStartCmd src/cli/serve.rs:58— ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 2 blocks, lines 58-930. The bar is 400 significant lines; this is 66 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Writer crates/smolvm-checkpoint/src/store.rs:173— ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 173-785. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TcpRelayTable crates/smolvm-network/src/tcp_relay.rs:103— ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 2 blocks, lines 103-1140. The bar is 400 significant lines; this is 28 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.
ClassTooLong: AssetCollector crates/smolvm-pack/src/assets.rs:739— ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 739-1450. The bar is 400 significant lines; this is 16 over it, 1.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.
smolvm_network::stack::run_network_stack (cognitive 110) crates/smolvm-network/src/stack.rs:265— smolvm_network::stack::run_network_stack has cognitive complexity 110 (threshold 15). Drivers by points: if/else 30 (80 pts), match/switch 8 (20 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_network::icmp_relay::run_icmp_relay (cognitive 59) crates/smolvm-network/src/icmp_relay.rs:146— smolvm_network::icmp_relay::run_icmp_relay has cognitive complexity 59 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 7 (14 pts), match/switch 3 (12 pts), 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.
smolvm_network::udp_relay::run_udp_relay (cognitive 52) crates/smolvm-network/src/udp_relay.rs:135— smolvm_network::udp_relay::run_udp_relay has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 3 (12 pts), loops 5 (11 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_network::stack::classify_guest_frame (cognitive 39) crates/smolvm-network/src/stack.rs:1555— smolvm_network::stack::classify_guest_frame has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 7 (11 pts), boolean chains 3 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_network::udp_publish::run_publisher (cognitive 38) crates/smolvm-network/src/udp_publish.rs:198— smolvm_network::udp_publish::run_publisher has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 3 (12 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_network::stack::process_dns_tcp (cognitive 36) crates/smolvm-network/src/stack.rs:1346— smolvm_network::stack::process_dns_tcp has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (12 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.
smolvm_network::frame_stream::run_writer (cognitive 32) crates/smolvm-network/src/frame_stream.rs:155— smolvm_network::frame_stream::run_writer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 2 (3 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.
smolvm_network::dns_relay::run_dns_relay (cognitive 31) crates/smolvm-network/src/dns_relay.rs:159— smolvm_network::dns_relay::run_dns_relay has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (9 pts), match/switch 2 (7 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.
smolvm_network::stack::drain_icmp_echo (cognitive 30) crates/smolvm-network/src/stack.rs:848— smolvm_network::stack::drain_icmp_echo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_network::dns::read_name (cognitive 24) crates/smolvm-network/src/dns.rs:266— smolvm_network::dns::read_name has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_network::stack::deliver_dns_responses (cognitive 24) crates/smolvm-network/src/stack.rs:1238— smolvm_network::stack::deliver_dns_responses has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (3 pts), 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.
smolvm_network::tcp_relay::open_relay_target (cognitive 22) crates/smolvm-network/src/tcp_relay.rs:1367— smolvm_network::tcp_relay::open_relay_target has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
smolvm_network::tcp_relay::flush_proxy_payloads (cognitive 22) crates/smolvm-network/src/tcp_relay.rs:1993— smolvm_network::tcp_relay::flush_proxy_payloads has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_network::dns_cache::cache_lifetime (cognitive 21) crates/smolvm-network/src/dns_cache.rs:246— smolvm_network::dns_cache::cache_lifetime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (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.
smolvm_network::tcp_relay::relay_socket_data (cognitive 21) crates/smolvm-network/src/tcp_relay.rs:1158— smolvm_network::tcp_relay::relay_socket_data has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, match/switch 2 (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.
smolvm_network::acceptor::run (cognitive 20) crates/smolvm-network/src/acceptor.rs:319— smolvm_network::acceptor::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (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.
smolvm_network::dns_forward::run_loopback (cognitive 20) crates/smolvm-network/src/dns_forward.rs:392— smolvm_network::dns_forward::run_loopback has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 4 (8 pts), match/switch 1 (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.
smolvm_network::netns_tap::pump_tap_to_stream (cognitive 18) crates/smolvm-network/src/netns_tap.rs:124— smolvm_network::netns_tap::pump_tap_to_stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 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.
smolvm_network::stack::classify_dns_query (cognitive 16) crates/smolvm-network/src/stack.rs:1103— smolvm_network::stack::classify_dns_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
Duplicated block (11 lines × 2) crates/smolvm-agent/src/cuda.rs:233— crates/smolvm-agent/src/cuda.rs:233-243 | crates/smolvm-agent/src/vulkan.rs:223-233 — 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 (11 lines × 2) crates/smolvm-agent/src/storage.rs:1712— crates/smolvm-agent/src/storage.rs:1712-1722 | crates/smolvm-agent/src/storage.rs:1792-1802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:1712` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:1825— crates/smolvm-cuda/src/host/gpu.rs:1825-1835 | crates/smolvm-cuda/src/host/gpu.rs:1886-1896 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:1825` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda/src/host/gpu.rs:1897` calls `chk` and `crates/smolvm-cuda/src/host/gpu.rs:1836` 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) crates/smolvm-cuda/src/host/gpu.rs:3624— crates/smolvm-cuda/src/host/gpu.rs:3624-3634 | crates/smolvm-cuda/src/host/gpu.rs:3681-3691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:3624` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda/src/host/gpu.rs:3692` calls `f32` and `crates/smolvm-cuda/src/host/gpu.rs:3635` 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) crates/smolvm-cuda/src/host/gpu.rs:3765— crates/smolvm-cuda/src/host/gpu.rs:3765-3775 | crates/smolvm-cuda/src/host/gpu.rs:3785-3795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:3765` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) crates/smolvm-pack/src/packer.rs:319— crates/smolvm-pack/src/packer.rs:319-329 | crates/smolvm-pack/src/packer.rs:644-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `output` to `impl AsRef<Path>` in one and `&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 (11 lines × 2) crates/smolvm-pack/src/packer.rs:596— crates/smolvm-pack/src/packer.rs:596-606 | crates/smolvm-pack/src/packer.rs:687-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/cli/machine.rs:1408— src/cli/machine.rs:1408-1418 | src/cli/machine.rs:5044-5054 — both copies are in the same file, so extract the block into 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) src/cli/vm_common.rs:999— src/cli/vm_common.rs:999-1009 | src/cli/vm_common.rs:1153-1163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/vm_common.rs:999` 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) src/cuda_daemon.rs:1645— src/cuda_daemon.rs:1645-1656 | src/cuda_daemon.rs:1718-1728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:1645` it does not close everything it opens, so those exact lines 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) src/cuda_daemon.rs:3731— src/cuda_daemon.rs:3731-3741 | src/cuda_daemon.rs:4882-4892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:3731` it begins part-way through the construct above it, so those exact lines 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) src/db.rs:676— src/db.rs:676-686 | src/db.rs:943-953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/db.rs:676` it does not close everything it opens, so those exact lines 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) src/portable_checkpoint.rs:1588— src/portable_checkpoint.rs:1588-1598 | src/portable_checkpoint.rs:1734-1744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/smolvm-agent/src/mount_owner.rs:411— crates/smolvm-agent/src/mount_owner.rs:411-421 | crates/smolvm-agent/src/nsfile.rs:172-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/cuda_daemon.rs:1015— src/cuda_daemon.rs:1015-1025 | src/cuda_daemon.rs:1032-1042 — both copies are in the same file, so extract the 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 (11 lines × 2) src/embedded/runtime.rs:600— src/embedded/runtime.rs:600-610 | src/embedded/runtime.rs:647-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/embedded/runtime.rs:600` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/smolvm-agent/src/main.rs:5013— crates/smolvm-agent/src/main.rs:5013-5023 | crates/smolvm-agent/src/main.rs:5056-5066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:5013` it begins part-way through the construct above it, so those exact lines 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) src/api/handlers/machines.rs:5510— src/api/handlers/machines.rs:5510-5520 | src/api/handlers/machines.rs:6444-6454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:5510` it begins part-way through the construct above it, so those exact lines 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) src/api/handlers/machines.rs:1165— src/api/handlers/machines.rs:1165-1175 | src/api/handlers/machines.rs:1180-1190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:1165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) crates/smolvm-checkpoint/src/store.rs:945— crates/smolvm-checkpoint/src/store.rs:945-957 | crates/smolvm-checkpoint/src/store.rs:2773-2785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/smolvm-cuda/src/host.rs:5008— crates/smolvm-cuda/src/host.rs:5008-5020 | crates/smolvm-cuda/src/host.rs:5028-5040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:5008` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/smolvm-pack/src/extract.rs:1687— crates/smolvm-pack/src/extract.rs:1687-1699 | src/api/handlers/machines.rs:6732-6744 — before extracting anything, compare `crates/smolvm-pack/src/extract.rs` and `src/api/handlers/machines.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/api/handlers/machines.rs:6745` calls `touch` and `crates/smolvm-pack/src/extract.rs:1700` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/smolvm-protocol/src/intercept.rs:169— crates/smolvm-protocol/src/intercept.rs:169-181 | crates/smolvm-protocol/src/mediated_egress.rs:85-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-protocol/src/intercept.rs:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/api/rollout.rs:974— src/api/rollout.rs:974-986 | src/api/rollout.rs:1117-1129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/rollout.rs:974` it does not close everything it opens, so those 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 `PublishRolloutPolicyRequest` in one and `PublishDeviceRolloutPolicyRequest` 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 × 2) src/cli/pack_run.rs:618— src/cli/pack_run.rs:618-630 | src/cli/pack_run.rs:2307-2319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/cli/pack_run.rs:2083— src/cli/pack_run.rs:2083-2095 | src/cli/pack_run.rs:2576-2588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/cli/vm_common.rs:1224— src/cli/vm_common.rs:1224-1236 | src/embedded/control.rs:763-775 — before extracting anything, compare `src/cli/vm_common.rs` and `src/embedded/control.rs` as WHOLE FILES: this scan already matched 3 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 `src/cli/vm_common.rs:1224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) src/cli/vm_common.rs:1615— src/cli/vm_common.rs:1615-1627 | src/embedded/control.rs:799-811 — before extracting anything, compare `src/cli/vm_common.rs` and `src/embedded/control.rs` as WHOLE FILES: this scan already matched 3 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 `src/cli/vm_common.rs:1615` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/cuda_daemon.rs:4344— src/cuda_daemon.rs:4344-4356 | src/cuda_daemon.rs:4383-4395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:4344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/cuda_daemon.rs:5802— src/cuda_daemon.rs:5802-5814 | src/cuda_daemon.rs:5825-5837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:5802` it begins part-way through the construct above it, so those 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 (13 lines × 2) crates/smolvm-pack/src/extract.rs:3629— crates/smolvm-pack/src/extract.rs:3629-3641 | crates/smolvm-pack/src/extract.rs:3700-3712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:3629` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/smolvm-agent/src/main.rs:6665— crates/smolvm-agent/src/main.rs:6665-6677 | crates/smolvm-agent/src/main.rs:6941-6953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/smolvm-agent/src/main.rs:6678— crates/smolvm-agent/src/main.rs:6678-6690 | crates/smolvm-agent/src/main.rs:6719-6731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/smolvm-credentials/src/ca.rs:121— crates/smolvm-credentials/src/ca.rs:121-133 | crates/smolvm-credentials/src/ca.rs:173-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-credentials/src/ca.rs:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/agent/fork.rs:1677— src/agent/fork.rs:1677-1689 | src/agent/fork.rs:2294-2306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/fork.rs:1677` 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) bench/workload_dpo.py:69— bench/workload_dpo.py:69-81 | demo/dpo_train.py:68-80 — before extracting anything, compare `bench/workload_dpo.py` and `demo/dpo_train.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `bench/workload_dpo.py: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 (12 lines × 2) crates/smolvm-agent/src/main.rs:1360— crates/smolvm-agent/src/main.rs:1360-1371 | crates/smolvm-agent/src/main.rs:1403-1415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:1360` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/smolvm-agent/src/main.rs:6656— crates/smolvm-agent/src/main.rs:6656-6667 | crates/smolvm-agent/src/main.rs:6697-6708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6656` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/smolvm-agent/src/rosetta.rs:246— crates/smolvm-agent/src/rosetta.rs:246-257 | crates/smolvm-agent/src/rosetta.rs:276-287 — both copies are in the same file, so extract the 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) crates/smolvm-agent/src/storage.rs:3649— crates/smolvm-agent/src/storage.rs:3649-3660 | crates/smolvm-agent/src/storage.rs:3804-3815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/smolvm-agent/src/storage.rs:6094— crates/smolvm-agent/src/storage.rs:6094-6105 | crates/smolvm-agent/src/storage.rs:6331-6342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/smolvm-checkpoint/src/store.rs:1493— crates/smolvm-checkpoint/src/store.rs:1493-1504 | src/api/cache_base_fetch.rs:270-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-checkpoint/src/store.rs:1493` it does not close everything it opens, so those 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 `file` to `&File` in one and `&std::fs::File` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:1818— crates/smolvm-cuda/src/host/gpu.rs:1818-1829 | crates/smolvm-cuda/src/host/gpu.rs:1851-1862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:1879— crates/smolvm-cuda/src/host/gpu.rs:1879-1890 | crates/smolvm-cuda/src/host/gpu.rs:1908-1919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:2313— crates/smolvm-cudart-shim/src/lib.rs:2313-2324 | crates/smolvm-cudart-shim/src/lib.rs:2950-2961 — both copies are in the same file, so extract the 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 (12 lines × 2) crates/smolvm-pack/src/packer.rs:308— crates/smolvm-pack/src/packer.rs:308-319 | crates/smolvm-pack/src/packer.rs:671-682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/api/cache_base_budget.rs:136— src/api/cache_base_budget.rs:136-147 | src/api/handlers/machines.rs:238-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/cache_base_budget.rs:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/api/handlers/exec_sessions.rs:777— src/api/handlers/exec_sessions.rs:777-788 | src/api/handlers/exec_sessions.rs:807-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 `src/api/handlers/exec_sessions.rs:777` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/cuda_daemon.rs:2620— src/cuda_daemon.rs:2620-2631 | src/cuda_daemon.rs:2651-2662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:2620` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:4639— crates/smolvm-cudart-shim/src/lib.rs:4639-4650 | crates/smolvm-cudart-shim/src/lib.rs:4657-4668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:4639` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:5522— crates/smolvm-cudart-shim/src/lib.rs:5522-5533 | crates/smolvm-cudart-shim/src/lib.rs:5594-5605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:5522` 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, `crates/smolvm-cudart-shim/src/lib.rs:5592` calls `extend_from_slice`, `to_le_bytes` and `crates/smolvm-cudart-shim/src/lib.rs:5521` 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 lines × 2) crates/smolvm-cuda/src/host.rs:3628— crates/smolvm-cuda/src/host.rs:3628-3639 | crates/smolvm-cuda/src/host.rs:3670-3681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:3628` 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) bench/workload_dpo.py:48— bench/workload_dpo.py:48-59 | demo/dpo_train.py:47-58 — before extracting anything, compare `bench/workload_dpo.py` and `demo/dpo_train.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×15
Edited copy of a member (13 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:5332— crates/smolvm-cudart-shim/src/lib.rs:5332-5348 | crates/smolvm-cudart-shim/src/lib.rs:5358-5402 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-pack/src/extract.rs:2120— crates/smolvm-pack/src/extract.rs:2120-2132 | src/image_seed.rs:1149-1163 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/embedded/runtime.rs:699— src/embedded/runtime.rs:699-711 | src/embedded/runtime.rs:974-987 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-pack/src/assets.rs:1887— crates/smolvm-pack/src/assets.rs:1887-1899 | crates/smolvm-pack/src/assets.rs:1902-1915 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-pack/src/extract.rs:1794— crates/smolvm-pack/src/extract.rs:1794-1812 | src/api/handlers/machines.rs:222-234 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:2611— crates/smolvm-cuda-shim/src/lib.rs:2611-2629 | crates/smolvm-cuda-shim/src/lib.rs:2715-2727 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:3487— crates/smolvm-cuda-shim/src/lib.rs:3487-3502 | crates/smolvm-cuda-shim/src/lib.rs:3509-3521 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/agent/fork.rs:543— src/agent/fork.rs:543-555 | src/agent/fork.rs:2414-2426 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-agent/src/disk_trim.rs:53— crates/smolvm-agent/src/disk_trim.rs:53-65 | src/agent/launcher.rs:3064-3080 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-checkpoint/src/store.rs:1171— crates/smolvm-checkpoint/src/store.rs:1171-1184 | crates/smolvm-pack/src/assets.rs:1649-1661 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:721— crates/smolvm-cuda-shim/src/lib.rs:721-733 | crates/smolvm-cuda-shim/src/lib.rs:735-747 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-cuda/src/host/gpu.rs:1337— crates/smolvm-cuda/src/host/gpu.rs:1337-1349 | crates/smolvm-cuda/src/host/gpu.rs:1350-1363 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:1250— crates/smolvm-cuda-shim/src/lib.rs:1250-1262 | crates/smolvm-cuda-shim/src/lib.rs:1265-1277 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/smolvm-protocol/src/workload_target.rs:55— crates/smolvm-protocol/src/workload_target.rs:55-68 | src/api/rollout.rs:1706-1718 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/cli/parsers.rs:65— src/cli/parsers.rs:65-77 | src/workload.rs:15-28 — 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 (14 corresponding lines) · ×14
Edited copy of a member (14 corresponding lines) crates/smolvm-pack/src/macho.rs:163— crates/smolvm-pack/src/macho.rs:163-176 | crates/smolvm-pack/src/macho.rs:234-248 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/engine/mod.rs:150— src/engine/mod.rs:150-164 | src/engine/network.rs:195-208 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/artifact_cache.rs:689— src/artifact_cache.rs:689-702 | src/artifact_cache.rs:1226-1241 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/engine/store.rs:51— src/engine/store.rs:51-64 | src/engine/store.rs:84-99 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/cli/pack_run.rs:1816— src/cli/pack_run.rs:1816-1829 | src/cli/pack_run.rs:1838-1853 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:612— crates/smolvm-cuda-shim/src/lib.rs:612-631 | crates/smolvm-cuda-shim/src/lib.rs:657-670 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/smolvm-agent/src/attach.rs:265— crates/smolvm-agent/src/attach.rs:265-278 | crates/smolvm-agent/src/nsfile.rs:245-259 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/smolvm-cuda/src/client.rs:1684— crates/smolvm-cuda/src/client.rs:1684-1697 | crates/smolvm-cuda/src/client.rs:1789-1803 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/agent/launcher_dynamic.rs:96— src/agent/launcher_dynamic.rs:96-109 | src/data/disk.rs:488-501 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/agent/client.rs:2029— src/agent/client.rs:2029-2045 | src/agent/client.rs:2054-2067 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/smolvm-protocol/src/resolv.rs:70— crates/smolvm-protocol/src/resolv.rs:70-83 | crates/smolvm-protocol/src/resolv.rs:88-104 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:3651— crates/smolvm-cuda-shim/src/lib.rs:3651-3664 | crates/smolvm-cudart-shim/src/lib.rs:3237-3255 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:1288— crates/smolvm-cuda-shim/src/lib.rs:1288-1303 | crates/smolvm-cuda-shim/src/lib.rs:3112-3125 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/cli/vm_common.rs:671— src/cli/vm_common.rs:671-684 | src/portable_checkpoint.rs:1368-1381 — 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.
smolvm_agent::handle_request (cyclomatic 65) crates/smolvm-agent/src/main.rs:2714— smolvm_agent::handle_request has cyclomatic complexity 65 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
smolvm_agent::run_interactive_loop_io (cyclomatic 53) crates/smolvm-agent/src/main.rs:6498— smolvm_agent::run_interactive_loop_io has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_agent::run_interactive_loop_pty (cyclomatic 41) crates/smolvm-agent/src/main.rs:6803— smolvm_agent::run_interactive_loop_pty 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.
smolvm_agent::main (cyclomatic 34) crates/smolvm-agent/src/main.rs:347— smolvm_agent::main has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
smolvm_agent::handle_connection (cyclomatic 32) crates/smolvm-agent/src/main.rs:2368— smolvm_agent::handle_connection 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.
smolvm_agent::storage::pull_image_with_progress_and_auth (cyclomatic 32) crates/smolvm-agent/src/storage.rs:3244— smolvm_agent::storage::pull_image_with_progress_and_auth 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.
smolvm_agent::container::prepare (cyclomatic 28) crates/smolvm-agent/src/container.rs:84— smolvm_agent::container::prepare 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.
smolvm_agent::setup_persistent_rootfs (cyclomatic 27) crates/smolvm-agent/src/main.rs:1265— smolvm_agent::setup_persistent_rootfs has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_agent::handle_run_detached (cyclomatic 25) crates/smolvm-agent/src/main.rs:4741— smolvm_agent::handle_run_detached 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.
smolvm_agent::process::wait_with_timeout_cleanup_and_liveness (cyclomatic 24) crates/smolvm-agent/src/process.rs:653— smolvm_agent::process::wait_with_timeout_cleanup_and_liveness 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.
smolvm_agent::storage::oci_archive_compatibility (cyclomatic 24) crates/smolvm-agent/src/storage.rs:2020— smolvm_agent::storage::oci_archive_compatibility has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: StorageError::fmt (cyclomatic 25) 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.
smolvm_agent::handle_vm_exec (cyclomatic 23) crates/smolvm-agent/src/main.rs:8713— smolvm_agent::handle_vm_exec 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.
smolvm_agent::nsfile::run_helper (cyclomatic 17) crates/smolvm-agent/src/nsfile.rs:72— smolvm_agent::nsfile::run_helper 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.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×13
Edited copy of a member (8 corresponding lines) crates/smolvm-pack/src/extract.rs:3785— crates/smolvm-pack/src/extract.rs:3785-3794 | crates/smolvm-pack/src/extract.rs:3801-3808 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-cuda/src/host/gpu.rs:1598— crates/smolvm-cuda/src/host/gpu.rs:1598-1613 | crates/smolvm-cuda/src/host/gpu.rs:1630-1637 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-pack/src/macho.rs:107— crates/smolvm-pack/src/macho.rs:107-114 | crates/smolvm-pack/src/macho.rs:263-272 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-agent/src/forkpoint.rs:29— crates/smolvm-agent/src/forkpoint.rs:29-39 | crates/smolvm-agent/src/forkpoint.rs:42-49 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/api/state.rs:1276— src/api/state.rs:1276-1283 | src/api/state.rs:1302-1309 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/systemd_scope.rs:110— src/systemd_scope.rs:110-117 | src/systemd_scope.rs:229-237 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-agent/src/pty.rs:28— crates/smolvm-agent/src/pty.rs:28-35 | crates/smolvm-agent/src/pty.rs:38-45 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/cuda_daemon.rs:840— src/cuda_daemon.rs:840-847 | src/cuda_daemon.rs:852-859 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-cuda/src/host.rs:6708— crates/smolvm-cuda/src/host.rs:6708-6715 | crates/smolvm-cuda/src/host.rs:6740-6748 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/engine/images.rs:274— src/engine/images.rs:274-281 | src/engine/network.rs:130-137 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-cuda/src/host/gpu.rs:1305— crates/smolvm-cuda/src/host/gpu.rs:1305-1313 | crates/smolvm-cuda/src/host/gpu.rs:2064-2071 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:3716— crates/smolvm-cuda-shim/src/lib.rs:3716-3723 | crates/smolvm-cudart-shim/src/lib.rs:2981-2989 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:3764— crates/smolvm-cuda-shim/src/lib.rs:3764-3771 | crates/smolvm-cudart-shim/src/lib.rs:2916-2927 — 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.
TooManyFields: GpuBackend crates/smolvm-cuda/src/host/gpu.rs:97— TooManyFields — 132 stored fields beside 11 methods. The bar is 30 stored fields; this is 102 over it, 4.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: VmRecord src/config.rs:437— TooManyFields — 96 stored fields beside 29 methods. The bar is 30 stored fields; this is 66 over it, 3.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CudaDeviceProp crates/smolvm-cudart-shim/src/lib.rs:2481— TooManyFields — 75 stored fields. The bar is 30 stored fields; this is 45 over it, 2.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: RunCmd src/cli/machine.rs:535— TooManyFields — 67 stored fields beside 1 method. The bar is 30 stored fields; this is 37 over it, 2.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CreateCmd src/cli/machine.rs:4594— TooManyFields — 63 stored fields beside 4 methods. The bar is 30 stored fields; this is 33 over it, 2.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: CreateVmParams src/cli/vm_common.rs:460— TooManyFields — 59 stored fields beside 4 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: Session crates/smolvm-cuda/src/host.rs:693— TooManyFields — 46 stored fields beside 1 method. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: MachineInfo src/api/types.rs:1133— TooManyFields — 46 stored fields. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: KrunFunctions src/agent/krun.rs:48— TooManyFields — 40 stored fields beside 5 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: UpdateCmd src/cli/machine.rs:6663— TooManyFields — 39 stored fields beside 11 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Smolfile crates/smolvm-smolfile/src/lib.rs:260— TooManyFields — 38 stored fields. The bar is 30 stored fields; this is 8 over it, 1.27× 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: CreateMachineRequest src/api/types.rs:957— TooManyFields — 36 stored fields. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×12
Edited copy of a member (10 corresponding lines) crates/smolvm-shim/src/engine.rs:963— crates/smolvm-shim/src/engine.rs:963-976 | crates/smolvm-shim/src/engine.rs:978-987 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/main.rs:2108— crates/smolvm-agent/src/main.rs:2108-2117 | src/agent/fork/compact.rs:137-146 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/live_resources.rs:223— crates/smolvm-agent/src/live_resources.rs:223-232 | crates/smolvm-agent/src/live_resources.rs:297-308 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/storage.rs:1637— crates/smolvm-agent/src/storage.rs:1637-1646 | src/data/image_source.rs:430-439 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/nsfile.rs:934— crates/smolvm-agent/src/nsfile.rs:934-943 | crates/smolvm-agent/src/nsfile.rs:952-961 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/data/network.rs:397— src/data/network.rs:397-407 | src/data/network.rs:414-423 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-network/src/dns_forward.rs:132— crates/smolvm-network/src/dns_forward.rs:132-141 | crates/smolvm-network/src/udp_relay.rs:310-320 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-registry/src/token_store.rs:136— crates/smolvm-registry/src/token_store.rs:136-146 | src/checkpoint_retention.rs:97-106 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:4106— crates/smolvm-cudart-shim/src/lib.rs:4106-4115 | crates/smolvm-cudart-shim/src/lib.rs:4180-4189 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/auto_ports.rs:83— crates/smolvm-agent/src/auto_ports.rs:83-93 | crates/smolvm-network/src/switch.rs:487-496 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/docker_bridge.rs:29— crates/smolvm-agent/src/docker_bridge.rs:29-38 | crates/smolvm-agent/src/ssh_agent.rs:20-29 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/smolvm-agent/src/storage.rs:6516— crates/smolvm-agent/src/storage.rs:6516-6525 | src/registry.rs:337-351 — 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 (6 corresponding lines) · ×12
Edited copy of a member (6 corresponding lines) src/portable_checkpoint.rs:107— src/portable_checkpoint.rs:107-113 | src/process.rs:1583-1588 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/engine/network.rs:75— src/engine/network.rs:75-80 | src/engine/network.rs:88-93 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/engine/api.rs:655— src/engine/api.rs:655-663 | src/engine/api.rs:669-674 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/smolvm-cuda/src/host.rs:1201— crates/smolvm-cuda/src/host.rs:1201-1206 | crates/smolvm-cuda/src/host.rs:1251-1256 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/agent/manager.rs:1144— src/agent/manager.rs:1144-1150 | src/agent/manager.rs:1326-1331 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/process.rs:3462— src/process.rs:3462-3467 | src/api/memory_pressure.rs:340-345 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/engine/api.rs:680— src/engine/api.rs:680-685 | src/engine/api.rs:722-729 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/smolvm-agent/src/main.rs:5763— crates/smolvm-agent/src/main.rs:5763-5768 | src/agent/manager.rs:2300-2305 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/cli/serve.rs:1137— src/cli/serve.rs:1137-1143 | src/cuda_daemon.rs:2488-2493 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/smolvm-network/src/udp_publish.rs:105— crates/smolvm-network/src/udp_publish.rs:105-111 | src/agent/fsnotify_watch.rs:160-165 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/cli/machine.rs:985— src/cli/machine.rs:985-990 | src/image_seed.rs:1173-1178 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/agent/manager.rs:4950— src/agent/manager.rs:4950-4955 | src/image_seed.rs:56-61 — 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.
smolvm_cuda::host::dispatch (cognitive 467) crates/smolvm-cuda/src/host.rs:4714— smolvm_cuda::host::dispatch has cognitive complexity 467 (threshold 15). Drivers by points: if/else 145 (345 pts), loops 16 (53 pts), match/switch 15 (42 pts), boolean chains 27 (nesting depth added 264). Of this number, 463 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_cuda::host::serve_rings (cognitive 87) crates/smolvm-cuda/src/host.rs:3394— smolvm_cuda::host::serve_rings has cognitive complexity 87 (threshold 15). Drivers by points: if/else 27 (71 pts), match/switch 7 (20 pts), loops 7 (15 pts), boolean chains 5 (nesting depth added 65). To reduce it, split the body into named stages: move each independent 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 (smolvm_cuda::host::serve_rings::respond) 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.
smolvm_cuda::host::serve_inner (cognitive 37) crates/smolvm-cuda/src/host.rs:3122— smolvm_cuda::host::serve_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 3 (10 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cuda::host::execute_auto_graph_segment (cognitive 36) crates/smolvm-cuda/src/host.rs:4223— smolvm_cuda::host::execute_auto_graph_segment has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (25 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
smolvm_cuda::host::replay_capture_graph (cognitive 36) crates/smolvm-cuda/src/host.rs:4564— smolvm_cuda::host::replay_capture_graph has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 6 (8 pts), loops 4 (5 pts) (nesting depth added 17). Of this number, 34 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_cuda::host::reclaim_session (cognitive 31) crates/smolvm-cuda/src/host.rs:818— smolvm_cuda::host::reclaim_session has cognitive complexity 31 (threshold 15). Drivers by points: loops 15 (16 pts), if/else 7 (15 pts) (nesting depth added 9). 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.
smolvm_cuda::host::serve_rings::respond (cognitive 24) crates/smolvm-cuda/src/host.rs:3499— smolvm_cuda::host::serve_rings::respond has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (smolvm_cuda::host::serve_rings) 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.
smolvm_cuda::proto::encode_request (cognitive 24) crates/smolvm-cuda/src/proto.rs:976— smolvm_cuda::proto::encode_request has cognitive complexity 24 (threshold 15). Drivers by points: loops 11 (23 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
smolvm_cuda::proto::decode_request (cognitive 21) crates/smolvm-cuda/src/proto.rs:1674— smolvm_cuda::proto::decode_request has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
smolvm_cuda::host::xlat_mod (cognitive 18) crates/smolvm-cuda/src/host.rs:2199— smolvm_cuda::host::xlat_mod has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (5 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.
smolvm_cuda::host::translate_dptrs (cognitive 18) crates/smolvm-cuda/src/host.rs:2790— smolvm_cuda::host::translate_dptrs has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (8 pts), match/switch 1 (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.
Duplicated block (16 lines × 2) crates/smolvm-agent/src/main.rs:974— crates/smolvm-agent/src/main.rs:974-989 | crates/smolvm-agent/src/pod.rs:1278-1293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:974` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/smolvm-agent/src/main.rs:4210— crates/smolvm-agent/src/main.rs:4210-4225 | crates/smolvm-agent/src/main.rs:8214-8229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:4210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `stream` to `&mut impl ReadWrite` in one and `&mut impl Write` 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 (16 lines × 2) crates/smolvm-agent/src/ssh_agent.rs:278— crates/smolvm-agent/src/ssh_agent.rs:278-293 | crates/smolvm-agent/src/vsock.rs:210-225 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/ssh_agent.rs:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/smolvm-agent/src/storage.rs:2939— crates/smolvm-agent/src/storage.rs:2939-2954 | crates/smolvm-agent/src/storage.rs:3210-3225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src/agent/launcher.rs:1719— src/agent/launcher.rs:1719-1734 | src/agent/launcher.rs:1750-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 `src/agent/launcher.rs:1719` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) src/agent/manager.rs:4524— src/agent/manager.rs:4524-4539 | src/agent/manager.rs:4606-4621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) src/api/handlers/exec.rs:113— src/api/handlers/exec.rs:113-128 | src/api/handlers/exec.rs:292-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/exec.rs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/cli/pack.rs:1058— src/cli/pack.rs:1058-1073 | src/cli/pack.rs:1207-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack.rs:1058` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/cli/vm_common.rs:2049— src/cli/vm_common.rs:2049-2064 | src/cli/vm_common.rs:2427-2442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/vm_common.rs:2049` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) crates/smolvm-agent/src/main.rs:6636— crates/smolvm-agent/src/main.rs:6636-6656 | crates/smolvm-agent/src/main.rs:6921-6936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6636` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) src/agent/launcher_dynamic.rs:605— src/agent/launcher_dynamic.rs:605-620 | src/agent/launcher_dynamic.rs:628-643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
smolvm_pack::extract::safe_unpack_skipping (cognitive 169) crates/smolvm-pack/src/extract.rs:986— smolvm_pack::extract::safe_unpack_skipping has cognitive complexity 169 (threshold 15). Drivers by points: if/else 61 (150 pts), boolean chains 15, loops 2, match/switch 1 (2 pts) (nesting depth added 90). 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.
smolvm_pack::extract::post_process_extraction (cognitive 52) crates/smolvm-pack/src/extract.rs:4529— smolvm_pack::extract::post_process_extraction has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (43 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_pack::extract::extract_sidecar_capped (cognitive 35) crates/smolvm-pack/src/extract.rs:2188— smolvm_pack::extract::extract_sidecar_capped has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 8, match/switch 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.
smolvm_pack::extract::repair_host_layer_owners (cognitive 23) crates/smolvm-pack/src/extract.rs:3431— smolvm_pack::extract::repair_host_layer_owners has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (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.
smolvm_pack::extract::ensure_shared_artifact_sha256_with_proofs (cognitive 20) crates/smolvm-pack/src/extract.rs:3261— smolvm_pack::extract::ensure_shared_artifact_sha256_with_proofs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_pack::extract::gc_stale_leases (cognitive 20) crates/smolvm-pack/src/extract.rs:5089— smolvm_pack::extract::gc_stale_leases has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_pack::assets::macos_sparse_extents (cognitive 19) crates/smolvm-pack/src/assets.rs:30— smolvm_pack::assets::macos_sparse_extents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
smolvm_pack::extract::copy_data_extents (cognitive 19) crates/smolvm-pack/src/extract.rs:5558— smolvm_pack::extract::copy_data_extents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_pack::extract::extract_libs_from_binary (cognitive 17) crates/smolvm-pack/src/extract.rs:5370— smolvm_pack::extract::extract_libs_from_binary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 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.
smolvm_pack::extract::repair_host_layer_symlink_owners (cognitive 16) crates/smolvm-pack/src/extract.rs:3476— smolvm_pack::extract::repair_host_layer_symlink_owners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×10
Edited copy of a member (11 corresponding lines) crates/smolvm-cuda/src/host.rs:948— crates/smolvm-cuda/src/host.rs:948-958 | crates/smolvm-cuda/src/host/gpu.rs:1178-1195 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/smolvm-pack/src/packer.rs:175— crates/smolvm-pack/src/packer.rs:175-185 | src/portable_checkpoint.rs:1155-1167 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/embedded/runtime.rs:1339— src/embedded/runtime.rs:1339-1349 | src/embedded/runtime.rs:1352-1362 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/smolvm-pack/src/packer.rs:866— crates/smolvm-pack/src/packer.rs:866-876 | crates/smolvm-pack/src/packer.rs:905-922 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/portable_checkpoint.rs:4523— src/portable_checkpoint.rs:4523-4533 | src/portable_checkpoint.rs:4556-4566 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/smolvm-cuda/src/host.rs:2404— crates/smolvm-cuda/src/host.rs:2404-2416 | crates/smolvm-cuda/src/host.rs:2435-2445 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:603— crates/smolvm-cudart-shim/src/lib.rs:603-617 | crates/smolvm-cudart-shim/src/lib.rs:619-629 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/cli/vm_common.rs:1511— src/cli/vm_common.rs:1511-1521 | src/embedded/control.rs:693-704 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:1151— crates/smolvm-cudart-shim/src/lib.rs:1151-1164 | crates/smolvm-cudart-shim/src/lib.rs:1166-1176 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/engine/images.rs:283— src/engine/images.rs:283-293 | src/engine/volumes.rs:47-57 — 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 (12 corresponding lines) · ×10
Edited copy of a member (12 corresponding lines) crates/smolvm-agent/src/nsfile.rs:602— crates/smolvm-agent/src/nsfile.rs:602-620 | crates/smolvm-agent/src/s3mount.rs:144-155 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:1122— crates/smolvm-cudart-shim/src/lib.rs:1122-1133 | crates/smolvm-cudart-shim/src/lib.rs:1138-1149 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/api/device_handoff.rs:88— src/api/device_handoff.rs:88-100 | src/api/device_handoff.rs:102-113 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-pack/src/extract.rs:1591— crates/smolvm-pack/src/extract.rs:1591-1602 | crates/smolvm-pack/src/extract.rs:1659-1670 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-network/src/netns_tap.rs:186— crates/smolvm-network/src/netns_tap.rs:186-197 | src/agent/terminal.rs:235-250 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-pack/src/macho.rs:524— crates/smolvm-pack/src/macho.rs:524-535 | crates/smolvm-pack/src/macho.rs:625-641 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-cuda/src/host/gpu.rs:4142— crates/smolvm-cuda/src/host/gpu.rs:4142-4153 | crates/smolvm-cuda/src/host/gpu.rs:4155-4166 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-shim/src/task.rs:452— crates/smolvm-shim/src/task.rs:452-463 | crates/smolvm-shim/src/task.rs:469-480 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/db.rs:277— src/db.rs:277-354 | src/db.rs:357-368 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:1041— crates/smolvm-cuda-shim/src/lib.rs:1041-1052 | crates/smolvm-cuda-shim/src/lib.rs:1306-1317 — 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.
smolvm_cuda::host::dispatch (cyclomatic 292) crates/smolvm-cuda/src/host.rs:4714— smolvm_cuda::host::dispatch has cyclomatic complexity 292 (threshold 15). Of this number, 289 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_cuda::proto::encode_request (cyclomatic 115) crates/smolvm-cuda/src/proto.rs:976— smolvm_cuda::proto::encode_request has cyclomatic complexity 115 (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.
smolvm_cuda::proto::decode_request (cyclomatic 114) crates/smolvm-cuda/src/proto.rs:1674— smolvm_cuda::proto::decode_request has cyclomatic complexity 114 (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.
smolvm_cuda::host::serve_rings (cyclomatic 48) crates/smolvm-cuda/src/host.rs:3394— smolvm_cuda::host::serve_rings has cyclomatic complexity 48 (threshold 15). Of this number, 37 points are the body's own statements and 11 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_cuda::host::translate_dptrs (cyclomatic 26) crates/smolvm-cuda/src/host.rs:2790— smolvm_cuda::host::translate_dptrs 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.
smolvm_cuda::host::replay_capture_graph (cyclomatic 26) crates/smolvm-cuda/src/host.rs:4564— smolvm_cuda::host::replay_capture_graph has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_cuda::host::reclaim_session (cyclomatic 23) crates/smolvm-cuda/src/host.rs:818— smolvm_cuda::host::reclaim_session has cyclomatic complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: smolvm_cuda::host::optrace_summary (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
smolvm_cuda::host::execute_auto_graph_segment (cyclomatic 23) crates/smolvm-cuda/src/host.rs:4223— smolvm_cuda::host::execute_auto_graph_segment has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: smolvm_cuda::host::optrace_summary (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
smolvm_cuda::host::serve_inner (cyclomatic 16) crates/smolvm-cuda/src/host.rs:3122— smolvm_cuda::host::serve_inner has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: smolvm_cuda::host::optrace_summary (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
smolvm_network::stack::run_network_stack (cyclomatic 49) crates/smolvm-network/src/stack.rs:265— smolvm_network::stack::run_network_stack 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.
smolvm_network::icmp_relay::run_icmp_relay (cyclomatic 23) crates/smolvm-network/src/icmp_relay.rs:146— smolvm_network::icmp_relay::run_icmp_relay 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.
smolvm_network::stack::classify_guest_frame (cyclomatic 23) crates/smolvm-network/src/stack.rs:1555— smolvm_network::stack::classify_guest_frame 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.
smolvm_network::udp_relay::run_udp_relay (cyclomatic 20) crates/smolvm-network/src/udp_relay.rs:135— smolvm_network::udp_relay::run_udp_relay 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.
smolvm_network::udp_publish::run_publisher (cyclomatic 19) crates/smolvm-network/src/udp_publish.rs:198— smolvm_network::udp_publish::run_publisher has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
smolvm_network::dns_cache::cache_lifetime (cyclomatic 16) crates/smolvm-network/src/dns_cache.rs:246— smolvm_network::dns_cache::cache_lifetime 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.
smolvm_network::stack::drain_icmp_echo (cyclomatic 16) crates/smolvm-network/src/stack.rs:848— smolvm_network::stack::drain_icmp_echo 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.
smolvm_network::stack::process_dns_tcp (cyclomatic 16) crates/smolvm-network/src/stack.rs:1346— smolvm_network::stack::process_dns_tcp 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.
smolvm_network::tcp_relay::open_relay_target (cyclomatic 16) crates/smolvm-network/src/tcp_relay.rs:1367— smolvm_network::tcp_relay::open_relay_target 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.
TooManyMethods: Client crates/smolvm-cuda/src/client.rs:209— TooManyMethods — 132 methods. The bar is 30 methods; this is 102 over it, 4.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: AgentClient src/agent/client.rs:1115— TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.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.
TooManyMethods: EmbeddedRuntime src/embedded/runtime.rs:84— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AgentManager src/agent/manager.rs:1676— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SmolvmDb src/db.rs:196— TooManyMethods — 78 methods, declared across 2 files: src/db.rs (69), db/resize.rs (9). The bar is 30 methods; this is 48 over it, 2.60× 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: ApiState src/api/state.rs:72— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 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.
TooManyMethods: CrunCommand crates/smolvm-agent/src/crun.rs:54— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RegistryClient crates/smolvm-registry/src/client.rs:208— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EgressPolicy crates/smolvm-network/src/egress.rs:408— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
AgentManager::start_via_subprocess (cognitive 141) src/agent/manager.rs:3167— AgentManager::start_via_subprocess has cognitive complexity 141 (threshold 15). Drivers by points: if/else 70 (117 pts), boolean chains 13, match/switch 3 (6 pts), loops 4 (5 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentManager::wait_for_ready (cognitive 61) src/agent/manager.rs:4505— AgentManager::wait_for_ready has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (45 pts), match/switch 3 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AgentManager::ensure_running_with_full_config (cognitive 28) src/agent/manager.rs:2662— AgentManager::ensure_running_with_full_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentManager::kill_and_wait (cognitive 27) src/agent/manager.rs:4259— AgentManager::kill_and_wait has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentManager::try_connect_existing_with_pid_and_start_time (cognitive 26) src/agent/manager.rs:2338— AgentManager::try_connect_existing_with_pid_and_start_time has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentManager::stop_vm_process (cognitive 24) src/agent/manager.rs:4076— AgentManager::stop_vm_process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, 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.
AgentManager::stop_inner (cognitive 19) src/agent/manager.rs:4390— AgentManager::stop_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentManager::ensure_running_via_subprocess (cognitive 17) src/agent/manager.rs:3972— AgentManager::ensure_running_via_subprocess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cudart_shim::module_image_len (cognitive 38) crates/smolvm-cudart-shim/src/lib.rs:4564— smolvm_cudart_shim::module_image_len has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cudart_shim::__cudaUnregisterFatBinary (cognitive 35) crates/smolvm-cudart-shim/src/lib.rs:4798— smolvm_cudart_shim::__cudaUnregisterFatBinary has cognitive complexity 35 (threshold 15). Drivers by points: loops 7 (19 pts), if/else 7 (16 pts) (nesting depth added 21). 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.
smolvm_cudart_shim::do_memcpy_inner (cognitive 34) crates/smolvm-cudart-shim/src/lib.rs:2033— smolvm_cudart_shim::do_memcpy_inner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 3 (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.
smolvm_cudart_shim::cuda_host_malloc (cognitive 24) crates/smolvm-cudart-shim/src/lib.rs:1823— smolvm_cudart_shim::cuda_host_malloc has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 4 (7 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.
smolvm_cudart_shim::with_client_state (cognitive 20) crates/smolvm-cudart-shim/src/lib.rs:963— smolvm_cudart_shim::with_client_state has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cudart_shim::bn_size_call (cognitive 18) crates/smolvm-cudart-shim/src/lib.rs:6104— smolvm_cudart_shim::bn_size_call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_cudart_shim::cudaFuncGetAttributes (cognitive 16) crates/smolvm-cudart-shim/src/lib.rs:3613— smolvm_cudart_shim::cudaFuncGetAttributes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
smolvm_cudart_shim::cublasLtMatmulAlgoGetHeuristic (cognitive 16) crates/smolvm-cudart-shim/src/lib.rs:5664— smolvm_cudart_shim::cublasLtMatmulAlgoGetHeuristic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×8
Duplicated block (15 lines × 2) crates/smolvm-agent/src/ssh_agent.rs:261— crates/smolvm-agent/src/ssh_agent.rs:261-275 | crates/smolvm-agent/src/vsock.rs:193-207 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/ssh_agent.rs:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/smolvm-agent/src/storage.rs:848— crates/smolvm-agent/src/storage.rs:848-862 | crates/smolvm-agent/src/storage.rs:886-900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:848` 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) crates/smolvm-agent/src/storage.rs:6403— crates/smolvm-agent/src/storage.rs:6403-6417 | crates/smolvm-agent/src/storage.rs:6481-6495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:6403` it begins part-way through the construct above it, so those 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 (15 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:3888— crates/smolvm-cudart-shim/src/lib.rs:3888-3902 | crates/smolvm-cudart-shim/src/lib.rs:3939-3953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:3888` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:5693— crates/smolvm-cudart-shim/src/lib.rs:5693-5707 | crates/smolvm-cudart-shim/src/lib.rs:5728-5742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/smolvm-cuda/src/host.rs:3978— crates/smolvm-cuda/src/host.rs:3978-3992 | crates/smolvm-cuda/src/host.rs:3998-4012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:3978` 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) crates/smolvm-agent/src/live_resources.rs:248— crates/smolvm-agent/src/live_resources.rs:248-263 | crates/smolvm-agent/src/live_resources.rs:324-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/live_resources.rs:248` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/cuda_daemon.rs:4174— src/cuda_daemon.rs:4174-4188 | src/cuda_daemon.rs:4215-4229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:4174` it does not close everything it opens, so those exact lines 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) crates/smolvm-agent/src/storage.rs:3376— crates/smolvm-agent/src/storage.rs:3376-3383 | crates/smolvm-agent/src/storage.rs:3482-3489 | crates/smolvm-agent/src/storage.rs:3753-3760 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:3376` it begins part-way through the construct above it, so those exact lines 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) crates/smolvm-checkpoint/src/store.rs:951— crates/smolvm-checkpoint/src/store.rs:951-958 | crates/smolvm-checkpoint/src/store.rs:2779-2786 | crates/smolvm-checkpoint/src/store.rs:2900-2907 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-checkpoint/src/store.rs:2897` calls `read_index`, `transpose`, `as_ref` and `crates/smolvm-checkpoint/src/store.rs:950` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) crates/smolvm-cuda/src/host/gpu.rs:3124— crates/smolvm-cuda/src/host/gpu.rs:3124-3131 | crates/smolvm-cuda/src/host/gpu.rs:3153-3160 | crates/smolvm-cuda/src/host/gpu.rs:3177-3184 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:3124` 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 × 3) crates/smolvm-cuda/src/host/gpu.rs:3133— crates/smolvm-cuda/src/host/gpu.rs:3133-3141 | crates/smolvm-cuda/src/host/gpu.rs:3162-3169 | crates/smolvm-cuda/src/host/gpu.rs:3186-3193 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:3133` 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 × 3) crates/smolvm-pack/src/packer.rs:339— crates/smolvm-pack/src/packer.rs:339-346 | crates/smolvm-pack/src/packer.rs:599-606 | crates/smolvm-pack/src/packer.rs:690-697 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/packer.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-pack/src/packer.rs:348` calls `open` and `crates/smolvm-pack/src/packer.rs:609` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) src/api/handlers/machines.rs:5564— src/api/handlers/machines.rs:5564-5571 | src/api/handlers/machines.rs:5676-5683 | src/api/handlers/machines.rs:6028-6035 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) src/cuda_daemon.rs:1729— src/cuda_daemon.rs:1729-1736 | src/cuda_daemon.rs:1794-1801 | src/cuda_daemon.rs:1850-1857 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:1729` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) src/agent/fork.rs:2892— src/agent/fork.rs:2892-2899 | src/portable_checkpoint.rs:1591-1598 | src/portable_checkpoint.rs:1737-1744 — 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.
smolvm_checkpoint::store::prune_in_batches (cognitive 43) crates/smolvm-checkpoint/src/store.rs:1743— smolvm_checkpoint::store::prune_in_batches has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 3 (7 pts), boolean chains 5, loops 3 (5 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.
smolvm_checkpoint::store::materialize_cached (cognitive 33) crates/smolvm-checkpoint/src/store.rs:1998— smolvm_checkpoint::store::materialize_cached has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 7, loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_checkpoint::store::materialize_over (cognitive 22) crates/smolvm-checkpoint/src/store.rs:3057— smolvm_checkpoint::store::materialize_over has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_checkpoint::store::for_each_with_budget (cognitive 20) crates/smolvm-checkpoint/src/store.rs:1435— smolvm_checkpoint::store::for_each_with_budget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_checkpoint::store::materialize_generation (cognitive 20) crates/smolvm-checkpoint/src/store.rs:2197— smolvm_checkpoint::store::materialize_generation has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 3 (6 pts), boolean chains 4, loops 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.
smolvm_checkpoint::store::lineage_of (cognitive 18) crates/smolvm-checkpoint/src/store.rs:820— smolvm_checkpoint::store::lineage_of has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_checkpoint::store::store_chunk (cognitive 17) crates/smolvm-checkpoint/src/store.rs:1540— smolvm_checkpoint::store::store_chunk has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 5 (7 pts), 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.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×7
Edited copy of a member (18 corresponding lines) src/cuda_daemon.rs:178— src/cuda_daemon.rs:178-195 | src/cuda_daemon.rs:242-261 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/smolvm-cuda/src/proto.rs:955— crates/smolvm-cuda/src/proto.rs:955-972 | crates/smolvm-network/src/fabric.rs:138-155 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/smolvm-network/src/icmp_relay.rs:419— crates/smolvm-network/src/icmp_relay.rs:419-436 | crates/smolvm-network/src/icmp_relay.rs:439-458 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/smolvm-pack/src/assets.rs:1234— crates/smolvm-pack/src/assets.rs:1234-1258 | crates/smolvm-pack/src/assets.rs:1263-1280 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/smolvm-cuda/src/host/gpu.rs:2865— crates/smolvm-cuda/src/host/gpu.rs:2865-2882 | crates/smolvm-cuda/src/host/gpu.rs:3539-3564 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:4740— crates/smolvm-cudart-shim/src/lib.rs:4740-4757 | crates/smolvm-cudart-shim/src/lib.rs:4770-4795 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/cuda_daemon.rs:2558— src/cuda_daemon.rs:2558-2575 | src/cuda_daemon.rs:2586-2604 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×7
Edited copy of a member (9 corresponding lines) src/cuda_daemon.rs:4649— src/cuda_daemon.rs:4649-4657 | src/cuda_daemon.rs:4717-4726 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/agent/vnc.rs:918— src/agent/vnc.rs:918-927 | src/agent/vnc.rs:939-947 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/agent/launcher.rs:2845— src/agent/launcher.rs:2845-2853 | src/agent/launcher_dynamic.rs:1312-1320 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:637— crates/smolvm-cuda-shim/src/lib.rs:637-645 | crates/smolvm-cuda-shim/src/lib.rs:647-655 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:155— crates/smolvm-cuda-shim/src/lib.rs:155-164 | crates/smolvm-cudart-shim/src/lib.rs:121-129 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:2794— crates/smolvm-cuda-shim/src/lib.rs:2794-2809 | crates/smolvm-cuda-shim/src/lib.rs:3015-3023 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/smolvm-agent/src/main.rs:260— crates/smolvm-agent/src/main.rs:260-269 | crates/smolvm-agent/src/timesync.rs:92-100 — 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 (7 corresponding lines) · ×7
Edited copy of a member (7 corresponding lines) crates/smolvm-agent/src/forkpoint.rs:491— crates/smolvm-agent/src/forkpoint.rs:491-497 | src/agent/fork.rs:4407-4414 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/smolvm-network/src/switch.rs:252— crates/smolvm-network/src/switch.rs:252-265 | crates/smolvm-network/src/switch.rs:280-286 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:5405— crates/smolvm-cudart-shim/src/lib.rs:5405-5411 | crates/smolvm-cudart-shim/src/lib.rs:5504-5510 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/agent/launcher.rs:2858— src/agent/launcher.rs:2858-2866 | src/platform/uds.rs:174-180 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/smolvm-agent/src/attach.rs:133— crates/smolvm-agent/src/attach.rs:133-141 | crates/smolvm-protocol/src/credentials.rs:373-379 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/smolvm-pack/src/packer.rs:806— crates/smolvm-pack/src/packer.rs:806-814 | crates/smolvm-pack/src/extract.rs:2008-2014 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/agent/manager.rs:1464— src/agent/manager.rs:1464-1470 | src/agent/rootfs_store.rs:31-39 — 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 (14 lines × 2) crates/smolvm-agent/src/nsfile.rs:767— crates/smolvm-agent/src/nsfile.rs:767-780 | crates/smolvm-agent/src/nsfile.rs:1099-1112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/nsfile.rs:767` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/smolvm-agent/src/relay.rs:64— crates/smolvm-agent/src/relay.rs:64-77 | crates/smolvm-agent/src/relay.rs:80-93 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/smolvm-agent/src/storage.rs:1723— crates/smolvm-agent/src/storage.rs:1723-1736 | crates/smolvm-agent/src/storage.rs:1821-1834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:1723` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-agent/src/storage.rs:1835` calls `forward_latest_progress` and `crates/smolvm-agent/src/storage.rs:1737` 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 (14 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:4806— crates/smolvm-cudart-shim/src/lib.rs:4806-4819 | crates/smolvm-cudart-shim/src/lib.rs:4821-4834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:4806` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/artifact_cache.rs:749— src/artifact_cache.rs:749-762 | src/artifact_cache.rs:799-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/artifact_cache.rs:749` it does not close everything it opens, so those 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) src/api/pool_controller.rs:201— src/api/pool_controller.rs:201-214 | src/api/pool_controller.rs:419-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/pool_controller.rs:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/api/pool_controller.rs:217— src/api/pool_controller.rs:217-230 | src/api/pool_controller.rs:435-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
smolvm_cuda_shim::cuLaunchKernel (cognitive 33) crates/smolvm-cuda-shim/src/lib.rs:3321— smolvm_cuda_shim::cuLaunchKernel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cuda_shim::ensure_connected (cognitive 31) crates/smolvm-cuda-shim/src/lib.rs:255— smolvm_cuda_shim::ensure_connected has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (9 pts), boolean chains 3, match/switch 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smolvm_cuda_shim::resolve_proc (cognitive 27) crates/smolvm-cuda-shim/src/lib.rs:3957— smolvm_cuda_shim::resolve_proc has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cuda_shim::cuTensorMapEncodeTiled (cognitive 25) crates/smolvm-cuda-shim/src/lib.rs:4222— smolvm_cuda_shim::cuTensorMapEncodeTiled has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 5, boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cuda_shim::cuLibraryLoadData (cognitive 22) crates/smolvm-cuda-shim/src/lib.rs:2243— smolvm_cuda_shim::cuLibraryLoadData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 5 (7 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.
smolvm_cuda_shim::module_image_len (cognitive 20) crates/smolvm-cuda-shim/src/lib.rs:1403— smolvm_cuda_shim::module_image_len has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: boot_config.rs ↔ launcher.rs src/agent/boot_config.rs:1— `src/agent/boot_config.rs` and `src/agent/launcher.rs` change together 100% of the time (11 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `da8509e6` Stop a machine's workload gracefully and keep its output in a workloa…; `5e9d3584` External egress interceptor (#1405); `b310083f` feat: add --expose-socket and --mount-socket for forwarding arbitrary… — run `git show` on any of them.
Change coupling: main.rs ↔ files.rs crates/smolvm-agent/src/main.rs:1— `crates/smolvm-agent/src/main.rs` and `src/api/handlers/files.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `53508e15` Keep a user's supplementary groups on every exec path, let uploads se…; `9c3140f8` Make file operations target the filesystem exec uses and give each im…; `e9a26706` Prepare file access without running commands from guest images (#1700) — run `git show` on any of them.
Change coupling: main.rs ↔ client.rs crates/smolvm-cuda-codegen/src/main.rs:1— `crates/smolvm-cuda-codegen/src/main.rs` and `crates/smolvm-cuda/src/client.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `780393f2` Support CUDA 13 runtime ABI calls; `67c2c30f` Fix fork-clone serving, sm90 in-VM support, and per-replica module sh…; `98a229d2` CUDA fork: sync-call retry, allocation burst, multi-GPU pinning, sand… — run `git show` on any of them.
Change coupling: main.rs ↔ host.rs crates/smolvm-cuda-codegen/src/main.rs:1— `crates/smolvm-cuda-codegen/src/main.rs` and `crates/smolvm-cuda/src/host.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `780393f2` Support CUDA 13 runtime ABI calls; `67c2c30f` Fix fork-clone serving, sm90 in-VM support, and per-replica module sh…; `98a229d2` CUDA fork: sync-call retry, allocation burst, multi-GPU pinning, sand… — run `git show` on any of them.
Change coupling: client.rs ↔ gpu.rs crates/smolvm-cuda/src/client.rs:1— `crates/smolvm-cuda/src/client.rs` and `crates/smolvm-cuda/src/host/gpu.rs` change together 58% of the time (15 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `23838a2d` Support segmented CUDA graph capture (#987); `780393f2` Support CUDA 13 runtime ABI calls; `67c2c30f` Fix fork-clone serving, sm90 in-VM support, and per-replica module sh… — run `git show` on any of them.
Change coupling: forkpoint.rs ↔ machines.rs crates/smolvm-protocol/src/forkpoint.rs:1— `crates/smolvm-protocol/src/forkpoint.rs` and `src/api/handlers/machines.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `0fa81825` Share active branch memory and guard host capacity (#1204); `62d9b9e9` Keep a released clone alive when the branch helper is its main proces…; `a7eb7885` Make branching the primary machine lifecycle (#1118) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×6
Edited copy of a member (19 corresponding lines) crates/smolvm-agent/src/forkpoint.rs:467— crates/smolvm-agent/src/forkpoint.rs:467-489 | crates/smolvm-agent/src/forkpoint.rs:527-545 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:409— crates/smolvm-cuda-shim/src/lib.rs:409-427 | crates/smolvm-cuda-shim/src/lib.rs:429-452 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/smolvm-agent/src/crun.rs:370— crates/smolvm-agent/src/crun.rs:370-390 | crates/smolvm-agent/src/crun.rs:437-455 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:974— crates/smolvm-cuda-shim/src/lib.rs:974-993 | crates/smolvm-cuda-shim/src/lib.rs:1060-1078 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/engine/supervisor.rs:74— src/engine/supervisor.rs:74-92 | src/process.rs:1828-1846 — 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) bench/workload_dpo.py:63— bench/workload_dpo.py:63-81 | demo/dpo_train.py:62-80 — 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 (17 corresponding lines) · ×6
Edited copy of a member (17 corresponding lines) crates/smolvm-pack/src/format.rs:143— crates/smolvm-pack/src/format.rs:143-166 | crates/smolvm-pack/src/format.rs:205-221 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/engine/network.rs:848— src/engine/network.rs:848-864 | src/engine/network.rs:866-883 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:5517— crates/smolvm-cudart-shim/src/lib.rs:5517-5533 | crates/smolvm-cudart-shim/src/lib.rs:5587-5605 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/smolvm-agent/src/network/linux.rs:151— crates/smolvm-agent/src/network/linux.rs:151-170 | crates/smolvm-agent/src/network/linux.rs:185-201 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/db.rs:439— src/db.rs:439-455 | src/db.rs:476-496 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/agent/client.rs:2427— src/agent/client.rs:2427-2443 | src/agent/client.rs:3728-3744 — 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.
Duplicated block (6 lines × 3) crates/smolvm-agent/src/network/linux.rs:755— crates/smolvm-agent/src/network/linux.rs:755-760 | crates/smolvm-agent/src/network/linux.rs:799-804 | crates/smolvm-agent/src/network/linux.rs:867-872 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/network/linux.rs:755` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/smolvm-cuda/src/host/gpu.rs:3603— crates/smolvm-cuda/src/host/gpu.rs:3603-3608 | crates/smolvm-cuda/src/host/gpu.rs:3639-3644 | crates/smolvm-cuda/src/host/gpu.rs:3704-3709 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda/src/host/gpu.rs:3647` calls `f64` and `crates/smolvm-cuda/src/host/gpu.rs:3712` 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) crates/smolvm-network/src/dns_relay.rs:118— crates/smolvm-network/src/dns_relay.rs:118-123 | crates/smolvm-network/src/icmp_relay.rs:113-118 | crates/smolvm-network/src/udp_relay.rs:103-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) src/api/handlers/machines.rs:6006— src/api/handlers/machines.rs:6006-6011 | src/api/handlers/machines.rs:6090-6095 | src/api/handlers/machines.rs:6441-6446 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:6006` it does not close everything it opens, so those 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 × 3) src/cli/pack_run.rs:786— src/cli/pack_run.rs:786-792 | src/cli/pack_run.rs:1991-1996 | src/cli/pack_run.rs:2494-2502 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:786` 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 × 3) crates/smolvm-pack/src/extract.rs:1877— crates/smolvm-pack/src/extract.rs:1877-1882 | src/cli/machine.rs:996-1001 | src/data/image_source.rs:183-188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:1877` 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.
GpuBackend::cuda_driver_library_call (cognitive 156) crates/smolvm-cuda/src/host/gpu.rs:745— GpuBackend::cuda_driver_library_call has cognitive complexity 156 (threshold 15). Drivers by points: if/else 36 (98 pts), match/switch 22 (49 pts), boolean chains 9 (nesting depth added 89). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GpuBackend::graph_exec_patch (cognitive 83) crates/smolvm-cuda/src/host/gpu.rs:2133— GpuBackend::graph_exec_patch has cognitive complexity 83 (threshold 15). Drivers by points: if/else 23 (63 pts), loops 4 (11 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GpuBackend::gen_lib_call (cognitive 34) crates/smolvm-cuda/src/host/gpu.rs:4169— GpuBackend::gen_lib_call has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 8 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
GpuBackend::graph_introspect (cognitive 20) crates/smolvm-cuda/src/host/gpu.rs:2382— GpuBackend::graph_introspect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 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.
GpuBackend::gpa_procmem (cognitive 17) crates/smolvm-cuda/src/host/gpu.rs:3986— GpuBackend::gpa_procmem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (11–12 lines × 2) crates/smolvm-agent/src/live_resources.rs:265— crates/smolvm-agent/src/live_resources.rs:265-276 | crates/smolvm-agent/src/live_resources.rs:340-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/live_resources.rs:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) crates/smolvm-agent/src/network/linux.rs:751— crates/smolvm-agent/src/network/linux.rs:751-761 | crates/smolvm-agent/src/network/linux.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 `crates/smolvm-agent/src/network/linux.rs:751` it does not close everything it opens, so those 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 × 2) crates/smolvm-agent/src/publish_socket.rs:357— crates/smolvm-agent/src/publish_socket.rs:357-368 | crates/smolvm-agent/src/publish_socket.rs:371-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src/api/handlers/machines.rs:4100— src/api/handlers/machines.rs:4100-4110 | src/api/state.rs:1800-1811 — before extracting anything, compare `src/api/handlers/machines.rs` and `src/api/state.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:4100` 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 (11–12 lines × 2) src/cli/pack_run.rs:810— src/cli/pack_run.rs:810-821 | src/cli/pack_run.rs:2008-2018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:810` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
smolvm_cuda_shim::cuLaunchKernel (cyclomatic 18) crates/smolvm-cuda-shim/src/lib.rs:3321— smolvm_cuda_shim::cuLaunchKernel 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.
smolvm_cuda_shim::resolve_proc (cyclomatic 18) crates/smolvm-cuda-shim/src/lib.rs:3957— smolvm_cuda_shim::resolve_proc 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.
smolvm_cuda_shim::cuLibraryLoadData (cyclomatic 17) crates/smolvm-cuda-shim/src/lib.rs:2243— smolvm_cuda_shim::cuLibraryLoadData 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.
smolvm_cuda_shim::cuTensorMapEncodeTiled (cyclomatic 17) crates/smolvm-cuda-shim/src/lib.rs:4222— smolvm_cuda_shim::cuTensorMapEncodeTiled 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.
AgentClient::interactive_session (cognitive 42) src/agent/client.rs:2497— AgentClient::interactive_session has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 3 (7 pts), boolean chains 6, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentClient::read_exact_retry (cognitive 38) src/agent/client.rs:3898— AgentClient::read_exact_retry has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 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.
AgentClient::interactive_session_io_started (cognitive 32) src/agent/client.rs:2978— AgentClient::interactive_session_io_started has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentClient::receive_stream_to_path (cognitive 17) src/agent/client.rs:3575— AgentClient::receive_stream_to_path 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/smolvm-agent/src/main.rs:8614— crates/smolvm-agent/src/main.rs:8614-8657 | crates/smolvm-agent/src/main.rs:8720-8910 | crates/smolvm-agent/src/main.rs:9004-9051 | crates/smolvm-agent/src/main.rs:9060-9077 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/api/handlers/machines.rs:6241— src/api/handlers/machines.rs:6241-6261 | src/api/handlers/machines.rs:6342-6513 | src/api/handlers/machines.rs:6539-6662 | src/api/handlers/machines.rs:7017-7121 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/cuda_daemon.rs:1780— src/cuda_daemon.rs:1780-1828 | src/cuda_daemon.rs:1836-1913 | src/cuda_daemon.rs:3548-3590 | src/cuda_daemon.rs:4433-4472 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/platform/linux.rs:91— src/platform/linux.rs:91-115 | src/platform/macos.rs:33-63 | src/platform/macos.rs:243-266 | src/platform/windows.rs:30-52 — 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 (21 corresponding lines) · ×4
Edited copy of a member (21 corresponding lines) src/api/state.rs:328— src/api/state.rs:328-354 | src/api/state.rs:359-379 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/agent/manager.rs:153— src/agent/manager.rs:153-173 | src/agent/manager.rs:179-199 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:1110— crates/smolvm-cuda-shim/src/lib.rs:1110-1130 | crates/smolvm-cuda-shim/src/lib.rs:1325-1352 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/api/handlers/mod.rs:160— src/api/handlers/mod.rs:160-184 | src/api/handlers/mod.rs:195-215 — 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 (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) src/embedded/runtime.rs:599— src/embedded/runtime.rs:599-630 | src/embedded/runtime.rs:718-739 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/agent/fork.rs:2362— src/agent/fork.rs:2362-2383 | src/agent/fork.rs:3640-3662 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/smolvm-checkpoint/src/store.rs:253— crates/smolvm-checkpoint/src/store.rs:253-274 | crates/smolvm-checkpoint/src/store.rs:386-414 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/smolvm-agent/src/process.rs:478— crates/smolvm-agent/src/process.rs:478-505 | crates/smolvm-cuda-shim/src/lib.rs:172-193 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×4
Edited copy of a member (20 corresponding lines) src/api/rollout.rs:1373— src/api/rollout.rs:1373-1395 | src/api/rollout.rs:1397-1416 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/db.rs:732— src/db.rs:732-754 | src/db.rs:1141-1160 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/embedded/runtime.rs:1159— src/embedded/runtime.rs:1159-1178 | src/embedded/runtime.rs:1189-1208 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/smolvm-cuda/src/client.rs:1578— crates/smolvm-cuda/src/client.rs:1578-1599 | crates/smolvm-cuda/src/client.rs:1729-1748 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×4
Edited copy of a member (15 corresponding lines) src/cli/machine.rs:1056— src/cli/machine.rs:1056-1074 | src/image_seed.rs:1299-1313 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/agent/fork.rs:60— src/agent/fork.rs:60-74 | src/agent/fork.rs:76-92 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/smolvm-network/src/netns_tap.rs:370— crates/smolvm-network/src/netns_tap.rs:370-384 | src/agent/pod_net.rs:107-122 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:2104— crates/smolvm-cuda-shim/src/lib.rs:2104-2118 | crates/smolvm-cuda-shim/src/lib.rs:2120-2134 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×4
Edited copy of a member (23 corresponding lines) crates/smolvm-checkpoint/src/store.rs:1492— crates/smolvm-checkpoint/src/store.rs:1492-1514 | src/api/cache_base_fetch.rs:269-291 — 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) crates/smolvm-pack/src/extract.rs:69— crates/smolvm-pack/src/extract.rs:69-91 | src/agent/fork.rs:144-166 — 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) src/image_seed.rs:72— src/image_seed.rs:72-99 | src/image_seed.rs:129-151 — 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) crates/smolvm-pack/src/extract.rs:4813— crates/smolvm-pack/src/extract.rs:4813-4837 | crates/smolvm-pack/src/extract.rs:4843-4865 — 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 (12–13 lines × 2) crates/smolvm-agent/src/main.rs:4716— crates/smolvm-agent/src/main.rs:4716-4727 | crates/smolvm-agent/src/main.rs:6368-6380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/smolvm-agent/src/oci.rs:426— crates/smolvm-agent/src/oci.rs:426-437 | crates/smolvm-agent/src/oci.rs:454-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/oci.rs:426` it does not close everything it opens, so those 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–13 lines × 2) crates/smolvm-pack/src/assets.rs:879— crates/smolvm-pack/src/assets.rs:879-891 | crates/smolvm-pack/src/assets.rs:901-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/assets.rs:879` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) src/cli/pack_run.rs:780— src/cli/pack_run.rs:780-792 | src/cli/pack_run.rs:1985-1996 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:780` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: smolvm-protocol — smolvm-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: smolvm-cuda — smolvm-cuda: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: smolvm-s3fs — smolvm-s3fs: abstractness 0.06, instability 0.00, distance 0.94 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: smolvm-pack — smolvm-pack: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Low cohesion: GpuBackend (LCOM4 81) crates/smolvm-cuda/src/host/gpu.rs:97— GpuBackend's methods fall into 81 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 81 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: RunConfig (LCOM4 11) src/agent/client.rs:765— RunConfig's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ApiState (LCOM4 6) src/api/state.rs:72— ApiState'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: KrunFunctions (LCOM4 5) src/agent/krun.rs:48— KrunFunctions's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AgentManager::start_via_subprocess (cyclomatic 88) src/agent/manager.rs:3167— AgentManager::start_via_subprocess has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentManager::wait_for_ready (cyclomatic 24) src/agent/manager.rs:4505— AgentManager::wait_for_ready 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.
AgentManager::ensure_running_with_full_config (cyclomatic 18) src/agent/manager.rs:2662— AgentManager::ensure_running_with_full_config 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.
GpuBackend::cuda_driver_library_call (cyclomatic 78) crates/smolvm-cuda/src/host/gpu.rs:745— GpuBackend::cuda_driver_library_call has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GpuBackend::graph_exec_patch (cyclomatic 34) crates/smolvm-cuda/src/host/gpu.rs:2133— GpuBackend::graph_exec_patch 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.
GpuBackend::gen_lib_call (cyclomatic 21) crates/smolvm-cuda/src/host/gpu.rs:4169— GpuBackend::gen_lib_call 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.
smolvm_pack::extract::safe_unpack_skipping (cyclomatic 72) crates/smolvm-pack/src/extract.rs:986— smolvm_pack::extract::safe_unpack_skipping has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_pack::extract::extract_sidecar_capped (cyclomatic 27) crates/smolvm-pack/src/extract.rs:2188— smolvm_pack::extract::extract_sidecar_capped has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_pack::extract::post_process_extraction (cyclomatic 26) crates/smolvm-pack/src/extract.rs:4529— smolvm_pack::extract::post_process_extraction 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.
AgentClient::interactive_session (cyclomatic 30) src/agent/client.rs:2497— AgentClient::interactive_session has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentClient::interactive_session_io_started (cyclomatic 24) src/agent/client.rs:2978— AgentClient::interactive_session_io_started 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.
AgentClient::read_exact_retry (cyclomatic 17) src/agent/client.rs:3898— AgentClient::read_exact_retry 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.
smolvm_checkpoint::store::prune_in_batches (cyclomatic 27) crates/smolvm-checkpoint/src/store.rs:1743— smolvm_checkpoint::store::prune_in_batches has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
smolvm_checkpoint::store::materialize_cached (cyclomatic 23) crates/smolvm-checkpoint/src/store.rs:1998— smolvm_checkpoint::store::materialize_cached 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.
smolvm_checkpoint::store::store_chunk (cyclomatic 16) crates/smolvm-checkpoint/src/store.rs:1540— smolvm_checkpoint::store::store_chunk 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.
smolvm_cudart_shim::module_image_len (cyclomatic 22) crates/smolvm-cudart-shim/src/lib.rs:4564— smolvm_cudart_shim::module_image_len 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.
smolvm_cudart_shim::do_memcpy_inner (cyclomatic 20) crates/smolvm-cudart-shim/src/lib.rs:2033— smolvm_cudart_shim::do_memcpy_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.
smolvm_cudart_shim::cuda_host_malloc (cyclomatic 16) crates/smolvm-cudart-shim/src/lib.rs:1823— smolvm_cudart_shim::cuda_host_malloc 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.
S3Fs::dispatch (cognitive 170) crates/smolvm-s3fs/src/fs.rs:710— S3Fs::dispatch has cognitive complexity 170 (threshold 15). Drivers by points: if/else 57 (125 pts), match/switch 17 (36 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 90). 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.
S3Fs::remember_listing (cognitive 19) crates/smolvm-s3fs/src/fs.rs:273— S3Fs::remember_listing has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
S3Fs::small_bytes (cognitive 17) crates/smolvm-s3fs/src/fs.rs:356— S3Fs::small_bytes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client::ring_pop_response (cognitive 62) crates/smolvm-cuda/src/client.rs:446— Client::ring_pop_response has cognitive complexity 62 (threshold 15). Drivers by points: if/else 11 (41 pts), loops 6 (19 pts), match/switch 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client::list_dir_snapshot (cognitive 36) crates/smolvm-s3fs/src/s3.rs:340— Client::list_dir_snapshot has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 3 (5 pts), boolean chains 3, match/switch 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.
Client::drain (cognitive 21) crates/smolvm-cuda/src/client.rs:599— Client::drain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackCreateCmd::run (cognitive 40) src/cli/pack.rs:683— PackCreateCmd::run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (31 pts), loops 2 (4 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackCreateCmd::export_layer_to_file (cognitive 19) src/cli/pack.rs:1508— PackCreateCmd::export_layer_to_file has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackCreateCmd::pack_from_vm (cognitive 16) src/cli/pack.rs:1076— PackCreateCmd::pack_from_vm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RolloutExecutor::publish_device_policy (cognitive 27) src/api/rollout.rs:1102— RolloutExecutor::publish_device_policy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 1 (4 pts), loops 1 (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.
RolloutExecutor::publish_policy (cognitive 17) src/api/rollout.rs:967— RolloutExecutor::publish_policy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RolloutExecutor::generate (cognitive 16) src/api/rollout.rs:1448— RolloutExecutor::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
ForkPoolController::fill_pool (cognitive 26) src/api/pool_controller.rs:541— ForkPoolController::fill_pool has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 7 (11 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ForkPoolController::run (cognitive 17) src/api/pool_controller.rs:123— ForkPoolController::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ForkPoolController::reconcile_once (cognitive 17) src/api/pool_controller.rs:253— ForkPoolController::reconcile_once has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×3
Edited copy of a member (29 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:2157— crates/smolvm-cudart-shim/src/lib.rs:2157-2185 | crates/smolvm-cudart-shim/src/lib.rs:2235-2263 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/cuda_daemon.rs:2607— src/cuda_daemon.rs:2607-2639 | src/cuda_daemon.rs:2642-2670 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/smolvm-pack/src/extract.rs:1678— crates/smolvm-pack/src/extract.rs:1678-1706 | src/api/handlers/machines.rs:6721-6752 — 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 copies of one member (3 members, 13+ corresponding lines) · ×3
Edited copies of one member (3 members, 13+ corresponding lines) src/agent/krun.rs:558— src/agent/krun.rs:558-576 | src/agent/krun.rs:583-595 | src/agent/krun.rs:598-619 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/smolvm-pack/src/extract.rs:5254— crates/smolvm-pack/src/extract.rs:5254-5266 | crates/smolvm-pack/src/extract.rs:5270-5282 | src/cuda_daemon.rs:6107-6119 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/smolvm-pack/src/assets.rs:1923— crates/smolvm-pack/src/assets.rs:1923-1937 | crates/smolvm-registry/src/pull.rs:656-668 | src/data/image_source.rs:335-347 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) src/engine/util.rs:329— src/engine/util.rs:329-334 | src/engine/volumes.rs:143-147 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/smolvm-agent/src/ssh_agent.rs:77— crates/smolvm-agent/src/ssh_agent.rs:77-81 | src/agent/client.rs:1212-1217 — 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) src/engine/archive.rs:361— src/engine/archive.rs:361-366 | src/image_seed.rs:701-705 — 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 (18 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:176— crates/smolvm-cuda-shim/src/lib.rs:176-193 | crates/smolvm-cudart-shim/src/lib.rs:141-158 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:176` 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 (18 lines × 2) src/agent/launcher.rs:3164— src/agent/launcher.rs:3164-3181 | src/agent/launcher_dynamic.rs:1094-1111 — before extracting anything, compare `src/agent/launcher.rs` and `src/agent/launcher_dynamic.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/launcher_dynamic.rs:1094` 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 (18 lines × 2) src/cuda_daemon.rs:2198— src/cuda_daemon.rs:2198-2215 | src/cuda_daemon.rs:2219-2236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:2198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) crates/smolvm-agent/src/publish_socket.rs:256— crates/smolvm-agent/src/publish_socket.rs:256-267 | crates/smolvm-agent/src/storage.rs:848-859 | crates/smolvm-agent/src/storage.rs:886-897 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/publish_socket.rs:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/cli/pack_run.rs:754— src/cli/pack_run.rs:754-765 | src/cli/pack_run.rs:1959-1970 | src/cli/pack_run.rs:2452-2463 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:754` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/embedded/runtime.rs:619— src/embedded/runtime.rs:619-630 | src/embedded/runtime.rs:681-692 | src/embedded/runtime.rs:728-739 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/embedded/runtime.rs:619` 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–9 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:410— crates/smolvm-cuda-shim/src/lib.rs:410-417 | crates/smolvm-cuda-shim/src/lib.rs:430-438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:410` it does not close everything it opens, so those 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–9 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:5336— crates/smolvm-cudart-shim/src/lib.rs:5336-5343 | crates/smolvm-cudart-shim/src/lib.rs:5362-5370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/smolvm-registry/src/token_store.rs:137— crates/smolvm-registry/src/token_store.rs:137-144 | src/portable_checkpoint.rs:4052-4060 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) crates/smolvm-cuda/src/host/gpu.rs:984— crates/smolvm-cuda/src/host/gpu.rs:984-990 | crates/smolvm-cuda/src/host/gpu.rs:1082-1088 | crates/smolvm-cuda/src/host/gpu.rs:1108-1114 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:984` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-cuda/src/host/gpu.rs:1090` calls `from_le_bytes`, `try_into`, `ok` and `crates/smolvm-cuda/src/host/gpu.rs:992` 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 × 3) crates/smolvm-cuda/src/host/gpu.rs:3597— crates/smolvm-cuda/src/host/gpu.rs:3597-3603 | crates/smolvm-cuda/src/host/gpu.rs:3633-3639 | crates/smolvm-cuda/src/host/gpu.rs:3692-3698 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-cuda/src/host/gpu.rs:3631` calls `i32` and `crates/smolvm-cuda/src/host/gpu.rs:3595` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) crates/smolvm-cudart-shim/src/lib.rs:5537— crates/smolvm-cudart-shim/src/lib.rs:5537-5543 | crates/smolvm-cudart-shim/src/lib.rs:5609-5615 | crates/smolvm-cudart-shim/src/lib.rs:5644-5650 — 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.
Outbound HTTP without resilience REDACTED:24— `urllib.request.urlopen(` 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 src/api/handlers/exec.rs:1522— `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src/engine/image_ops.rs:560— `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC3 · Page structure· Page without a main landmark · ×2
Page without a main landmark packaging/repos/pacman-arch-index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark src/agent/vnc_client.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
S3Fs::dispatch (cyclomatic 99) crates/smolvm-s3fs/src/fs.rs:710— S3Fs::dispatch has cyclomatic complexity 99 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
S3Fs::remember_listing (cyclomatic 16) crates/smolvm-s3fs/src/fs.rs:273— S3Fs::remember_listing 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.
CreateCmd::run_from_smolmachine (cyclomatic 26) src/cli/machine.rs:5375— CreateCmd::run_from_smolmachine has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: MachineCmd::run (cyclomatic 31) 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.
CreateCmd::create_spec (cyclomatic 22) src/cli/machine.rs:5148— CreateCmd::create_spec has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: MachineCmd::run (cyclomatic 31) 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.
ServeStartCmd::run_server (cyclomatic 26) src/cli/serve.rs:461— ServeStartCmd::run_server 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.
ServeStartCmd::run (cyclomatic 22) src/cli/serve.rs:225— ServeStartCmd::run 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.
Client::ring_pop_response (cyclomatic 20) crates/smolvm-cuda/src/client.rs:446— Client::ring_pop_response 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.
Client::list_dir_snapshot (cyclomatic 20) crates/smolvm-s3fs/src/s3.rs:340— Client::list_dir_snapshot 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.
EmbeddedRuntime::pause_machine_inner (cyclomatic 20) src/embedded/runtime.rs:259— EmbeddedRuntime::pause_machine_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.
EmbeddedRuntime::resume_machine_inner (cyclomatic 18) src/embedded/runtime.rs:412— EmbeddedRuntime::resume_machine_inner has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ApiState::load_persisted_machines (cognitive 37) src/api/state.rs:545— ApiState::load_persisted_machines has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 3 (7 pts), boolean chains 1, 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.
ApiState::real_utilization (cognitive 29) src/api/state.rs:1006— ApiState::real_utilization has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateCmd::run_from_smolmachine (cognitive 37) src/cli/machine.rs:5375— CreateCmd::run_from_smolmachine has cognitive complexity 37 (threshold 15). Drivers by points: if/else 25 (31 pts), boolean chains 4, match/switch 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.
CreateCmd::create_spec (cognitive 24) src/cli/machine.rs:5148— CreateCmd::create_spec has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EmbeddedRuntime::pause_machine_inner (cognitive 36) src/embedded/runtime.rs:259— EmbeddedRuntime::pause_machine_inner has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 4, match/switch 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EmbeddedRuntime::resume_machine_inner (cognitive 30) src/embedded/runtime.rs:412— EmbeddedRuntime::resume_machine_inner has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_shim::engine::pump_loop (cognitive 33) crates/smolvm-shim/src/engine.rs:522— smolvm_shim::engine::pump_loop has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_shim::engine::materialize_bind_mounts (cognitive 21) crates/smolvm-shim/src/engine.rs:1100— smolvm_shim::engine::materialize_bind_mounts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CheckpointStream::append (cognitive 30) crates/smolvm-pack/src/checkpoint_stream.rs:206— CheckpointStream::append has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (6 pts), match/switch 1 (3 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.
CheckpointStream::read (cognitive 17) crates/smolvm-pack/src/checkpoint_stream.rs:28— CheckpointStream::read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 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.
MachoFile::shift_offsets_after (cognitive 30) crates/smolvm-pack/src/macho.rs:700— MachoFile::shift_offsets_after has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MachoFile::sign_adhoc (cognitive 21) crates/smolvm-pack/src/macho.rs:770— MachoFile::sign_adhoc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5, 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.
ServeStartCmd::run (cognitive 30) src/cli/serve.rs:225— ServeStartCmd::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (24 pts), 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.
ServeStartCmd::run_server (cognitive 27) src/cli/serve.rs:461— ServeStartCmd::run_server has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (20 pts), match/switch 5, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Writer::ingest_chunks (cognitive 26) crates/smolvm-checkpoint/src/store.rs:284— Writer::ingest_chunks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Writer::retain_generations_from (cognitive 25) crates/smolvm-checkpoint/src/store.rs:717— Writer::retain_generations_from has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (4 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.
PackPruneCmd::prune_cache_dir (cognitive 20) src/cli/pack.rs:1770— PackPruneCmd::prune_cache_dir has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (5 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackPruneCmd::run (cognitive 18) src/cli/pack.rs:1664— PackPruneCmd::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/smolvm-registry/src/client.rs:390— crates/smolvm-registry/src/client.rs:390-422 | crates/smolvm-registry/src/client.rs:704-730 | crates/smolvm-registry/src/client.rs:798-817 | crates/smolvm-registry/src/client.rs:1116-1140 | crates/smolvm-registry/src/peer.rs:154-171 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/api/device_handoff.rs:322— src/api/device_handoff.rs:322-349 | src/cuda_daemon.rs:495-526 | src/cuda_daemon.rs:528-575 | src/cuda_daemon.rs:4342-4374 | src/cuda_daemon.rs:4381-4425 — 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 (41 corresponding lines) · ×2
Edited copy of a member (41 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:3883— crates/smolvm-cudart-shim/src/lib.rs:3883-3923 | crates/smolvm-cudart-shim/src/lib.rs:3931-3979 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) src/api/memory_pressure.rs:789— src/api/memory_pressure.rs:789-834 | src/api/memory_pressure.rs:836-876 — 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 (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) crates/smolvm-network/src/icmp_relay.rs:462— crates/smolvm-network/src/icmp_relay.rs:462-486 | crates/smolvm-network/src/icmp_relay.rs:489-514 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:2419— crates/smolvm-cuda-shim/src/lib.rs:2419-2443 | crates/smolvm-cuda-shim/src/lib.rs:2446-2471 — 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 copy of a member (27 corresponding lines) · ×2
Edited copy of a member (27 corresponding lines) crates/smolvm-agent/src/oci.rs:425— crates/smolvm-agent/src/oci.rs:425-451 | crates/smolvm-agent/src/oci.rs:453-484 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/smolvm-agent/src/docker_bridge.rs:40— crates/smolvm-agent/src/docker_bridge.rs:40-69 | crates/smolvm-agent/src/port_forward.rs:34-60 — 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, 24+ corresponding lines) · ×2
Edited copies of one member (3 members, 24+ corresponding lines) src/agent/client.rs:2116— src/agent/client.rs:2116-2139 | src/agent/client.rs:2143-2166 | src/agent/client.rs:2169-2199 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 24+ corresponding lines) crates/smolvm-network/src/dns_relay.rs:117— crates/smolvm-network/src/dns_relay.rs:117-141 | crates/smolvm-network/src/icmp_relay.rs:112-135 | crates/smolvm-network/src/udp_relay.rs:102-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×2
Edited copies of one member (3 members, 14+ corresponding lines) crates/smolvm-agent/src/oci.rs:746— crates/smolvm-agent/src/oci.rs:746-759 | crates/smolvm-agent/src/oci.rs:767-780 | crates/smolvm-agent/src/oci.rs:798-822 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/smolvm-pack/src/assets.rs:1018— crates/smolvm-pack/src/assets.rs:1018-1032 | crates/smolvm-pack/src/assets.rs:1056-1069 | crates/smolvm-pack/src/assets.rs:1072-1087 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) src/api/handlers/machines.rs:698— src/api/handlers/machines.rs:698-706 | src/cli/pack.rs:671-681 | src/portable_checkpoint.rs:1490-1500 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:6147— crates/smolvm-cudart-shim/src/lib.rs:6147-6162 | crates/smolvm-cudart-shim/src/lib.rs:6178-6195 | crates/smolvm-cudart-shim/src/lib.rs:6205-6213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×2
Edited copies of one member (4 members, 9+ corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:93— crates/smolvm-cuda-shim/src/lib.rs:93-101 | crates/smolvm-cuda/src/host.rs:1011-1019 | crates/smolvm-cuda/src/host.rs:1025-1033 | crates/smolvm-cudart-shim/src/lib.rs:1288-1296 — 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.
Edited copies of one member (4 members, 9+ corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:2745— crates/smolvm-cuda-shim/src/lib.rs:2745-2756 | crates/smolvm-cuda-shim/src/lib.rs:2769-2777 | crates/smolvm-cuda-shim/src/lib.rs:2969-2981 | crates/smolvm-cuda-shim/src/lib.rs:3436-3445 — 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 (4 members, 10+ corresponding lines) · ×2
Edited copies of one member (4 members, 10+ corresponding lines) crates/smolvm-agent/src/ssh_agent.rs:223— crates/smolvm-agent/src/ssh_agent.rs:223-233 | crates/smolvm-agent/src/ssh_agent.rs:238-248 | crates/smolvm-agent/src/vsock.rs:127-136 | crates/smolvm-agent/src/vsock.rs:141-150 — 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.
Edited copies of one member (4 members, 10+ corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:682— crates/smolvm-cuda-shim/src/lib.rs:682-692 | crates/smolvm-cuda-shim/src/lib.rs:776-786 | crates/smolvm-cuda-shim/src/lib.rs:803-813 | crates/smolvm-cuda-shim/src/lib.rs:883-892 — 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 copy of a member (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) src/portable_checkpoint.rs:612— src/portable_checkpoint.rs:612-615 | src/vm_exit.rs:224-227 — 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) src/cli/vm_common.rs:395— src/cli/vm_common.rs:395-398 | src/util.rs:376-381 — 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 (14–17 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:3639— crates/smolvm-cuda/src/host/gpu.rs:3639-3655 | crates/smolvm-cuda/src/host/gpu.rs:3704-3717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:3639` it does not close everything it opens, so those exact lines 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–17 lines × 2) src/portable_checkpoint.rs:5732— src/portable_checkpoint.rs:5732-5748 | src/portable_checkpoint.rs:5780-5793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–16 lines × 2) crates/smolvm-registry/src/client.rs:446— crates/smolvm-registry/src/client.rs:446-461 | crates/smolvm-registry/src/client.rs:585-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) src/cli/pack_run.rs:838— src/cli/pack_run.rs:838-853 | src/cli/pack_run.rs:2032-2046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:838` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13–14 lines × 3) crates/smolvm-registry/src/client.rs:334— crates/smolvm-registry/src/client.rs:334-347 | crates/smolvm-registry/src/client.rs:455-468 | crates/smolvm-registry/src/client.rs:593-605 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 3) src/cli/pack_run.rs:837— src/cli/pack_run.rs:837-850 | src/cli/pack_run.rs:2031-2043 | src/cli/pack_run.rs:2431-2443 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:837` 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 × 2) crates/smolvm-agent/src/main.rs:8617— crates/smolvm-agent/src/main.rs:8617-8627 | crates/smolvm-agent/src/main.rs:8723-8736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:8617` it does not close everything it opens, so those exact lines 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–14 lines × 2) crates/smolvm-agent/src/vsock.rs:44— crates/smolvm-agent/src/vsock.rs:44-57 | crates/smolvm-agent/src/vsock.rs:205-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/vsock.rs:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-agent/src/vsock.rs:43` calls `bind` and `crates/smolvm-agent/src/vsock.rs:203` 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 × 3) crates/smolvm-cuda/src/host.rs:4321— crates/smolvm-cuda/src/host.rs:4321-4332 | crates/smolvm-cuda/src/host.rs:4361-4372 | crates/smolvm-cuda/src/host.rs:4380-4392 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:4321` 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 (12–13 lines × 3) src/api/handlers/exec.rs:122— src/api/handlers/exec.rs:122-133 | src/api/handlers/exec.rs:185-197 | src/api/handlers/exec.rs:301-312 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/exec.rs:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/api/handlers/exec.rs:184` calls `clone` and `src/api/handlers/exec.rs:121` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) crates/smolvm-agent/src/storage.rs:5172— crates/smolvm-agent/src/storage.rs:5172-5183 | crates/smolvm-agent/src/storage.rs:5329-5338 — both copies are in the same file, so extract the block into 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 × 2) crates/smolvm-cudart-shim/src/lib.rs:2580— crates/smolvm-cudart-shim/src/lib.rs:2580-2589 | crates/smolvm-cudart-shim/src/lib.rs:2707-2718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:2580` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/smolvm-pack/src/assets.rs:1959— crates/smolvm-pack/src/assets.rs:1959-1969 | crates/smolvm-pack/src/extract.rs:5400-5409 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) src/cli/pack.rs:1041— src/cli/pack.rs:1041-1051 | src/cli/pack.rs:1190-1199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 3) crates/smolvm-agent/src/main.rs:4186— crates/smolvm-agent/src/main.rs:4186-4195 | crates/smolvm-agent/src/main.rs:8187-8196 | crates/smolvm-agent/src/main.rs:8282-8291 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:4186` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `stream` to `&mut impl ReadWrite` in one and `&mut impl Write` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 3) src/artifact_cache.rs:637— src/artifact_cache.rs:637-646 | src/artifact_cache.rs:758-767 | src/artifact_cache.rs:808-817 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) src/cuda_daemon.rs:498— src/cuda_daemon.rs:498-506 | src/cuda_daemon.rs:4346-4354 | src/cuda_daemon.rs:4385-4393 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:498` 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 × 3) crates/smolvm-checkpoint/src/store.rs:1006— crates/smolvm-checkpoint/src/store.rs:1006-1014 | crates/smolvm-checkpoint/src/store.rs:2788-2796 | crates/smolvm-checkpoint/src/store.rs:2961-2969 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) src/cli/pack.rs:1888— src/cli/pack.rs:1888-1892 | src/cli/pack.rs:1938-1942 | src/cli/pack.rs:2188-2192 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack.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 (5 lines × 3) crates/smolvm-checkpoint/src/store.rs:1725— crates/smolvm-checkpoint/src/store.rs:1725-1730 | crates/smolvm-checkpoint/src/store.rs:1935-1940 | src/api/state.rs:312-316 — 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.
Sync-over-async blocking src/cli/serve.rs:461— `run_server` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking src/cli/serve.rs:801— `serve_tcp_tls` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative src/agent/vnc_client.html:22— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
RunCmd::run (cyclomatic 121) src/cli/machine.rs:1405— RunCmd::run has cyclomatic complexity 121 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UpdateCmd::run (cyclomatic 77) src/cli/machine.rs:7170— UpdateCmd::run has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent 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::forward (cyclomatic 44) crates/smolvm-credentials/src/intercept.rs:470— State::forward 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.
PoolAdmissionState::observe (cyclomatic 34) src/api/admission.rs:251— PoolAdmissionState::observe 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.
LibkrunVm::exec_vm (cyclomatic 34) src/vm/backend/libkrun.rs:101— LibkrunVm::exec_vm 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.
RelayPump::pump (cyclomatic 32) crates/smolvm-network/src/tcp_relay.rs:1795— RelayPump::pump 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.
MonitorCmd::run (cyclomatic 29) src/cli/machine.rs:8250— MonitorCmd::run has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent 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: MachineCmd::run (cyclomatic 31) 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.
VmRecord::updated_egress (cyclomatic 29) src/config.rs:1601— VmRecord::updated_egress 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.
PackRunCmd::run (cyclomatic 27) src/cli/pack_run.rs:472— PackRunCmd::run has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PackCreateCmd::run (cyclomatic 26) src/cli/pack.rs:683— PackCreateCmd::run 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.
CredentialPolicy::validate (cyclomatic 25) crates/smolvm-protocol/src/credentials.rs:171— CredentialPolicy::validate 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.
NvmlSampler::new (cyclomatic 22) src/api/admission.rs:1034— NvmlSampler::new 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.
smolvm_oci_layer::extract_oci_layer_with_size (cyclomatic 21) crates/smolvm-oci-layer/src/lib.rs:243— smolvm_oci_layer::extract_oci_layer_with_size 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.
smolvm_shim::engine::pump_loop (cyclomatic 21) crates/smolvm-shim/src/engine.rs:522— smolvm_shim::engine::pump_loop 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.
Reference::parse (cyclomatic 21) src/registry.rs:455— Reference::parse 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.
ForkPoolController::fill_pool (cyclomatic 20) src/api/pool_controller.rs:541— ForkPoolController::fill_pool 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.
SmolvmDb::claim_fork_pool_slot (cyclomatic 20) src/db.rs:1545— SmolvmDb::claim_fork_pool_slot 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.
ForkCmd::run (cyclomatic 19) src/cli/machine.rs:5998— ForkCmd::run has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: MachineCmd::run (cyclomatic 31) 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.
ImageRef::parse (cyclomatic 19) src/engine/images.rs:35— ImageRef::parse has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CudnnBackend::dispatch (cyclomatic 18) crates/smolvm-cuda/src/host/gpu.rs:2889— CudnnBackend::dispatch 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.
Reactor::drive (cyclomatic 18) crates/smolvm-network/src/tcp_reactor.rs:493— Reactor::drive 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.
LaunchFeatures::with_packed_layers_with_mode (cyclomatic 17) src/agent/launcher.rs:438— LaunchFeatures::with_packed_layers_with_mode 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.
RolloutExecutor::publish_device_policy (cyclomatic 16) src/api/rollout.rs:1102— RolloutExecutor::publish_device_policy 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.
RegistriesCmd::run (cyclomatic 16) src/cli/config.rs:121— RegistriesCmd::run 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.
RunCmd::run (cognitive 213) src/cli/machine.rs:1405— RunCmd::run has cognitive complexity 213 (threshold 15). Drivers by points: if/else 94 (165 pts), boolean chains 38, match/switch 6 (9 pts), loops 1 (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateCmd::run (cognitive 111) src/cli/machine.rs:7170— UpdateCmd::run has cognitive complexity 111 (threshold 15). Drivers by points: if/else 54 (77 pts), loops 14 (20 pts), boolean chains 11, match/switch 2 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::forward (cognitive 66) crates/smolvm-credentials/src/intercept.rs:470— State::forward has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28 (45 pts), match/switch 9 (13 pts), boolean chains 6, loops 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.
MonitorCmd::run (cognitive 66) src/cli/machine.rs:8250— MonitorCmd::run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (47 pts), match/switch 4 (15 pts), boolean chains 3, loops 1 (nesting depth added 37). Of this number, 65 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibkrunVm::exec_vm (cognitive 58) src/vm/backend/libkrun.rs:101— LibkrunVm::exec_vm has cognitive complexity 58 (threshold 15). Drivers by points: if/else 33 (50 pts), loops 3, match/switch 1 (3 pts), boolean chains 2 (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.
RelayPump::pump (cognitive 52) crates/smolvm-network/src/tcp_relay.rs:1795— RelayPump::pump has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 3 (10 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_oci_layer::extract_oci_layer_with_size (cognitive 52) crates/smolvm-oci-layer/src/lib.rs:243— smolvm_oci_layer::extract_oci_layer_with_size has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (44 pts), match/switch 2 (6 pts), loops 2 (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.
PoolAdmissionState::observe (cognitive 48) src/api/admission.rs:251— PoolAdmissionState::observe has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (37 pts), boolean chains 11 (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.
CredentialPolicy::validate (cognitive 43) crates/smolvm-protocol/src/credentials.rs:171— CredentialPolicy::validate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 4 (6 pts), boolean chains 5 (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.
VmRecord::updated_egress (cognitive 40) src/config.rs:1601— VmRecord::updated_egress has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 8 (9 pts), boolean chains 6 (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.
NvmlSampler::new (cognitive 37) src/api/admission.rs:1034— NvmlSampler::new has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 4, loops 2 (3 pts), match/switch 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.
PackRunCmd::run (cognitive 37) src/cli/pack_run.rs:472— PackRunCmd::run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 4, match/switch 3 (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.
CudnnBackend::dispatch (cognitive 32) crates/smolvm-cuda/src/host/gpu.rs:2889— CudnnBackend::dispatch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LaunchFeatures::with_packed_layers_with_mode (cognitive 32) src/agent/launcher.rs:438— LaunchFeatures::with_packed_layers_with_mode has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (29 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.
Reference::parse (cognitive 32) src/registry.rs:455— Reference::parse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PruneCmd::run (cognitive 30) src/cli/machine.rs:7765— PruneCmd::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (25 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Forwarder::service (cognitive 29) crates/smolvm-network/src/dns_forward.rs:266— Forwarder::service has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (7 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.
vnc_client.html.updateLoop (cognitive 29) src/agent/vnc_client.html:189— vnc_client.html.updateLoop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (8 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.
TcpRelayTable::service (cognitive 28) crates/smolvm-network/src/tcp_relay.rs:794— TcpRelayTable::service has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmolvmDb::claim_fork_pool_slot (cognitive 27) src/db.rs:1545— SmolvmDb::claim_fork_pool_slot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reactor::drive (cognitive 26) crates/smolvm-network/src/tcp_reactor.rs:493— Reactor::drive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegistriesCmd::run (cognitive 26) src/cli/config.rs:121— RegistriesCmd::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
InteractiveFrame::read_next (cognitive 24) crates/smolvm-agent/src/main.rs:6420— InteractiveFrame::read_next has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (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.
smolvm_credentials::scrub::forms (cognitive 24) crates/smolvm-credentials/src/scrub.rs:130— smolvm_credentials::scrub::forms has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (10 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.
AssetCollector::compress_with (cognitive 23) crates/smolvm-pack/src/assets.rs:1349— AssetCollector::compress_with has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (7 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.
ExecCmd::run (cognitive 23) src/cli/machine.rs:4290— ExecCmd::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoPublisher::apply (cognitive 23) src/network/auto_ports.rs:142— AutoPublisher::apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (5 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CheckpointLogCmd::run (cognitive 22) src/cli/pack.rs:223— CheckpointLogCmd::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_cuda_codegen::gen_guest (cognitive 21) crates/smolvm-cuda-codegen/src/main.rs:732— smolvm_cuda_codegen::gen_guest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 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.
HostProxy::from_scutil (cognitive 21) src/cli/host_network.rs:170— HostProxy::from_scutil has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlobCache::list_artifacts (cognitive 20) crates/smolvm-registry/src/cache.rs:288— BlobCache::list_artifacts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 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.
ImageRef::parse (cognitive 20) src/engine/images.rs:35— ImageRef::parse has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), match/switch 5 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smolvm_registry::pull::download_with_resume (cognitive 19) crates/smolvm-registry/src/pull.rs:465— smolvm_registry::pull::download_with_resume has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WriteSession::finalize (cognitive 18) crates/smolvm-agent/src/main.rs:3694— WriteSession::finalize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HostMount::validate_with_system_mounts (cognitive 18) src/data/storage.rs:281— HostMount::validate_with_system_mounts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegistryClient::get_token (cognitive 17) crates/smolvm-registry/src/client.rs:1405— RegistryClient::get_token has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ExecSessions::reap (cognitive 17) src/api/exec_sessions.rs:986— ExecSessions::reap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 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.
Keep::from_records (cognitive 17) src/checkpoint_retention.rs:203— Keep::from_records has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 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.
ForkCmd::run (cognitive 17) src/cli/machine.rs:5998— ForkCmd::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Images::insert (cognitive 17) src/engine/images.rs:328— Images::insert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmolSettings::load_from_disk (cognitive 17) src/settings.rs:126— SmolSettings::load_from_disk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WsStream::next_payload (cognitive 16) src/agent/websocket.rs:72— WsStream::next_payload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 3 (6 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImagesCmd::run (cognitive 16) src/cli/machine.rs:7659— ImagesCmd::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFunctions: smolvm_nvml_shim crates/smolvm-nvml-shim/src/lib.rs:40— TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×1
D4 · Code Duplication· Near-duplicate member family (3 members, 44 shared lines) · ×1
Near-duplicate member family (3 members, 44 shared lines) src/cli/pack_run.rs:472— src/cli/pack_run.rs:472-937 | src/cli/pack_run.rs:1863-2101 | src/cli/pack_run.rs:2275-2546 — These 3 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (83 shared lines) src/api/rollout.rs:970— src/api/rollout.rs:970-1099 | src/api/rollout.rs:1105-1271 — These two members are variants of one another: 83 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (80 shared lines) crates/smolvm-agent/src/main.rs:6504— crates/smolvm-agent/src/main.rs:6504-6796 | crates/smolvm-agent/src/main.rs:6808-7052 — These two members are variants of one another: 80 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) crates/smolvm-agent/src/live_resources.rs:234— crates/smolvm-agent/src/live_resources.rs:234-291 | crates/smolvm-agent/src/live_resources.rs:310-363 — 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 (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) src/api/handlers/exec.rs:68— src/api/handlers/exec.rs:68-219 | src/api/handlers/exec.rs:245-341 | src/api/handlers/exec.rs:625-726 | src/api/handlers/exec_sessions.rs:261-371 | src/api/handlers/machines.rs:3598-4158 | src/api/state.rs:1748-1813 — 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· Edited copy of a member (100 corresponding lines) · ×1
Edited copy of a member (100 corresponding lines) src/config.rs:1015— src/config.rs:1015-1114 | src/config.rs:1125-1224 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) src/agent/manager.rs:2668— src/agent/manager.rs:2668-2776 | src/agent/manager.rs:3978-4054 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (88 corresponding lines) · ×1
Edited copy of a member (88 corresponding lines) crates/smolvm-network/src/tcp_relay.rs:901— crates/smolvm-network/src/tcp_relay.rs:901-1008 | crates/smolvm-network/src/tcp_relay.rs:1031-1118 — These two members are one piece of code written twice and then edited apart: 88 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) src/api/pool_controller.rs:200— src/api/pool_controller.rs:200-251 | src/api/pool_controller.rs:418-470 — 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 (78 corresponding lines) · ×1
Edited copy of a member (78 corresponding lines) crates/smolvm-pack/src/packer.rs:307— crates/smolvm-pack/src/packer.rs:307-387 | crates/smolvm-pack/src/packer.rs:670-747 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) crates/smolvm-registry/src/client.rs:324— crates/smolvm-registry/src/client.rs:324-384 | crates/smolvm-registry/src/client.rs:445-504 — 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 (79 corresponding lines) · ×1
Edited copy of a member (79 corresponding lines) crates/smolvm-agent/src/main.rs:4149— crates/smolvm-agent/src/main.rs:4149-4238 | crates/smolvm-agent/src/main.rs:8164-8242 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) crates/smolvm-cuda/src/host/gpu.rs:1802— crates/smolvm-cuda/src/host/gpu.rs:1802-1864 | crates/smolvm-cuda/src/host/gpu.rs:1866-1921 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:5938— crates/smolvm-cudart-shim/src/lib.rs:5938-5977 | crates/smolvm-cudart-shim/src/lib.rs:6012-6056 — 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, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) crates/smolvm-agent/src/network/linux.rs:750— crates/smolvm-agent/src/network/linux.rs:750-785 | crates/smolvm-agent/src/network/linux.rs:794-831 | crates/smolvm-agent/src/network/linux.rs:863-897 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 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 (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) crates/smolvm-registry/src/client.rs:1266— crates/smolvm-registry/src/client.rs:1266-1323 | crates/smolvm-registry/src/client.rs:1348-1398 — 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 (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) crates/smolvm-agent/src/ssh_agent.rs:257— crates/smolvm-agent/src/ssh_agent.rs:257-299 | crates/smolvm-agent/src/vsock.rs:189-231 — 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 copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) crates/smolvm-pack/src/macho.rs:136— crates/smolvm-pack/src/macho.rs:136-156 | crates/smolvm-pack/src/macho.rs:199-222 | crates/smolvm-pack/src/macho.rs:381-398 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) src/db.rs:1471— src/db.rs:1471-1500 | src/db.rs:1509-1538 | src/db.rs:1954-1984 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) crates/smolvm-cuda/src/host.rs:1321— crates/smolvm-cuda/src/host.rs:1321-1366 | crates/smolvm-cuda/src/host.rs:1374-1404 — 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 copies of one member (3 members, 37+ corresponding lines) · ×1
Edited copies of one member (3 members, 37+ corresponding lines) crates/smolvm-registry/src/client.rs:850— crates/smolvm-registry/src/client.rs:850-892 | crates/smolvm-registry/src/client.rs:898-934 | crates/smolvm-registry/src/client.rs:940-992 — 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 (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) crates/smolvm-pack/src/extract.rs:2642— crates/smolvm-pack/src/extract.rs:2642-2667 | crates/smolvm-pack/src/extract.rs:2677-2708 — 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) · ×1
Edited copy of a member (24 corresponding lines) src/api/handlers/pools.rs:712— src/api/handlers/pools.rs:712-739 | src/api/handlers/pools.rs:1231-1254 — 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 (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) crates/smolvm-network/src/fabric.rs:370— crates/smolvm-network/src/fabric.rs:370-387 | crates/smolvm-network/src/switch.rs:640-655 — 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 (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) src/agent/launcher.rs:3118— src/agent/launcher.rs:3118-3157 | src/agent/launcher_dynamic.rs:1049-1086 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 27+ corresponding lines) · ×1
Edited copies of one member (4 members, 27+ corresponding lines) src/agent/client.rs:2708— src/agent/client.rs:2708-2734 | src/agent/client.rs:2794-2824 | src/agent/client.rs:2838-2866 | src/agent/client.rs:3152-3181 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×1
Edited copies of one member (4 members, 16+ corresponding lines) src/db.rs:1076— src/db.rs:1076-1091 | src/db.rs:1248-1265 | src/db.rs:2075-2092 | src/db.rs:2095-2112 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 14+ corresponding lines) · ×1
Edited copies of one member (6 members, 14+ corresponding lines) src/db.rs:1060— src/db.rs:1060-1073 | src/db.rs:1118-1136 | src/db.rs:1268-1281 | src/db.rs:1795-1808 | src/db.rs:1811-1824 | src/db/resize.rs:133-147 — These 6 members are one piece of code written 6 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 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) crates/smolvm-cudart-shim/src/lib.rs:1378— crates/smolvm-cudart-shim/src/lib.rs:1378-1392 | crates/smolvm-cudart-shim/src/lib.rs:2327-2345 | crates/smolvm-cudart-shim/src/lib.rs:2871-2883 | crates/smolvm-cudart-shim/src/lib.rs:4399-4416 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) crates/smolvm-cudart-shim/src/lib.rs:5536— crates/smolvm-cudart-shim/src/lib.rs:5536-5543 | crates/smolvm-cudart-shim/src/lib.rs:5608-5615 | crates/smolvm-cudart-shim/src/lib.rs:5643-5650 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:2955— crates/smolvm-cuda-shim/src/lib.rs:2955-2966 | crates/smolvm-cuda-shim/src/lib.rs:3001-3012 | crates/smolvm-cudart-shim/src/lib.rs:4359-4372 | crates/smolvm-cudart-shim/src/lib.rs:4418-4431 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) src/agent/client.rs:3499— src/agent/client.rs:3499-3509 | src/agent/client.rs:3541-3550 | src/agent/client.rs:3559-3573 — 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 (6 members, 9+ corresponding lines) · ×1
Edited copies of one member (6 members, 9+ corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:118— crates/smolvm-cuda-shim/src/lib.rs:118-127 | crates/smolvm-cuda-shim/src/lib.rs:130-139 | crates/smolvm-cuda-shim/src/lib.rs:140-149 | crates/smolvm-cudart-shim/src/lib.rs:88-96 | crates/smolvm-cudart-shim/src/lib.rs:99-107 | crates/smolvm-cudart-shim/src/lib.rs:108-116 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) src/cli/vm_common.rs:3182— src/cli/vm_common.rs:3182-3191 | src/portable_checkpoint.rs:4545-4551 | src/portable_checkpoint.rs:4588-4594 — 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 (7 members, 8+ corresponding lines) · ×1
Edited copies of one member (7 members, 8+ corresponding lines) crates/smolvm-pack/src/extract.rs:1862— crates/smolvm-pack/src/extract.rs:1862-1869 | crates/smolvm-pack/src/extract.rs:1875-1882 | src/agent/client.rs:382-389 | src/agent/client.rs:473-480 | src/cli/machine.rs:994-1001 | src/cli/pack_run.rs:84-91 | src/data/image_source.rs:181-188 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) crates/smolvm-cuda-shim/src/lib.rs:3449— crates/smolvm-cuda-shim/src/lib.rs:3449-3456 | crates/smolvm-cuda/src/host/gpu.rs:1167-1171 | crates/smolvm-cudart-shim/src/lib.rs:5277-5281 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (71–82 lines × 2) src/agent/manager.rs:2690— src/agent/manager.rs:2690-2771 | src/agent/manager.rs:3980-4050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (66 lines × 2) src/config.rs:1049— src/config.rs:1049-1114 | src/config.rs:1159-1224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/config.rs:1049` 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 (35–54 lines × 2) crates/smolvm-cuda-codegen/src/main.rs:167— crates/smolvm-cuda-codegen/src/main.rs:167-201 | crates/smolvm-cuda-codegen/src/main.rs:257-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-codegen/src/main.rs:167` it does not close everything it opens, so those 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 (35–45 lines × 2) crates/smolvm-agent/src/publish_socket.rs:324— crates/smolvm-agent/src/publish_socket.rs:324-358 | crates/smolvm-agent/src/relay.rs:22-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/publish_socket.rs:324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (42 lines × 2) src/api/rollout.rs:1046— src/api/rollout.rs:1046-1087 | src/api/rollout.rs:1218-1259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/rollout.rs:1046` 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 `request` to `PublishRolloutPolicyRequest` in one and `PublishDeviceRolloutPolicyRequest` 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 (34–38 lines × 2) src/cli/machine.rs:2441— src/cli/machine.rs:2441-2478 | src/cli/machine.rs:2593-2626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/machine.rs:2441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (36–46 lines × 2) src/cuda_daemon.rs:1730— src/cuda_daemon.rs:1730-1765 | src/cuda_daemon.rs:1851-1896 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:1730` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) src/config.rs:1016— src/config.rs:1016-1047 | src/config.rs:1126-1157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/config.rs:1016` it does not close everything it opens, so those exact lines 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–31 lines × 2) crates/smolvm-agent/src/main.rs:5690— crates/smolvm-agent/src/main.rs:5690-5719 | crates/smolvm-agent/src/main.rs:6263-6293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:5690` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/smolvm-agent/src/main.rs:6298` calls `output` and `crates/smolvm-agent/src/main.rs:5721` 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 (31 lines × 2) src/cli/pack_run.rs:1911— src/cli/pack_run.rs:1911-1941 | src/cli/pack_run.rs:2343-2373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–30 lines × 2) crates/smolvm-agent/src/process.rs:677— crates/smolvm-agent/src/process.rs:677-706 | crates/smolvm-agent/src/process.rs:711-736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/process.rs:677` it begins part-way through the construct above it, so those exact lines 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–30 lines × 2) crates/smolvm-registry/src/client.rs:339— crates/smolvm-registry/src/client.rs:339-367 | crates/smolvm-registry/src/client.rs:460-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-registry/src/client.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.
Duplicated block (20–29 lines × 2) src/api/handlers/exec.rs:69— src/api/handlers/exec.rs:69-97 | src/api/handlers/exec.rs:246-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–28 lines × 2) crates/smolvm-agent/src/storage.rs:6120— crates/smolvm-agent/src/storage.rs:6120-6147 | crates/smolvm-agent/src/storage.rs:6344-6369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:6120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26–27 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:196— crates/smolvm-cuda-shim/src/lib.rs:196-222 | crates/smolvm-cudart-shim/src/lib.rs:161-186 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 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 (23–26 lines × 2) crates/smolvm-pack/src/extract.rs:5668— crates/smolvm-pack/src/extract.rs:5668-5693 | crates/smolvm-pack/src/extract.rs:5719-5741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–25 lines × 2) src/agent/manager.rs:3866— src/agent/manager.rs:3866-3890 | src/cli/pack_run.rs:163-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24 lines × 2) crates/smolvm-pack/src/extract.rs:28— crates/smolvm-pack/src/extract.rs:28-51 | src/disk_utils.rs:462-485 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21–24 lines × 2) crates/smolvm-registry/src/client.rs:856— crates/smolvm-registry/src/client.rs:856-879 | crates/smolvm-registry/src/client.rs:950-970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-registry/src/client.rs:856` it begins part-way through the construct above it, so those 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 (19–24 lines × 2) src/cli/pack_run.rs:747— src/cli/pack_run.rs:747-770 | src/cli/pack_run.rs:1957-1975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack_run.rs:747` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) src/api/rollout.rs:995— src/api/rollout.rs:995-1017 | src/api/rollout.rs:1138-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/rollout.rs:995` 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 `request` to `PublishRolloutPolicyRequest` in one and `PublishDeviceRolloutPolicyRequest` 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 (16–22 lines × 3) crates/smolvm-cudart-shim/src/lib.rs:5888— crates/smolvm-cudart-shim/src/lib.rs:5888-5903 | crates/smolvm-cudart-shim/src/lib.rs:5943-5958 | crates/smolvm-cudart-shim/src/lib.rs:6019-6040 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-cudart-shim/src/lib.rs:5941` calls `extend_from_slice`, `to_le_bytes` and `crates/smolvm-cudart-shim/src/lib.rs:5886` 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 (21–22 lines × 2) crates/smolvm-registry/src/client.rs:1285— crates/smolvm-registry/src/client.rs:1285-1306 | crates/smolvm-registry/src/client.rs:1369-1389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/smolvm-cuda/src/host.rs:1346— crates/smolvm-cuda/src/host.rs:1346-1366 | crates/smolvm-cuda/src/host.rs:1384-1404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:1346` 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 (18–21 lines × 2) src/disk_utils.rs:250— src/disk_utils.rs:250-267 | src/disk_utils.rs:277-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/disk_utils.rs:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/smolvm-agent/src/main.rs:4322— crates/smolvm-agent/src/main.rs:4322-4341 | crates/smolvm-agent/src/main.rs:4779-4800 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:4322` 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) crates/smolvm-agent/src/main.rs:6566— crates/smolvm-agent/src/main.rs:6566-6583 | crates/smolvm-agent/src/main.rs:6864-6880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/main.rs:6566` 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 (19–20 lines × 2) crates/smolvm-network/src/tcp_relay.rs:967— crates/smolvm-network/src/tcp_relay.rs:967-985 | crates/smolvm-network/src/tcp_relay.rs:1076-1095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-network/src/tcp_relay.rs:967` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-network/src/tcp_relay.rs:1074` calls `V4` and `crates/smolvm-network/src/tcp_relay.rs:965` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–18 lines × 2) crates/smolvm-pack/src/extract.rs:1840— crates/smolvm-pack/src/extract.rs:1840-1857 | src/api/handlers/machines.rs:245-259 — before extracting anything, compare `crates/smolvm-pack/src/extract.rs` and `src/api/handlers/machines.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:1840` 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–17 lines × 3) src/cli/pack_run.rs:862— src/cli/pack_run.rs:862-878 | src/cli/pack_run.rs:2051-2063 | src/cli/pack_run.rs:2506-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 `src/cli/pack_run.rs:862` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cli/pack_run.rs:881` calls `Err`, `remove_dir_all`, `path` and `src/cli/pack_run.rs:2519` 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–17 lines × 3) src/cuda_daemon.rs:1746— src/cuda_daemon.rs:1746-1761 | src/cuda_daemon.rs:1810-1826 | src/cuda_daemon.rs:1867-1883 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–17 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:1116— crates/smolvm-cuda-shim/src/lib.rs:1116-1130 | crates/smolvm-cuda-shim/src/lib.rs:1336-1352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:1116` 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–17 lines × 2) crates/smolvm-pack/src/extract.rs:70— crates/smolvm-pack/src/extract.rs:70-86 | src/agent/fork.rs:145-160 — 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–17 lines × 2) src/image_store.rs:43— src/image_store.rs:43-52 | src/image_store.rs:224-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–16 lines × 4) src/platform/linux.rs:93— src/platform/linux.rs:93-108 | src/platform/macos.rs:54-56 | src/platform/macos.rs:244-259 | src/platform/windows.rs:31-45 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/platform/macos.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 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–16 lines × 2) crates/smolvm-cuda-shim/src/lib.rs:1404— crates/smolvm-cuda-shim/src/lib.rs:1404-1419 | crates/smolvm-cudart-shim/src/lib.rs:4570-4579 — before extracting anything, compare `crates/smolvm-cuda-shim/src/lib.rs` and `crates/smolvm-cudart-shim/src/lib.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda-shim/src/lib.rs:1404` it does not close everything it opens, so those exact lines 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–16 lines × 3) crates/smolvm-pack/src/assets.rs:351— crates/smolvm-pack/src/assets.rs:351-365 | crates/smolvm-pack/src/assets.rs:447-462 | crates/smolvm-pack/src/assets.rs:971-975 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/assets.rs:351` it does not close everything it opens, so those 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–16 lines × 2) crates/smolvm-pack/src/extract.rs:2210— crates/smolvm-pack/src/extract.rs:2210-2225 | crates/smolvm-pack/src/extract.rs:5420-5430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–16 lines × 3) crates/smolvm-pack/src/extract.rs:4289— crates/smolvm-pack/src/extract.rs:4289-4304 | crates/smolvm-pack/src/extract.rs:4333-4346 | crates/smolvm-pack/src/extract.rs:5446-5448 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:4289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/smolvm-pack/src/extract.rs:4289` calls `map_err` and `crates/smolvm-pack/src/extract.rs:5446` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–16 lines × 2) crates/smolvm-registry/src/pull.rs:512— crates/smolvm-registry/src/pull.rs:512-527 | crates/smolvm-registry/src/pull.rs:724-736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–16 lines × 2) src/api/handlers/machines.rs:4022— src/api/handlers/machines.rs:4022-4033 | src/api/state.rs:1766-1781 — before extracting anything, compare `src/api/handlers/machines.rs` and `src/api/state.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:4022` it does not close everything it opens, so those exact lines 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–15 lines × 2) crates/smolvm-agent/src/storage.rs:3064— crates/smolvm-agent/src/storage.rs:3064-3074 | crates/smolvm-agent/src/storage.rs:6741-6755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-agent/src/storage.rs:3064` it does not close everything it opens, so those exact lines 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–15 lines × 2) crates/smolvm-cuda/src/host.rs:6326— crates/smolvm-cuda/src/host.rs:6326-6340 | crates/smolvm-cuda/src/host.rs:6350-6362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host.rs:6326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) src/agent/launcher.rs:1954— src/agent/launcher.rs:1954-1967 | src/agent/launcher_dynamic.rs:727-739 — before extracting anything, compare `src/agent/launcher.rs` and `src/agent/launcher_dynamic.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/launcher.rs:1954` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) src/dns_filter.rs:200— src/dns_filter.rs:200-213 | src/dns_filter.rs:217-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 4) src/cuda_daemon.rs:1781— src/cuda_daemon.rs:1781-1793 | src/cuda_daemon.rs:1837-1849 | src/cuda_daemon.rs:3549-3561 | src/cuda_daemon.rs:4440-4456 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:1781` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cuda_daemon.rs:3565` calls `min` and `src/cuda_daemon.rs:4457` 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–13 lines × 2) crates/smolvm-cuda/src/host/gpu.rs:3753— crates/smolvm-cuda/src/host/gpu.rs:3753-3763 | crates/smolvm-cuda/src/host/gpu.rs:3770-3782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cuda/src/host/gpu.rs:3753` it does not close everything it opens, so those exact lines 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–12 lines × 4) crates/smolvm-agent/src/main.rs:8621— crates/smolvm-agent/src/main.rs:8621-8629 | crates/smolvm-agent/src/main.rs:8727-8738 | crates/smolvm-agent/src/main.rs:9008-9016 | crates/smolvm-agent/src/main.rs:9061-9069 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 3) crates/smolvm-agent/src/crun.rs:374— crates/smolvm-agent/src/crun.rs:374-385 | crates/smolvm-agent/src/crun.rs:444-454 | crates/smolvm-agent/src/crun.rs:496-506 — 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 (2–12 lines × 3) crates/smolvm-agent/src/attach.rs:268— crates/smolvm-agent/src/attach.rs:268-278 | crates/smolvm-agent/src/nsfile.rs:248-259 | crates/smolvm-agent/src/pod.rs:786-787 — 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 `crates/smolvm-agent/src/attach.rs:268` 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 (8–12 lines × 2) src/api/handlers/machines.rs:7378— src/api/handlers/machines.rs:7378-7389 | src/data/pack_ref.rs:232-239 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:7378` it does not close everything it opens, so those exact lines 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–11 lines × 3) src/cli/vm_common.rs:1228— src/cli/vm_common.rs:1228-1236 | src/cli/vm_common.rs:1592-1602 | src/embedded/control.rs:767-777 — before extracting anything, compare `src/cli/vm_common.rs` and `src/embedded/control.rs` as WHOLE FILES: this scan already matched 3 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 `src/cli/vm_common.rs:1228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/cli/vm_common.rs:1227` calls `clone` and `src/cli/vm_common.rs:1591` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) crates/smolvm-cudart-shim/src/lib.rs:5961— crates/smolvm-cudart-shim/src/lib.rs:5961-5977 | crates/smolvm-cudart-shim/src/lib.rs:6040-6056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-cudart-shim/src/lib.rs:5961` 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, `crates/smolvm-cudart-shim/src/lib.rs:5958` calls `extend_from_slice`, `to_le_bytes` and `crates/smolvm-cudart-shim/src/lib.rs:6039` 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–11 lines × 2) src/api/handlers/machines.rs:2203— src/api/handlers/machines.rs:2203-2213 | src/api/handlers/machines.rs:2222-2230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/api/handlers/machines.rs:2203` it begins part-way through the construct above it, so those 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. 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 × 5) crates/smolvm-registry/src/client.rs:397— crates/smolvm-registry/src/client.rs:397-406 | crates/smolvm-registry/src/client.rs:713-722 | crates/smolvm-registry/src/client.rs:805-814 | crates/smolvm-registry/src/client.rs:1128-1136 | crates/smolvm-registry/src/peer.rs:158-166 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 4) crates/smolvm-s3fs/src/fs.rs:842— crates/smolvm-s3fs/src/fs.rs:842-851 | crates/smolvm-s3fs/src/fs.rs:992-1000 | crates/smolvm-s3fs/src/fs.rs:1019-1028 | crates/smolvm-s3fs/src/fs.rs:1043-1051 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–10 lines × 2) crates/smolvm-agent/src/crun.rs:486— crates/smolvm-agent/src/crun.rs:486-495 | crates/smolvm-agent/src/crun.rs:550-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–10 lines × 2) crates/smolvm-network/src/dns_forward.rs:434— crates/smolvm-network/src/dns_forward.rs:434-439 | crates/smolvm-network/src/dns_relay.rs:208-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) crates/smolvm-registry/src/client.rs:496— crates/smolvm-registry/src/client.rs:496-504 | crates/smolvm-registry/src/client.rs:656-665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-registry/src/client.rs:496` 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 lines × 2) src/cli/pack.rs:986— src/cli/pack.rs:986-1007 | src/pack_export.rs:1503-1524 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/pack.rs:986` it begins part-way through the construct above it, so those exact lines 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) src/api/handlers/exec.rs:114— src/api/handlers/exec.rs:114-121 | src/api/handlers/exec.rs:175-182 | src/api/handlers/exec.rs:293-300 | src/api/handlers/exec.rs:654-661 | src/api/handlers/exec_sessions.rs:278-285 | src/api/handlers/machines.rs:4025-4032 | src/api/state.rs:1773-1780 — before extracting anything, compare `src/api/handlers/machines.rs` and `src/api/state.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/api/handlers/exec.rs:184` calls `clone` and `src/api/handlers/exec.rs:122` 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–8 lines × 5) crates/smolvm-s3fs/src/fs.rs:714— crates/smolvm-s3fs/src/fs.rs:714-720 | crates/smolvm-s3fs/src/fs.rs:845-852 | crates/smolvm-s3fs/src/fs.rs:995-1001 | crates/smolvm-s3fs/src/fs.rs:1022-1029 | crates/smolvm-s3fs/src/fs.rs:1046-1052 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 2) crates/smolvm-agent/src/storage.rs:5211— crates/smolvm-agent/src/storage.rs:5211-5217 | crates/smolvm-agent/src/storage.rs:5341-5348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (4–8 lines × 3) src/api/device_handoff.rs:329— src/api/device_handoff.rs:329-336 | src/cuda_daemon.rs:504-511 | src/cuda_daemon.rs:4357-4360 — 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 (6–7 lines × 3) src/api/device_handoff.rs:328— src/api/device_handoff.rs:328-333 | src/cuda_daemon.rs:502-508 | src/cuda_daemon.rs:537-542 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/cuda_daemon.rs:502` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (2–7 lines × 3) crates/smolvm-pack/src/extract.rs:3598— crates/smolvm-pack/src/extract.rs:3598-3604 | crates/smolvm-pack/src/extract.rs:3699-3700 | crates/smolvm-pack/src/extract.rs:4178-4184 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/smolvm-pack/src/extract.rs:3598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) src/engine/containers.rs:383— src/engine/containers.rs:383-389 | src/engine/containers.rs:2087-2092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 4) src/api/handlers/machines.rs:6244— src/api/handlers/machines.rs:6244-6249 | src/api/handlers/machines.rs:6349-6355 | src/api/handlers/machines.rs:6546-6552 | src/api/handlers/machines.rs:7020-7026 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–6 lines × 2) src/agent/fork.rs:1700— src/agent/fork.rs:1700-1704 | src/agent/fork.rs:1710-1715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/agent/fork.rs:1710` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/smolvm-cuda/src/host.rs:5273— crates/smolvm-cuda/src/host.rs:5273-5278 | crates/smolvm-cuda/src/host.rs:5380-5385 | crates/smolvm-cuda/src/host.rs:5396-5401 | crates/smolvm-cuda/src/host.rs:6325-6330 | crates/smolvm-cuda/src/host.rs:6349-6354 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (3–5 lines × 4) src/platform/linux.rs:111— src/platform/linux.rs:111-115 | src/platform/macos.rs:56-58 | src/platform/macos.rs:262-266 | src/platform/windows.rs:48-52 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/platform/linux.rs:111` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/platform/linux.rs:111` calls `iter`, `as_ptr`, `collect` and `src/platform/macos.rs:56` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) bench/workload_dpo.py:16— bench/workload_dpo.py:16-18 | demo/dpo_train.py:15-17 | demo/qlora_train.py:14-16 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 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.
Coverage not measured — Rust suite — Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root ran but left no coverage of the workspace's own crates. 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.
Weak hash algorithm src/agent/websocket.rs:33— 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.
Interpolated log message defeats structured logging src/cuda_daemon.rs:1986— `info!` at line 1986 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 src/cuda_host.rs:556— `info!` at line 556 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 src/internal_boot.rs:696— `warn!` at line 696 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 src/vm_exit.rs:213— `info!` at line 213 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 src/vm_exit.rs:215— `warn!` at line 215 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 src/vm/backend/libkrun.rs:150— `debug!` at line 150 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 src/vm/backend/libkrun.rs:167— `debug!` at line 167 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 src/vm/backend/libkrun.rs:239— `debug!` at line 239 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 src/vm/backend/libkrun.rs:240— `debug!` at line 240 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 src/vm/backend/libkrun.rs:241— `debug!` at line 241 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 src/vm/backend/libkrun.rs:242— `debug!` at line 242 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 src/vm/backend/libkrun.rs:245— `debug!` at line 245 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 src/vm/backend/libkrun.rs:269— `warn!` at line 269 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 src/vm/backend/libkrun.rs:321— `warn!` at line 321 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 src/vm/backend/libkrun.rs:341— `warn!` at line 341 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 src/vm/backend/libkrun.rs:360— `warn!` at line 360 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 src/vm/backend/libkrun.rs:377— `warn!` at line 377 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 src/vm/backend/libkrun.rs:490— `debug!` at line 490 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 src/vm/backend/libkrun.rs:503— `debug!` at line 503 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 src/vm/backend/libkrun.rs:525— `debug!` at line 525 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 src/vm/backend/libkrun.rs:527— `debug!` at line 527 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 src/vm/backend/libkrun.rs:539— `debug!` at line 539 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 src/platform/macos.rs:61— `debug!` at line 61 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 src/platform/macos.rs:219— `debug!` at line 219 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 src/network/private_floor.rs:119— `warn!` at line 119 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`.
Silent fallback default on Err crates/smolvm-agent/src/nsfile.rs:935— `live_main_containers` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-agent/src/nsfile.rs:953— `live_containers` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-agent/src/process.rs:338— `live_descendants` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-agent/src/process.rs:405— `pipe_writers` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-agent/src/process.rs:423— `open_pipes` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-cudart-shim/src/lib.rs:1980— `smolvm_cudart_translate_host_pointers` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-cudart-shim/src/lib.rs:5199— `nvcompBatchedDeflateDecompressGetTempSizeEx` turns every `Err` into `1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-cudart-shim/src/lib.rs:5400— `cudnnBackendGetAttribute` turns every `Err` into `1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-cudart-shim/src/lib.rs:5409— `cudnnBackendFinalize` turns every `Err` into `1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-cudart-shim/src/lib.rs:6131— `bn_size_call` turns every `Err` into `1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-network/src/watchlist.rs:282— `record_once` turns every `Err` into `Verdict::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-network/src/switch.rs:104— `parse_endpoint_file` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-pack/src/extract.rs:1904— `dir_disk_usage` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-pack/src/extract.rs:1953— `evict_cache_to_size_protecting` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-pack/src/extract.rs:5017— `sum_tar_sizes` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/smolvm-registry/src/client.rs:159— `upload_http_client` turns every `Err` into `reqwest::Client::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/agent/krun.rs:402— `console_output_to_file` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/agent/krun.rs:433— `console_output_to_file` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/pack_export.rs:644— `describe_source_device` turns every `Err` into `String::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/agent/manager.rs:476— `walk_blocks` (in `disk_used_mb`) turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/api/cache_base_budget.rs:107— `scan` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/network/private_floor.rs:60— `hosts_blocked_by_private_floor` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/pack_export.rs:383— `directory_apparent_bytes` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Duplicated predicate crates/smolvm-agent/src/credentials.rs:103— `!bundle.is_empty() && !bundle.ends_with(b"\n")` appears character-identically in 2 files — crates/smolvm-agent/src/credentials.rs, crates/smolvm-agent/src/storage.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 src/engine/api.rs:938— `!c.is_running() && c.record().state.status != "restarting"` appears character-identically in 2 files — src/engine/api.rs, src/engine/containers.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 src/agent/launcher.rs:2263— `!mount.staged && super::fsnotify_watch::watching_enabled()` appears character-identically in 2 files — src/agent/launcher.rs, src/agent/launcher_dynamic.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 src/agent/launcher.rs:918— `cpu_profile_result < 0 && cpu_profile_result != -libc::ENOTSUP` appears character-identically in 2 files — src/agent/launcher.rs, src/agent/launcher_dynamic.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 crates/smolvm-cuda-shim/src/lib.rs:1082— `device.is_null() || pci_bus_id.is_null()` appears character-identically in 2 files — crates/smolvm-cuda-shim/src/lib.rs, crates/smolvm-cudart-shim/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 crates/smolvm-cuda-shim/src/lib.rs:191— `e == libc::EAGAIN || e == libc::EWOULDBLOCK` appears character-identically in 2 files — crates/smolvm-cuda-shim/src/lib.rs, crates/smolvm-cudart-shim/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 src/agent/launcher.rs:3120— `engine == BlockIoEngine::Async || durability == DiskDurability::Deferred` appears character-identically in 2 files — src/agent/launcher.rs, src/agent/launcher_dynamic.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 src/data/pack_ref.rs:180— `first.contains('.') || first.contains(':') || first == "localhost"` appears character-identically in 2 files — src/data/pack_ref.rs, src/engine/images.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 crates/smolvm-protocol/src/lib.rs:2401— `image == "alpine:3.20" && workload_id == "fork-overlay-owner"` appears character-identically in 2 files — crates/smolvm-protocol/src/lib.rs, src/agent/client.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 crates/smolvm-agent/src/oci.rs:430— `line.is_empty() || line.starts_with('#')` appears character-identically in 4 files — crates/smolvm-agent/src/oci.rs, crates/smolvm-network/src/egress.rs, crates/smolvm-network/src/watchlist.rs, src/data/image_source.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 crates/smolvm-agent/src/storage.rs:2233— `n >= 2 && magic[0] == 0x1f && magic[1] == 0x8b` appears character-identically in 2 files — crates/smolvm-agent/src/storage.rs, crates/smolvm-oci-layer/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 crates/smolvm-agent/src/storage.rs:6519— `potential_registry.contains('.') || potential_registry.contains(':')` appears character-identically in 2 files — crates/smolvm-agent/src/storage.rs, src/registry.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 src/agent/launcher.rs:3174— `r == -libc::ENOSYS || r == -libc::EPERM || r == -libc::EACCES || r == -libc::ENOTSUP` appears character-identically in 2 files — src/agent/launcher.rs, src/agent/launcher_dynamic.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 src/api/handlers/machines.rs:3720— `record.external_interceptor_required && external_interceptor.is_none()` appears character-identically in 3 files — src/api/handlers/machines.rs, src/cli/machine.rs, src/cli/vm_common.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 src/api/memory_pressure.rs:211— `record.state == RecordState::Running && record.is_process_alive()` appears character-identically in 2 files — src/api/memory_pressure.rs, src/embedded/runtime.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 crates/smolvm-agent/src/disk_trim.rs:57— `v.eq_ignore_ascii_case("off") || v == "0"` appears character-identically in 2 files — crates/smolvm-agent/src/disk_trim.rs, src/agent/launcher.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.
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.
No ADRs found Cargo.toml:38— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `Cargo.toml` makes this repository a deployable product (line 38).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 18 project(s) overshoot their size bounds, lowering Project Cohesion to 8.9/10. The most over is `(repository root)` (171823 LoC, 590 module-visible types across 19 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No seccomp profile REDACTED:11— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
README/code drift docs/dev-env/README.md:55— docs/dev-env/README.md links to `../live-resize.md`, but `docs/live-resize.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, 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 10/13 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/smolvm-cuda-codegen`, `crates/smolvm-cuda-guest`.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment automation exists and the service already exposes health probe endpoints (healthz/livez/readyz or a container healthcheck), but no manifest in this repository wires them into readiness/liveness probes, a rolling-update strategy, lifecycle hooks or a migration job — a bad release is harder to detect and reverse. If that wiring lives in a separate ops/Helm repository, document the pointer here so release safety is evidenced.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
No security response headers detected — 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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (src/engine/supervisor.rs:448).
Outdated: bytes — `bytes` is locked at 1.11.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/smolvm-credentials/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
Outdated: crc32fast — `crc32fast` is locked at 1.5.0 but 1.5.5 is the current stable release on crates.io, and it already satisfies the `"1.4"` requirement declared in crates/smolvm-pack/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
Outdated: crossbeam-queue — `crossbeam-queue` is locked at 0.3.12 but 0.3.14 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/smolvm-network/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam-queue` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: futures-util — `futures-util` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
Outdated: http-body — `http-body` is locked at 1.0.1 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body` and commit the updated REDACTED.
Outdated: http-body-util — `http-body-util` is locked at 0.1.3 but 0.1.5 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in crates/smolvm-credentials/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body-util` and commit the updated REDACTED.
Outdated: humantime — `humantime` is locked at 2.3.0 but 2.4.0 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p humantime` and commit the updated REDACTED.
Outdated: hyper — `hyper` is locked at 1.10.1 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper` and commit the updated REDACTED.
Outdated: hyper-util — `hyper-util` is locked at 0.1.20 but 0.1.21 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper-util` and commit the updated REDACTED.
Outdated: imago — `imago` is locked at 0.2.4 but 0.2.6 is the current stable release on crates.io, and it already satisfies the `"0.2.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p imago` and commit the updated REDACTED.
Outdated: ipnet — `ipnet` is locked at 2.12.0 but 2.12.2 is the current stable release on crates.io, and it already satisfies the `"2.12.0"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ipnet` and commit the updated REDACTED.
Outdated: landlock — `landlock` is locked at 0.4.5 but 0.4.7 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p landlock` and commit the updated REDACTED.
Outdated: lazy_static — `lazy_static` is locked at 1.5.0 but 1.5.1 is the current stable release on crates.io, and it already satisfies the `"1.4"` requirement declared in crates/smolvm-agent/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p lazy_static` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.186 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: log — `log` is locked at 0.4.32 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/smolvm-shim/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
Outdated: pkg-config — `pkg-config` is locked at 0.3.33 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p pkg-config` and commit the updated REDACTED.
Outdated: rustix — `rustix` is locked at 1.1.4 but 1.1.6 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/smolvm-agent/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustix` and commit the updated REDACTED.
Outdated: rustls-native-certs — `rustls-native-certs` is locked at 0.8.4 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/smolvm-registry/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls-native-certs` and commit the updated REDACTED.
Outdated: rustls-pki-types — `rustls-pki-types` is locked at 1.14.1 but 1.16.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls-pki-types` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.150 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: socket2 — `socket2` is locked at 0.6.4 but 0.6.5 is the current stable release on crates.io, and it already satisfies the `"0.6"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p socket2` and commit the updated REDACTED.
Outdated: time — `time` is locked at 0.3.47 but 0.3.55 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/smolvm-pack/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p time` and commit the updated REDACTED.
Outdated: tokio-rustls — `tokio-rustls` is locked at 0.26.4 but 0.26.6 is the current stable release on crates.io, and it already satisfies the `"0.26"` requirement declared in crates/smolvm-credentials/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-rustls` and commit the updated REDACTED.
+ 5 more in this group — see findings.md.
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.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a1db50-ae44-7083-a1f0-f643cad6a2d2 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 108 · Warnings: 1400 · Recommendations: 96 · Info: 30 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 18:27 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.